n8n HTTP Request node: a practical reference
Updated 2026-10-21 · 7 min read
The n8n HTTP Request node calls any REST API from a workflow. It is the node you reach for when n8n has no dedicated app node, when an app node lacks the operation you need, or when you are replacing axios and fetch calls from another platform. This page covers every setting that matters in practice, with configurations you can copy, and the fixes for the errors people hit most often.
If you are moving from Pipedream, the mapping from Send any HTTP Request and axios is 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. That is the most common surprise for people coming 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 to turn it 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 | Content type picked per body |
All values accept 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. Reuses a credential n8n already supports (Slack, GitHub, HubSpot and hundreds more). This is how you call an endpoint that 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 with name Authorization and value Bearer sk_live_..., or whatever the API documents. The key is stored encrypted as an n8n credential and 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, legacy forms |
| Form-Data | multipart/form-data |
File uploads with extra fields |
| n8n Binary File | The file as the whole body | Raw uploads (S3 presigned PUT, for example) |
| Raw | Any content type you set | XML, plain text, GraphQL as text |
With JSON > Using JSON, wrap the whole object in an expression when it contains dynamic values:
{{
{
"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 method, URL, headers and body. Two caveats from the docs:
- 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), 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 | Milliseconds to wait for the response headers |
Response handling
By default the node returns only the body and fails on any non-2xx status. 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, for example "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 lands in the binary field you name in Put Output in Field), or 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), not inside the pagination settings.
Next URL in the response
- Pagination Mode: Response Contains Next URL
- Next URL:
{{ $response.body["next-page"] }}
Adjust the path to whatever your API returns: $response.body.links.next, $response.body.paging.next.link, and so on.
Page in the body
For POST-based search APIs: Method POST, Pagination Mode Update a Parameter in Each Request, Type Body, Name page, Value {{ $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, but in our experience they (?cursor=abc) fit the first pattern with Value set to the cursor from the previous response, for example {{ $response.body.next_cursor }}. Check the API's docs for how the last page is signalled, and 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
1, Batch Interval1000sends one request per second. - Retry On Fail (node Settings tab): set Max Tries and Wait Between Tries (ms).
For flaky APIs, add an error output too: Settings > On Error > Continue (using error output) sends failed items to a second branch instead of stopping the run.
Common errors
| Error | Usual cause | Fix |
|---|---|---|
| Bad request - please check your parameters | Invalid query value or array format | Check Array Format in Query Parameters |
| The resource you are requesting could not be found | Wrong URL or deprecated endpoint | Compare with the API docs |
| ECONNREFUSED | localhost inside Docker 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 | 403, missing scope | Regenerate the key with the right scopes |
| 415 Unsupported media type | n8n Binary File sent where multipart was expected | Use Form-Data with a parameter of type n8n Binary File |
On n8n Cloud there is no localhost: expose a local service through a tunnel if you need to call it during development.
HTTP Request node or Code node?
The n8n Code node docs say the Code node can't make HTTP requests and point you to this node. In n8n 2.x the Code node sandbox also has no fetch. So the default answer is: request in the HTTP Request node, transform in the Code node.
That split also gets you credentials management, retries, batching and pagination for free. Code that only prepared a payload before calling an API 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, which is where migrations slow down.
Our converter turns HTTP actions into HTTP Request nodes and lists every code step that calls an API, so you know which steps to split. Check a single code step for free with the code step checker, or run your whole export through the free report. The report and 1 workflow are free. Full export: $3 per workflow, $19 minimum — coming soon. 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. Use Update a Parameter in Each Request with {{ $pageCount + 1 }} for page numbers, or 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, and 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) and turn on Retry On Fail in the node settings with a wait between tries.
Related
Sources
- 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