Workflow Inputs
- What workflow inputs are and which variables each trigger type exposes
- How to reference those variables with CEL expressions in steps
- How to define custom inputs for manual workflows
Workflow inputs are the values that carry data from the trigger event into your workflow steps. You read them inside steps with CEL (Common Expression Language) expressions, so each step adapts to the specific data of every run instead of using hardcoded values.
How CEL fields work
Every CEL-enabled field in a step (text, URL, body, filter, condition, and so on) takes a value in the {expr: "..."} object form. When the workflow runs, the expression inside expr is evaluated against the current execution context and replaced with the result.
For example, a message step's text field can be:
{"expr": "'Hello ' + contact.name + ', your appointment is confirmed for ' + format_datetime(occurrenceDate, 'YYYY-MM-DD')"}
If contact.name is "Maria Silva" and occurrenceDate is March 15 2025, the step sends:
"Hello Maria Silva, your appointment is confirmed for 2025-03-15."
For string-heavy fields you can also use the tpl() function, which fills single-brace {key} placeholders from a values object: tpl('Hello {name}', {name: contact.name}).
The {{ }} double-curly-brace syntax does not apply here — it only exists in WhatsApp message templates.
Variables by trigger type
The variables available to a workflow depend on its trigger type. These are always present:
| Variable | Description |
|---|---|
company | The company object (companyName, _id, options, planId) |
step(N) | The output of step N (0-indexed), e.g. step(0).data |
A hook trigger (fires on a document create/update/delete) also exposes:
| Variable | Description |
|---|---|
doc | The document being created, updated, or deleted |
prev | The document's previous state (on update only) |
op | The lifecycle operation that fired the hook, e.g. afterCreate, afterUpdate, or afterDelete (one of beforeSave/afterSave/beforeCreate/afterCreate/beforeUpdate/afterUpdate/beforeDelete/afterDelete) |
model | The dynadata model that fired the hook (e.g. contacts, ct:events) |
A temporal trigger (runs on a schedule) exposes:
| Variable | Description |
|---|---|
occurrenceDate | The scheduled date/time for this occurrence |
When a workflow runs from an agent conversation, the assistant context variables are also reachable, including contact (contact.name, contact.contactIdentification for the channel identifier such as a phone number or username, and contact.channelType for the channel) and contactMessage (contactMessage.body.text for a received message's text).
Using inputs in steps
When configuring a step in the Steps section, set each CEL field to an {expr: "..."} value that references the variables above. You can combine static text with several variables in one expression:
{"expr": "'Dear ' + contact.name + ', you have an upcoming appointment on ' + format_datetime(occurrenceDate, 'DD/MM/YYYY') + '.'"}
Custom inputs for manual workflows
When a workflow uses a manual trigger, you can define custom input fields in the Parameters section. The employee fills them in before running the workflow — useful when the workflow needs information that no automatic event provides.
Each parameter has a name, a type (string, number, boolean, datetime, or ref), and an optional description. The name becomes a top-level CEL variable: a parameter named report_date is referenced as report_date (not parameters.report_date).
For example, define a report_date parameter; the employee enters it when clicking Run, and your steps read it as:
{"expr": "report_date"}
The same workflow then produces different results depending on what the employee enters each time.