Skip to content

Templating & Variables

Flows use a powerful templating engine to reference inputs, step results, and helper functions.

Note: In the UI, this may appear as an expression editor. In the examples below, braces are spaced as { {value} } so the documentation renderer does not evaluate them. In the Flow editor, type them without spaces.

Context Sources

  • Direct inputs: Values provided by an API call, form trigger, webhook, or schedule are merged directly into the Flow context. For example, an input named searchQuery is referenced as { {searchQuery} }.
  • Step outputs: A step writes its result to the variable name configured in that step's output field. For example, an LLM step with output summary can be referenced as { {summary.response} }.
  • _trigger: Trigger info { type, data }, for example { {_trigger.data} }.
  • flow: Runtime metadata such as flow.id, flow.executionId, flow.currentStepName, flow.nextStepName, and flow.triggerType.
  • step: Current step metadata such as step.currentId, step.currentName, step.previousName, and step.nextName.
  • _resumeData: Data supplied when resuming generic paused runs.
  • approval: User Approval resume data, including approval.decision, approval.decidedAt, approval.decidedBy, and approval.message.

Helpers

  • str(value): Stringify a JSON object, for example { {str(searchResults)} }
  • getDate(): Current date/time string
  • currentDate: Current date/time string captured for the run
  • currentUser: { name, surname, role, email } when available

Loop Variables

Loop steps add temporary context while their nested steps run:

  • each: item, index, and _each (item, index, total, isFirst, isLast)
  • while: iteration and _while (iteration, run, isFirst)

These aliases are restored after the loop finishes.

Examples

Prompt with dynamic content

Summarize the following results for { {searchQuery} } in a { {summaryLength} } tone:

{ {searchResults.results} }

Final outputs

Define in the Final step:

  • Name: summary
  • Output: { {generateSummary.response} }

HTTP Request payload

json
{
  "topic": "{ {searchQuery} }",
  "data": "{ {str(searchResults.results)} }"
}

User approval branch

Decision: { {approval.decision} }
Decided by: { {approval.decidedBy} }

Tips

  • Give every important step a clear output variable name. That output name is what downstream steps reference.
  • When including JSON in text fields, wrap with { {str(...)} } to avoid syntax errors.
  • HTML entities are decoded automatically before step execution.
  • Trigger, input, and step output names share one context. Avoid reusing the same name for unrelated values.

Built with VitePress