Guide
Chain API requests and pass response values forward
Real API tests are rarely one request. You log in, capture what the login returned, and prove the next call works with it. In APIWeave that is one graph: requests wired in order, with the values between them handled by extractors and variables rather than copy-paste.
Mechanisms
Four ways to move a value between nodes
Pick by how far the value has to travel and how many branches need it.
| You need to… | Use | Because |
|---|---|---|
| A token or session ID that every later call needs | Extractor → workflow variable | It is captured once at the login node and reused by every downstream request, so the value is not re-derived per call. |
| A single next step that needs the whole previous response | The prev namespace | {{prev.response.body.field}} reads the immediately upstream node with no extractor to maintain. |
| A value one branch of a fan-out needs | Extractor or prev[index] after the merge | After a Merge, an unindexed prev reference is ambiguous. The index names the branch explicitly. |
| A request the API rejects without a token the client cannot send | Call Workflow with input and output mappings | The sub-workflow resolves its own secrets and environment; only workflow variables need mapping. |
Extractors: capture once, use anywhere downstream
An extractor is a name and a pathattached to an HTTP Request node. After the node runs, the captured value is a workflow variable available to every later node in the same run. Add one straight from a response you already have: open the node's response tree, hover the row, and choose Save as variable. The row then keeps a chip showing which variable it feeds.
Paths always start with response. and use dot notation with zero-based array indices:
- response.statusCode
- response.headers.content-type
- response.headers.set-cookie
- response.body.id
- response.body.user.id
- response.body.items[0].id
- response.body.data[2].tokens[0]
What an unresolved reference does
If a placeholder cannot be resolved — a misspelled namespace, a key no environment defines, an extractor that never matched — the runner leaves the literal {{...}}text in the field instead of stopping the run. The run records the unresolved reference per node, so the exact missing key is visible in the results. In an assertion's expected value, that surfaces as a template problem rather than a value mismatch.
The most common cause is the namespace typo: {{variable.token}} (singular) does not match the variables.* namespace. The second most common is a path that does not match the real response shape — check the actual body for the field name, including its case.
Reuse
Reuse the login instead of chaining past it
When several workflows all start with the same authentication, make it a step rather than a prefix.
[ Start ] -> [ Call Workflow: Authenticate ] -> [ POST /cart ] -> [ End ]
Call Workflow node:
input mapping: tenant = {{variables.tenantId}}
output mapping: authToken = accessToken
The caller then uses {{variables.authToken}} in its own request headers.- The sub-workflow runs inline, inside the caller's run. There is no second entry in run history; the calling node's result carries the summary.
- It shares the run's environment and secrets, so {{env.*}} and {{secrets.*}} resolve in the sub-workflow without mapping.
- Only workflow variables need mapping in or out, because each execution keeps its own variable map.
- A {{secrets.NAME}} on the right-hand side of an input mapping fails the node by design. Let the sub-workflow read the secret itself.
New to the canvas? Start with the five-step walkthrough, then come back to chaining.