Documentation Index
Fetch the complete documentation index at: https://docs.ellomas.com/llms.txt
Use this file to discover all available pages before exploring further.
Workflow Chaining
Replay lets you compose workflows across files. You can inject steps at parse time withinclude, or call a separate workflow file at runtime with call. This enables reusable workflow fragments and pipeline patterns.
Include — Compile-Time Injection
Theinclude directive loads steps from another file and injects them into the current workflow before execution. Included steps run as if they were written inline in the original file.
Passing Parameters to Includes
Parameters in thewith block are substituted using {{ var }} syntax in the included file:
include directive applies these substitutions at parse time, before any execution starts.
Call — Runtime Composition
Thecall step loads and executes steps from another workflow file at runtime, mid-execution. Unlike include, the called file is loaded when the step runs, and it can return values back to the caller.
Basic Call
Passing Parameters
{{ email }} and {{ role }} inside the called file’s steps.
Calling a Specific Step
Usetarget to execute only one named step from the called file:
Isolating State with Returns
By default, called workflows share the caller’s state bag — variables set inside the call are visible after the call returns. Usereturns to control which variables leak back:
returns is specified, Replay:
- Snapshots the caller’s state before the call
- Executes the called steps
- Saves only the listed variables from the called state
- Restores the caller’s state to the snapshot
- Copies the saved variables back into the caller’s state
Example: Reusable Auth Workflow
token leaks back — expires_in stays contained inside the call.
Safeguards — Cycle Detection and Depth Limits
Workflow chaining is powerful, but recursive calls can cause infinite loops. Replay provides two safeguards.Cycle Detection
The engine tracks everyfile:step pair during execution using an internal call stack. If the same pair is encountered twice in a single chain, execution stops immediately.
replay validate catches direct self-calls statically:
if/then/else and loop blocks. Cross-file cycles (e.g., a.yaml → b.yaml → a.yaml) are detected at runtime by the engine.
Call Depth Limit
Even without cycles, deeply nested calls can exhaust resources. Use--max-call-depth to cap the call chain:
Include vs Call
| Include | Call | |
|---|---|---|
| When | Parse time (before execution) | Runtime (mid-execution) |
| State | Shares full state | Supports returns isolation |
| Parameters | {{ var }} substitution | with block + {{ var }} |
| Targeting | Cannot target — all steps are injected | Can target a specific step |
| Best for | Setup/teardown that always runs | Conditional or reusable sub-flows |
Pipeline Patterns
Setup → Test → Teardown
Auth → Action → Verify
Conditional Chaining
Combineif with call to branch between different workflows:
What’s Next?
- Run workflows in parallel with parallel execution
- Validate outcomes with assertions