DEVELOPERS · EXAMPLES
Start from a working shape.
The fastest workflow is usually a variation of one you have seen. These patterns cover the handoffs that appear in almost every API journey.
PATTERNS
Six shapes that cover a lot of ground.
Each pattern maps to fields in a normal workflow file.
Token handoff
Capture a bearer token from login and inject it into protected routes.
Create, then read
Capture an id from a 201 response and use it in the next path.
Expected failure
Assert a 4xx and inspect the error code without aborting the run.
Role branch
Check a captured role and continue or abort based on the result.
Retry with delay
Bounded retries for a dependency that is eventually consistent.
CI baseline
Run the same workflow on every pull request and keep the trace.
ANATOMY
The fields behind the patterns.
Steps
Ordered calls with a method, path, and optional body.
Capture
Write a response field to workflow memory.
Inject
Read memory into a header, body, or query.
Expect
Declare the status that counts as success.
EXAMPLE MAP
Where each pattern is documented.
The docs go deeper on syntax and edge cases.
| Pattern | Use when | Reference |
|---|---|---|
| Token handoff | Protected routes need a session | Workflow guide · capture and inject |
| Create then read | A generated id is needed later | Workflow guide · memory |
| Expected failure | A 4xx is part of correct behavior | CLI reference · exit behavior |
| Role branch | The next step depends on a claim | Workflow guide · conditions |
| Retry | A dependency is eventually consistent | Workflow guide · retry |
| CI baseline | A journey must gate a merge | Artifacts · run folders |
START SMALL
Three endpoints are enough.
A useful example does not need to cover the whole product. Login, create, read is enough to demonstrate state, auth, and assertions.
- One producer of a token
- One step that changes state
- One step that verifies the change
- One trace that proves the sequence
NEXT
Take the pattern into the product.
Borrow the shape. Make it yours.
Start from a three-step pattern, then add the state and assertions your API needs.
Open the workflow guide