n8n HTTP Request node: a practical reference
Updated 2026-10-21 · 7 min read
- The node sends one request per input item: 50 items in means 50 requests out.
- Put API keys in a credential. A plain-text header travels with every export.
- Common pagination needs no code: count pages with $pageCount or follow a next URL.
The n8n HTTP Request node calls any REST API from a workflow. You need it in three cases. n8n has no app node for the service. The app node lacks the operation you need. Or you are replacing axios and fetch calls from another platform.
This page covers every setting that matters in practice. It has configurations you can copy and fixes for the most common errors. Moving from Pipedream? The mapping from Send any HTTP Request and axios is on a separate page. This one is the n8n reference.
What the node does
One HTTP Request node sends one request per input item. If the previous node outputs 50 items, the node sends 50 requests and outputs 50 results. This surprises most people who come from code. You don't write a loop. The item list is the loop.
The response body becomes the output item's json. When an API returns a top-level JSON array, you usually get one item per element. When the list is nested, for example under data, add a Split Out node. It turns the list into separate items.
Node parameters
| Parameter | Options | Notes |
|---|---|---|
| Method | DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT | |
| URL | Any URL, expressions allowed | https://api.example.com/users/{{ $json.id }} |
| Authentication | None, Predefined Credential Type, Generic Credential Type | n8n recommends predefined when it exists |
| Send Query Parameters | Using Fields Below, Using JSON | |
| Send Headers | Using Fields Below, Using JSON | |
| Send Body | Form URLencoded, Form-Data, JSON, n8n Binary File, Raw | The content type follows the body type |
Every value accepts expressions. So {{ $json.email }} or {{ $('Webhook').first().json.body.orderId }} work in the URL, headers and body.
Authentication
The docs list two families:
- Predefined Credential Type. It reuses a credential n8n already supports, such as Slack, GitHub, HubSpot and hundreds more. Use it to call an endpoint the app node doesn't cover: same credential, custom request.
- Generic Credential Type. Basic auth, Custom auth, Digest auth, Header auth, OAuth1 API, OAuth2 API, Query auth and Simplified Custom Auth.
For a typical API key, choose Header Auth. Set the name to Authorization and the value to Bearer sk_live_..., or whatever the API documents.
The key is then stored encrypted as an n8n credential. It doesn't show up in the workflow JSON when you export or share it. A header typed into Send Headers in plain text does.
Body types
| Body Content Type | Sends | Use for |
|---|---|---|
| JSON | application/json |
Most REST APIs |
| Form URLencoded | application/x-www-form-urlencoded |
OAuth token endpoints, old-style forms |
| Form-Data | multipart/form-data |
File uploads with extra fields |
| n8n Binary File | The file as the whole body | Raw uploads (an S3 presigned PUT, for example) |
| Raw | Any content type you set | XML, plain text, GraphQL as text |
Use JSON > Using JSON with dynamic values? Then wrap the whole object in one expression:
{{
{
"email": $json.email,
"tags": ["migrated", "pipedream"],
"amount": $json.amount
}
}}
The common issues page recommends exactly this pattern for the "JSON parameter need to be an valid JSON" error.
Import cURL
Most API docs ship cURL examples. In the node's Parameters tab select Import cURL, paste the command and select Import. n8n fills in the method, URL, headers and body. The docs name two catches:
- It overwrites the existing node configuration.
- Parameter values are imported as strings. If the API needs numbers or booleans, switch the body to Using JSON and paste the object.
After the import, move any Authorization header into a credential. Otherwise the key stays in the node and travels with every export.
Node options
Select Add Option to reach these.
| Option | What it does |
|---|---|
| Array Format in Query Parameters | foo=bar&foo=qux, foo[]=bar or foo[0]=bar |
| Batching | Items per Batch and Batch Interval (ms) |
| Ignore SSL Issues | Downloads the response even if certificate validation fails |
| Lowercase Headers | On by default |
| Redirects | Follow redirects (on by default) and Max Redirects |
| Response | Include Response Headers and Status, Never Error, Response Format |
| Pagination | Off, Update a Parameter in Each Request, Response Contains Next URL |
| Proxy | Overrides HTTP_PROXY / HTTPS_PROXY / ALL_PROXY |
| Timeout | How many milliseconds to wait for the response headers |
Response handling
By default the node returns only the body. It fails on any status outside 2xx. Two switches change that:
- Include Response Headers and Status returns
headers,statusCodeandbody. - Never Error returns success for every status code.
Turn both on when the workflow must branch on the status itself. An example is "create if 404, update if 200". Put an If node after it that checks {{ $json.statusCode }}.
Response Format is Autodetect by default. Choose File for PDFs and images. The file then lands in the binary field you name in Put Output in Field. Choose Text to keep the raw string.
Pagination
Pagination is the reason many people keep a code step around. n8n handles the common cases without code. The pagination cookbook gives three patterns.
Page number in the query
- Pagination Mode: Update a Parameter in Each Request
- Type: Query, Name:
page - Value (expression):
{{ $pageCount + 1 }}
$pageCount starts at 0, so the first request asks for page 1. Set the page size in the main Send Query Parameters section, for example limit=100. Don't set it inside the pagination settings.
Next URL in the response
- Pagination Mode: Response Contains Next URL
- Next URL:
{{ $response.body["next-page"] }}
Change the path to whatever your API returns: $response.body.links.next, $response.body.paging.next.link, and so on.
Page in the body
This is for search APIs that use POST. Set Method to POST and Pagination Mode to Update a Parameter in Each Request. Then set Type to Body, Name to page and Value to {{ $pageCount + 1 }}.
| Variable | Meaning |
|---|---|
$pageCount |
Pages fetched so far. Starts at 0 |
$request |
The request the node sent |
$response |
The response: $response.body, $response.headers, $response.statusCode |
The cookbook doesn't cover cursor APIs (?cursor=abc). In our experience they fit the first pattern. Set Value to the cursor from the previous response, for example {{ $response.body.next_cursor }}.
Check the API's docs for how it marks the last page. Test with a small page size first, so you can see the stop condition work.
Rate limits and retries
A 429 from the API means you are sending too fast. Two settings fix most cases (common issues):
- Batching: Items per Batch
1and Batch Interval1000send one request per second. - Retry On Fail (node Settings tab): set Max Tries and Wait Between Tries (ms).
For unreliable APIs, add an error output too. Go to Settings > On Error > Continue (using error output). Failed items then go to a second branch instead of stopping the run.
Common errors
| Error | Usual cause | Fix |
|---|---|---|
| Bad request - please check your parameters | A wrong query value or array format | Check Array Format in Query Parameters |
| The resource you are requesting could not be found | Wrong URL or an outdated (deprecated) endpoint | Compare with the API docs |
| ECONNREFUSED | Inside Docker, localhost points at the n8n container |
Use host.docker.internal or the Compose service name |
| JSON parameter need to be an valid JSON | Broken JSON or expression | Wrap the whole object in {{ }} |
| Forbidden - perhaps check your credentials | A 403: the key lacks a scope | Create a new key with the right scopes |
| 415 Unsupported media type | n8n Binary File was sent where the API expected multipart | Use Form-Data with a parameter of type n8n Binary File |
n8n Cloud has no localhost. To call a local service during development, expose it through a tunnel.
HTTP Request node or Code node?
The n8n Code node docs say the Code node can't make HTTP requests. They point you to this node. In n8n 2.x the Code node sandbox also has no fetch.
So the default answer is simple. Send the request in the HTTP Request node. Transform the data in the Code node.
That split also gives you credential management, retries, batching and pagination for free. Some code only prepared a payload before calling an API. It becomes an expression or a small Code node in front of the HTTP Request node.
Moving HTTP calls from Pipedream
Pipedream workflows call APIs in two ways: the Send any HTTP Request action and axios inside code steps (Pipedream HTTP docs). The action maps cleanly to this node. The axios calls are buried in code, and that is where migrations slow down.
Our converter turns HTTP actions into HTTP Request nodes. It also lists every code step that calls an API, so you know which steps to split. Check one code step for free with the Code node compatibility check. Or run your whole export through the free report. The report and 1 workflow are free. Full export: $3 per workflow, $1 each after 50, $19 minimum, one-off. The full walkthrough is in migrate Pipedream to n8n.
Not affiliated with Pipedream or n8n.
FAQ
How do I add an API key to the n8n HTTP Request node?
Use Authentication > Predefined Credential Type if n8n has a credential for the service. Otherwise pick Generic Credential Type and Header Auth (for example Authorization: Bearer …) or Query Auth. Don't paste keys into headers as plain text.
How does pagination work in the n8n HTTP Request node?
Add the Pagination option. For page numbers, use Update a Parameter in Each Request with {{ $pageCount + 1 }}. For a next link, use Response Contains Next URL with an expression such as {{ $response.body.next }}.
Why does the HTTP Request node fail on a 404 or 500?
By default the node succeeds only on 2xx responses. Turn on Response > Never Error to get the response as data. Turn on Include Response Headers and Status to read the status code.
Can I paste a cURL command into n8n?
Yes. In the node's Parameters tab select Import cURL, paste the command and select Import. It overwrites the current configuration and imports values as strings.
How do I avoid 429 rate-limit errors?
Use the Batching option (Items per Batch and Batch Interval in ms). Also turn on Retry On Fail in the node settings, with a wait between tries.
Sources (5)
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/common-issues
- https://docs.n8n.io/build/code-in-n8n/cookbook/http-request-node/pagination
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code
- https://pipedream.com/docs/workflows/building-workflows/http