prompt: field on a step defines the text sent to the step’s agent.
Every
prompt: step requires an agent: field referencing a declared agent. The examples below omit agents: declarations and agent: fields for brevity — see Nodes for complete examples.Basic Prompt
Multi-line Prompts
Multi-line prompts in TOON are written as quoted strings with\n escape sequences for newlines:
\n sequences are converted to newlines when the prompt is sent to the agent.
Interpolation
Use{expression} to inject values into prompts:
Workflow Input
Upstream Step Outputs
Nested Fields
Array Values
Arrays are interpolated as comma-separated values by default:Escaping Braces
Use double braces to output a literal brace:{{ becomes { and }} becomes } in the final prompt text.
Expressions
Interpolation braces{...} evaluate full JavaScript expressions — ternaries, method calls, and string concatenation all work:
Ternaries
Use ternary expressions for conditional content:Method Calls
Call methods on interpolated values:Referencing Loop State
Inside a loop, reference the current iteration’s data:Component Parameters in Prompts
Inside a component, use{params.fieldName}:
Prompt Best Practices
Keep prompts focused. Each step should have a single clear instruction. Split complex tasks across multiple steps. Keep expressions readable. Ternaries and method calls work inside{}, but if an expression gets complex, use an inline run: block to prepare the data and reference its output in a downstream prompt.
Leverage multi-line. Use quoted strings with \n to write clear, well-structured multi-line prompts.
Reference specific fields. Instead of passing an entire object, reference the specific fields the model needs:
Next Steps
- Inline Code — Use TypeScript when prompts aren’t enough.
- Schemas — Define the output shapes that prompts produce.
- Nodes — All node kinds for controlling prompt execution flow.