The Workflow Expression Builder

The Workflow Expression Builder

The expression builder is a guided dialog that composes placeholders and filters for any string field inside a workflow. Open it from the field suffix icon on any action config, branch condition, or input mapping.

Why Use Placeholders

Placeholders pull dynamic data from the trigger record, related entities, previous step outputs, loop items, and change sets. They let one workflow handle every matching record without hard-coding values.

Placeholder Forms

  • {{trigger.field}}: a direct field on the trigger record (for example, {{trigger.title}}).
  • {{trigger.relation.field}}: a field on an allow-listed related record (for example, {{trigger.owner.email}}).
  • {{steps.<step_name>.output.<key>}}: the output of a previously executed named action.
  • {{loop.item}}, {{loop.item.<field>}}, {{loop.index}}: the current loop iteration inside a for-each body.
  • {{change_set.<field>}}, {{change_set.<field>|from}}, {{change_set.<field>|to}}: the old and new values of a changed field, available for field-changed triggers.
  • {{now}}, {{now -7d}}, {{now +1h}}: the current UTC datetime at execution time, optionally offset. Units are m (minutes), h (hours), d (days), w (weeks), and M (months).

Field Pickers

The dialog offers a picker for each placeholder form. The trigger field picker shows every field on the trigger entity. The relation picker traverses allow-listed relationships in a single click, so you do not have to guess path names. The step output picker lists every previously named step in the workflow. The loop item picker threads the source entity’s schema into nested dialogs when you are inside a for-each body.

Filter Pipeline

Append filters to any placeholder with | to transform the output. Filters chain left to right:

  • upper, lower, title: change case.
  • default:'value': return the default when the input is empty or null.
  • date:'Y-m-d': format a datetime using PHP date format tokens.
  • truncate:100: shorten the input to at most N characters.
  • json: JSON-encode the input.
  • map:'field': project a field from each item in a collection.
  • take:N: keep the first N items of a collection.
  • join:', ': join a collection into a string using the supplied separator.

Worked Example

{{trigger.tasks | map:'title' | take:5 | join:', '}} projects the title of the first five tasks on the trigger record and joins them with commas. {{trigger.due_date | date:'Y-m-d'}} formats a due date as an ISO date.

Branch Conditions

Inside a branch, the expression builder populates the left side (the field) and the comparison operator, then offers a placeholder picker for the right side. This makes it easy to compare trigger fields, step outputs, and change sets without typing raw expressions.

Validation

The dialog validates every placeholder against the schema for the chosen entity before you save. Invalid paths are highlighted with a clear error message so you can fix them in place.

Tips

  • Name your steps. Descriptive step names (incident_summary, ticket_response) make downstream placeholders self-documenting.
  • Use {{now}} offsets to build rolling windows in for-each query sources, for example “created_at greater than {{now -7d}}“.
  • Chain map, take, and join to summarise collections into a single readable line.
  • Use default:'Unassigned' to avoid empty strings in notification bodies.

¿Le resultó útil este artículo?