Multi-Step Automations & Chain Depth
How steps chain together
Each step executes in order. The output of each step is automatically available to subsequent steps via dataPrev. There is no need to wire outputs and inputs manually — dataPrev always holds the output of the immediately preceding step.
Available data variables (in Python code steps)
- dataPrev — output of the immediately preceding step
- dataPrev2, dataPrev3 — outputs two and three steps back
- dataPrevApiCall — output of the most recent call_api_endpoint step
- dataPrevCodeCall — output of the most recent run_sandboxed_code step
- dataPrevMcpCall — output of the most recent use_mcp_tool step
Referencing data in non-code steps
In step parameters that are not Python code, reference previous step outputs using dollar-sign curly-brace template syntax. For example, you can reference the full previous output, a specific field from it, or a nested field. The AI knows exactly which syntax to use and applies it correctly when building steps.
Control flow
- if — two-way or multi-way conditional branch based on a Python expression
- switch — multi-way branch matching an expression against named cases
- loop — iterate over an array, executing sub-steps for each item
- merge — combine outputs from multiple branches into a single result
Document generation
Automations can generate formatted documents. generate_pdf and generate_word accept structured content arrays (headings, paragraphs, tables, lists) and return a file ID and download URL. combine merges multiple files of the same type. For Excel files, use the createExcel function inside a run_sandboxed_code step.