Introduction
The HTTP Request node in n8n is one of the most powerful and commonly used building blocks for automation. It lets you call external APIs, fetch web pages, upload files, and integrate services that don’t have a dedicated node. This tutorial explains how the HTTP Request node works, shows practical examples (GET, POST, authentication, binary uploads), and shares best practices for building reliable, secure n8n workflows.
Why you need the HTTP Request node
- Integrate with any REST or HTTP-based API.
- Fill gaps where no native n8n integration exists.
- Combine with other nodes to transform, store, or forward API responses.
- Method: GET, POST, PUT, PATCH, DELETE, etc.
- URL: The endpoint to call (can use expressions).
- Authentication: None, Basic Auth, OAuth2, API Key, or custom header.
- Query Parameters: key/value pairs appended to the URL.
- Headers: custom headers such as Authorization or Content-Type.
- Body: JSON, form-data, x-www-form-urlencoded, or binary.
- Response Format: JSON, Text, File (binary).
- Options: Timeout, Allow Unauthorized SSL, Follow Redirects, etc.
Keywords to remember: URL, method, headers, query parameters, body, authentication, response format, pagination.
Quick overview: HTTP Request node UI fields
When you add an HTTP Request node you’ll typically configure:
Step-by-step: Build a simple API call
1. Create a new workflow and add a trigger (Webhook or Schedule).
2. Add an “HTTP Request” node and connect it to the trigger.
3. Set Method to `GET` and URL to `https://api.example.com/users`.
4. Add a query parameter `limit=10` (or use the Query Parameters section).
5. Set Response Format to `JSON`.
6. Execute node (or test workflow) to view response data.
Example: GET call using expressions
text
Method: GET
URL: https://api.example.com/users?limit={{ $json.limit || 10 }}
Or using the Query Parameters UI:
POST requests and JSON bodies
To create resources, use POST with a JSON body. Choose Body Content Type = JSON and paste either static JSON or an expression.
Example POST body using data from previous node:
json
{
"name": "{{ $json.firstName }} {{ $json.lastName }}",
"email": "{{ $json.email }}"
}
Set header `Content-Type: application/json` (n8n may set it automatically for JSON type).
Authentication patterns
Tip: Create credentials in n8n (Credentials > New) and select them in the node for secure reuse.
Handling binary data (file upload and download)
Example (file upload):
1. Use an HTTP Request node to download a file or use a previous node that produced binary data.
2. In the HTTP Request node doing the upload, choose `form-data` and set Binary Property to the binary field name.
Pagination strategies
APIs paginate responses in multiple ways. n8n’s HTTP Request node supports different pagination flows but often you need to implement loops.
Use a combination of the HTTP Request node and a Function or If node to decide whether to continue fetching.
Error handling and retries
Example check:
js
// Example Function node snippet to detect retry-worthy errors
const status = $json["statusCode"];
if (status >= 500 || status === 429) {
return [{ json: { retry: true } }];
}
return [{ json: { retry: false } }];
Best practices
Common use cases
Sample workflow outline
1. Trigger: Webhook receives user data.
2. HTTP Request: Validate or enrich user via third-party API (GET).
3. If: Check if user exists.
4. HTTP Request: Create user (POST) if not found.
5. Set / Function: Transform response.
6. Database / Google Sheets: Store normalized results.
7. Slack: Notify success or failure.
Conclusion and next steps
The HTTP Request node turns n8n into a universal integration platform: any service with an HTTP API becomes accessible. Start by experimenting with simple GET and POST calls, then add authentication, error handling, and pagination. Use credentials and best practices to build secure, efficient workflows.
Next steps:
Happy automating! If you want, I can provide a starter workflow JSON export with a Webhook trigger and an HTTP Request node pre-configured for a sample API.