Request chaining
Chaining runs other requests first. A typical case is a login request that captures a token, linked in front of every API call that needs it.
On one request
Section titled “On one request”Open the request’s Chain tab and choose requests to run first from the dropdown. Drag
cards to reorder them. Each card shows what the linked request captures, and {{variables}}
it sets are recognised in this request.
Each link has a condition:
| Condition | Runs the linked request… |
|---|---|
| Run always | before every send. |
| Only when a variable is empty | when, for example, {{token}} has no value yet. |
| Only when the last run is older than… | when its last run is more than N seconds, minutes, hours or days old. Useful for tokens that expire. |
| Only when a variable value matches… | when a variable equals, contains, starts or ends with, or compares greater or less than a value. |
You can disable a link without removing it. Disabled links are kept but skipped.
On a folder or collection
Section titled “On a folder or collection”Right-click a folder or the collection and choose Run Requests First…. Requests linked there run before every request inside it. The collection’s links run first, then the folder’s, then each request’s own links. A request already linked higher up runs only once.
From AI
Section titled “From AI”Ask @vegha /chain to set up a login prerequisite and its captures, or let Copilot use the
#veghaSetChain tool. See AI overview.