n8n HTTP Request Node: Credentials, Pagination, Responses and Errors
By Abhishek Patoliya · 2026-08-12
The HTTP Request node is how n8n talks to any API that doesn't have a dedicated node, or to endpoints a dedicated node doesn't cover. Getting a single request working is easy. Making it reliable takes more: credentials instead of pasted keys, built-in pagination and batching, response handling that doesn't treat a 200 as proof of good data, and error settings that separate "retry" from "alert".
Before you start: read API automation 101 and OAuth for automation builders. Options below follow n8n's HTTP Request node documentation as of 9 November 2026.
The request
- Method and URL, built with expressions from earlier nodes (
https://api.example.com/customers/{{ $json.customerId }}).
- Query parameters, headers and body as toggles. Body content types: JSON, Form-Data, Form URLencoded, Raw, and n8n Binary File for sending a file (see binary data).
- Import cURL: paste a cURL command from the API's docs to fill the node. It overwrites the current configuration.
Like most nodes, it runs once per input item: 200 items in means 200 requests.
Authentication
n8n recommends a Predefined Credential Type when one exists for the service (for example the HubSpot credential). It manages the auth details for you, even inside a generic HTTP Request. Otherwise use a Generic Credential Type:
| Generic type | Use for |
| Header Auth | Custom API-key headers such as X-API-Key |
| Bearer Auth | Authorization: Bearer <token> (n8n notes it's header auth with that name and value) |
| Basic / Digest Auth | Username and password schemes |
| Query Auth | Keys sent as a URL parameter |
| OAuth1 / OAuth2 | Full OAuth flows; n8n stores and refreshes tokens |
| Custom Auth / Simplified Custom Auth | Combinations of headers, query and body values (Simplified from n8n 2.35.0) |
Never paste a key into the URL or a header field. A credential is encrypted, reusable across nodes and rotated in one place, and it isn't exported with the workflow JSON.
Pagination (built in)
Under Options → Pagination, choose a mode:
- Response Contains Next URL: set Next URL with an expression such as
{{ $response.body.next }}.
- Update a Parameter in Each Request: change a query/body parameter per page, for example
offset = {{ $pageCount * 100 }} or cursor = {{ $response.body.next_cursor }}.
The variables $response (with .body, .headers, .statusCode), $pageCount and $request are available, and you configure when pagination is complete (for example when the next cursor is empty). Always cap the number of pages while testing. Patterns and their pitfalls are covered in API pagination patterns.
Response handling
- Response Format: Autodetect (default), JSON, Text or File (for downloads).
- Include Response Headers and Status: by default you only get the body; turn this on when you need
Retry-After, rate-limit headers or the status code.
- Never Error: by default, any non-2xx response fails the node; with this on, the node succeeds and you branch on the status code yourself.
- Validate the body anyway. A 200 with an error message or missing fields is still bad data. Check required fields with an IF node before passing data on, especially into an LLM step.
Errors, retries and rate limits
| Failure | Handling |
| Timeouts, 5xx, 429 | Node Settings → Retry On Fail, with Wait Between Tries longer than the rate-limit window |
| 4xx (bad request, auth, not found) | Retrying won't help. Settings → On Error → Continue (using error output), then log and alert on the error output |
| Too many requests per second | Options → Batching: Items per Batch + Batch Interval (ms) |
| Slow APIs | Options → Timeout (ms): how long to wait for response headers |
To honour a Retry-After header exactly, turn on Include Response Headers and Status and Never Error. Then use an IF node on statusCode === 429 to route to a Wait node set from the header, which loops back to the request, with a counter so it can't retry forever. Details are in rate limiting in n8n and error handling.
Old tutorials say "Continue On Fail". Current n8n uses the On Error setting with Stop Workflow, Continue and Continue (using error output).
Other options worth knowing
- Proxy: per-node proxy, overriding the
HTTP_PROXY/HTTPS_PROXY environment variables.
- Redirects: followed by default, with a maximum.
- Ignore SSL Issues: only for internal test servers with self-signed certificates; never for production APIs.
- Lowercase Headers: on by default; turn off for the rare API that needs case-sensitive header names.
Reuse: one sub-workflow per API
If several workflows call the same API, wrap the request (credential, pagination, retries, validation) in a sub-workflow and call it with Execute Workflow. Fixes then happen once. See sub-workflows.
Key takeaways
- Prefer a predefined credential; otherwise a generic one. Never paste keys into fields.
- Use built-in Pagination and Batching before building loops.
- Non-2xx responses fail the node unless Never Error is on; a 200 still needs body validation.
- Retry transient errors (Retry On Fail); route permanent ones (On Error → error output).
Exercise: call a public paginated API (for example a GitHub repository's issues endpoint) with Pagination set to follow the next page, capped at 3 pages. Turn on Include Response Headers and Status and read the rate-limit headers in the output. Next lesson: rate limiting.
References (checked 9 November 2026)
Written by Abhishek Patoliya, Senior n8n Developer & Automation Architect, Surat, India. Verified n8n Creator.