Learn about the new workflow syntax and how to migrate your existing workflows
We’ve updated our workflow syntax to make data flow more explicit and consistent. These changes improve readability and make workflows more maintainable. While this update requires modifications to existing workflows, it provides a more robust foundation for workflow development.
The most significant change is how we reference input and output data between workflow steps. The new syntax makes the data flow more explicit by using the steps
keyword.
inputs[x]
- Referenced input data from step xoutputs[x]
- Referenced output data from step x_x
- Shorthand for input data from step xsteps[x].input
- References input data from step xsteps[x].output
- References output data from step x_x
- Has been removedNotice the addition of the $
prefix in the new syntax. This indicates that the value should be treated as a Python expression. We’ll cover this in detail in the next section.
inputs[0]
becomes steps[0].input
outputs[0]
becomes steps[0].output
_0
becomes steps[0].input
$
prefix to indicate Python expressionsprompt
StepsAnother significant change is the removal of Jinja templates ({{ }}
) in log
steps and prompt
steps. Instead, we now use Python f-strings with the $
prefix for dynamic content.
For multiple lines, you can use a multiline f-string:
The $
prefix is only needed when the value contains a Python expression or f-string. Plain text content doesn’t require the prefix.
The $
prefix should be used in two scenarios: