Writing Workflows
A Replay workflow is a YAML file that describes a sequence of steps to execute. Each step performs an action, optionally extracts values into the shared state bag, and asserts outcomes.Anatomy of a Workflow
The State Bag
Every workflow has a shared state bag — a key-value store that lives across all steps. Values extracted in one step are available in all later steps via{{ variable_name }} syntax.
Step Types
Extract
Theextract block maps JSONPath expressions to variable names:
Assert
Theassert block validates outcomes. Each rule has a path, operator, and expected value:
Templates
Any string field in a step can reference state variables with{{ var }} syntax:
Ignoring Errors
Useignore_error: true to continue execution even when a step fails:
Cleanup
Thecleanup field deletes variables from the state bag after a step completes:
Variable Scope
Variables exist in a three-level scope hierarchy:- Global — Environment variables loaded at startup
- Workflow — Set via
config.varsorextractat the workflow level - Step — Set via
extractwithin a step, cleaned up when the step exits
What’s Next?
- Dive into HTTP requests — the most common step type
- Explore shell commands — no external dependencies needed