Skip to main content

Liquid Filters for Workflow Data Transformation

Liquid filters are transformation functions that modify workflow data output. Chain multiple filters together to format text, perform calculations, manipulate arrays, and process dates within your automation workflows. Filter syntax: {{ workflow_data | filter_name: argument1, argument2 }} Common filter use cases:
  • Format API response data for display
  • Clean and validate user input
  • Perform calculations on numeric values
  • Transform arrays from external services
  • Format dates for different systems

String Filters: Text Processing and Formatting

Transform text data from workflow steps with these essential string manipulation filters:
Filter & SyntaxDescriptionExample
upcaseConverts a string to uppercase.{{ "hello" | upcase }}HELLO
downcaseConverts a string to lowercase.{{ "HELLO" | downcase }}hello
capitalizeCapitalizes the first word of a string.{{ "hello world" | capitalize }}Hello world
truncate: numShortens a string to num characters.{{ "Hello world" | truncate: 8 }}Hello...
split: "char"Splits a string into an array on a character.{{ "a,b,c" | split: "," }}["a","b","c"]
append: "str"Adds a string to the end.{{ "hello" | append: " world" }}hello world
prepend: "str"Adds a string to the beginning.{{ "world" | prepend: "hello " }}hello world
remove: "str"Removes all occurrences of a substring.{{ "hello world" | remove: "l" }}heo word
replace: "a", "b"Replaces all occurrences of string “a” with “b”.{{ "hi hi" | replace: "hi", "bye" }}bye bye
escapeEscapes a string for use in HTML.{{ "<p>text</p>" | escape }}&lt;p&gt;text&lt;/p&gt;

Number Filters: Mathematical Operations and Formatting

Perform calculations and format numeric data from workflow API responses and user inputs:
Filter & SyntaxDescriptionExample
plus: numAdds a number.{{ 5 | plus: 3 }}8
minus: numSubtracts a number.{{ 5 | minus: 3 }}2
times: numMultiplies by a number.{{ 5 | times: 3 }}15
divided_by: numDivides by a number.{{ 15 | divided_by: 3 }}5
round: digitsRounds to the nearest integer or specified decimal places.{{ 4.56 | round }}5
ceilRounds up to the nearest integer.{{ 4.1 | ceil }}5
floorRounds down to the nearest integer.{{ 4.9 | floor }}4

Array Filters: Process Lists and Collections

Manipulate arrays and lists from API responses, database queries, and workflow data:
Filter & SyntaxDescriptionExample
sizeReturns the number of items in an array.{{ [1,2,3] | size }}3
firstReturns the first item of an array.{{ ["a","b"] | first }}a
lastReturns the last item of an array.{{ ["a","b"] | last }}b
join: "char"Joins array elements with a character.{{ ["a","b"] | join: ", " }}a, b
sort: "key"Sorts an array. Can sort an array of objects by a key.{{ [3,1,2] | sort }}[1,2,3]
uniqRemoves duplicate elements from an array.{{ [1,2,2,3] | uniq }}[1,2,3]
map: "key"Creates an array of values by extracting a key from objects.{{ users | map: "name" }}["Alice", "Bob"]

Date Filters: Advanced Date Processing for Workflows

Custom date filters designed specifically for workflow automation, enabling sophisticated date parsing, formatting, and conditional logic:

carbon_date: Parse and Format Dates

The carbon_date filter automatically parses various date formats and converts them to your desired output format. Essential for standardizing date formats between different APIs and systems. Syntax: {{ date_string | carbon_date: "output_format" }}
{{ "2025-12-25T10:30:00Z" | carbon_date: "F j, Y" }}
Common Format Codes:
CodeDescriptionExample
YFour-digit year2025
mMonth (01-12)12
dDay (01-31)25
HHour (00-23)10
iMinute (00-59)30
sSecond (00-59)00
FFull month nameDecember
MShort month nameDec
lFull day of weekThursday
DShort day of weekThu
cISO 8601 format2025-12-25T10:30:00+00:00

carbon_condition: Date-Based Workflow Logic

The carbon_condition filter enables date-based conditional logic in workflows, returning boolean values for time-based decision making. Perfect for expiration checks, deadline monitoring, and time-sensitive automation. Syntax: {{ date_string | carbon_condition: "condition_name" }}
{% if subscription.expires_at | carbon_condition: "is_past" %}
  Your subscription has expired.
{% endif %}
Available Conditions:
ConditionDescription
is_todayIs the date today?
is_tomorrowIs the date tomorrow?
is_yesterdayWas the date yesterday?
is_futureIs the date in the future?
is_pastIs the date in the past?
is_weekendIs the date on a weekend?
is_weekdayIs the date on a weekday?
in_7_daysIs the date exactly 7 days from now?
within_14_daysIs the date between now and 14 days from now?
before_30_daysIs the date before 30 days from now?
older_than_90_daysIs the date more than 90 days in the past?
newer_than_3_daysIs the date within the last 3 days?
after_5_daysIs the date more than 5 days in the future?
exactly_1_dayIs the date exactly 1 day from now? (Same as is_tomorrow)
For conditions like in_X_days, you can use singular or plural (e.g., in_1_day works too).
I