API chaining means taking the output of one API call and using it as the input for the next. In n8n, every HTTP Request node output is automatically available to all downstream nodes via expressions like {{ $node["Get Customer"].json.id }}.
The key principle: each node in the chain should do exactly one thing. "Get customer data" is one node. "Create invoice using customer data" is the next node. "Send invoice PDF via email" is the third node. Never combine multiple API operations in a single HTTP Request node.
This granularity makes debugging easy — you can see exactly which API call failed and with what data, and you can retry individual nodes without re-running the entire chain.
Most production APIs require authentication. n8n stores credentials securely and makes them available to HTTP Request nodes. Set up your credentials first before building the workflow — this avoids interruption mid-build.
For Bearer Token APIs (most modern REST APIs): go to Credentials → New → Header Auth. Set the header name to Authorization and the value to Bearer YOUR_API_KEY.
For OAuth2 APIs (Google, Slack, HubSpot): use n8n's built-in OAuth2 credential type. n8n handles token refresh automatically.
For APIs that require a token from a login endpoint: add an HTTP Request node at the start of your workflow that logs in and retrieves the token. Use a Set node to extract the token, then reference it in subsequent requests: {{ $node["Get Auth Token"].json.access_token }}
After each HTTP Request node, n8n automatically provides its response JSON. Reference previous nodes' data using the expression panel.
In the HTTP Request node for step 2 of your chain, open the Body field and switch to "Expression" mode. Reference the first API's output: {{ $node["Step 1: Get Lead"].json.data.id }}
For nested data: {{ $node["Step 1"].json.customer.address.city }}
For arrays, use a SplitInBatches node or Item Lists node before your next HTTP Request to iterate over each item in the array. This lets you make one API call per array item automatically.
Common pattern for "get list, process each item":
HTTP Request → Get All Products (returns array)
Item Lists → Split into individual items
HTTP Request → Update each product price (runs once per item)
Merge → Collect all resultsProduction APIs enforce rate limits. To handle them in n8n, add a Wait node set to 1-2 seconds between your HTTP Request nodes when processing large batches. This prevents 429 "Too Many Requests" errors.
For paginated APIs, use a Loop pattern: a Code node checks if next_page_token exists in the response. If yes, the workflow loops back to make another request with the token. If no, it continues downstream.
// Code Node — Check Pagination
const response = $input.first().json;
if (response.next_page_token) {
return [{ continue: true, token: response.next_page_token }];
} else {
return [{ continue: false, token: null }];
}Often you need data from multiple APIs simultaneously before taking action. For example: customer data from CRM + order history from your database + credit score from a third-party API — all needed together to make a decision.
Run all three API calls in parallel (connect the trigger to all three simultaneously). Then use a Merge node in "Merge By Position" or "Merge By Key" mode to combine the results into a single item.
After merging, a single Set node packages everything into the final shape your action node needs. This pattern is significantly faster than running the API calls in sequence.
A B2B SaaS company captures leads from multiple sources (website form, LinkedIn ads, webinar signups). Each lead needs to be enriched, verified, and synced across HubSpot, Slack, and their MySQL database — automatically.