Skip to content
Vegha VS Code

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.

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:

ConditionRuns the linked request…
Run alwaysbefore every send.
Only when a variable is emptywhen, 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.

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.

Ask @vegha /chain to set up a login prerequisite and its captures, or let Copilot use the #veghaSetChain tool. See AI overview.