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.

PatternsJSONAuthCI
checkout.json · excerpt
{
"name": "checkout",
"steps": [
{ "method": "POST", "path": "/api/auth/login",
"capture": { "workflow:token": "data.accessToken" } },
{ "method": "POST", "path": "/api/orders",
"inject": { "header:Authorization": "{{workflow:token}}" } }
]
}
Captures feed injects; steps stay ordered

PATTERNS

Six shapes that cover a lot of ground.

Each pattern maps to fields in a normal workflow file.

01Auth

Token handoff

Capture a bearer token from login and inject it into protected routes.

02State

Create, then read

Capture an id from a 201 response and use it in the next path.

03Negative

Expected failure

Assert a 4xx and inspect the error code without aborting the run.

04Condition

Role branch

Check a captured role and continue or abort based on the result.

05Retry

Retry with delay

Bounded retries for a dependency that is eventually consistent.

06CI

CI baseline

Run the same workflow on every pull request and keep the trace.

ANATOMY

The fields behind the patterns.

01

Steps

Ordered calls with a method, path, and optional body.

steps[]
02

Capture

Write a response field to workflow memory.

capture
03

Inject

Read memory into a header, body, or query.

inject
04

Expect

Declare the status that counts as success.

expectStatus

EXAMPLE MAP

Where each pattern is documented.

The docs go deeper on syntax and edge cases.

PatternUse whenReference
Token handoffProtected routes need a sessionWorkflow guide · capture and inject
Create then readA generated id is needed laterWorkflow guide · memory
Expected failureA 4xx is part of correct behaviorCLI reference · exit behavior
Role branchThe next step depends on a claimWorkflow guide · conditions
RetryA dependency is eventually consistentWorkflow guide · retry
CI baselineA journey must gate a mergeArtifacts · 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
first-flow
1. POST /api/auth/login
capture accessToken
2. POST /api/orders
inject Authorization
capture orderId
3. GET /api/orders/:orderId
✔ 3 passed · trace saved

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