n8n API Workflows: Connect Any API Without Writing Code
n8n is fundamentally an API orchestration tool. Almost every workflow involves calling APIs — sending data, receiving data, and transforming it as it moves between services. This guide covers advanced API workflow patterns in n8n, including authentication, pagination, rate limiting, error handling, and building complex multi-API pipelines.
HTTP Request Node Deep Dive
The HTTP Request node is n8n's universal API connector. Everything you can do via REST API, you can do with this node.
Core configuration:
- Method: GET, POST, PUT, PATCH, DELETE, HEAD
- URL: Target endpoint (can use expressions:
https://api.example.com/{{$json.id}}) - Authentication: None, Basic Auth, Header Auth, OAuth2, etc.
- Body: Form data, JSON, raw text, form-urlencoded, or binary
- Response: JSON, string, file
Dynamic URLs:
Use expressions to build URLs from previous node data.
Authentication Patterns
Bearer token (most common): Header Auth credential:
- Name:
Authorization - Value:
Bearer {{ $env.MY_API_TOKEN }}
API key in header:
- Name:
X-API-Key - Value:
{{ $env.SERVICE_API_KEY }}
API key in query param: Add as query string parameter in the node:
- Name:
api_key - Value:
{{ $env.API_KEY }}
OAuth2: n8n handles OAuth2 flows for supported services (Google, Slack, HubSpot, etc.) via the credential system. For custom OAuth2, use the generic OAuth2 credential type.
Rotating credentials: For APIs with short-lived tokens, use a Code node to fetch a new token before each API call:
Pagination Handling
Most APIs return results in pages. Handle pagination automatically:
Offset-based pagination:
Cursor-based pagination:
Rate Limiting
APIs enforce rate limits. Handle them without breaking workflows:
Proactive rate limiting (add delays): Use Wait nodes between HTTP Request nodes when calling the same API repeatedly:
- Add Wait node → 1000ms between calls
- This prevents 429 errors on APIs with per-second limits
Reactive rate limiting (retry on 429):
Then add IF node → if shouldRetry → Wait node (60s) → re-run HTTP request.
Webhook Workflows
n8n as a webhook receiver (not just sender):
Webhook trigger node: Generates a URL like https://your-n8n.com/webhook/abc123. Any service that can POST to a URL can trigger your workflow.
Common webhook sources:
- GitHub (PR created, issue opened)
- Stripe (payment received, subscription cancelled)
- HubSpot (deal stage changed)
- Calendly (booking made)
- Shopify (order created)
- Custom applications
Securing webhooks: For production webhooks, validate the signature:
Multi-API Orchestration
Complex workflows combine multiple APIs:
CRM + Email + AI pipeline:
- HubSpot API: get new leads from today
- Clearbit API: enrich each lead
- Claude API: generate personalised email
- Gmail API: create draft email
- Slack API: notify sales rep
Each step calls a different API; n8n passes data between them.
Data sync workflow:
- Source API (e.g., Shopify): fetch new orders
- Transform (Code node): map Shopify fields to HubSpot fields
- HubSpot API: create/update contacts and deals
- Database: log sync results
- Slack: daily sync summary
Error Handling and Retry
Production API workflows need error handling:
Error branch: Right-click any node → Add Error Output. Connect to error handling nodes.
Exponential backoff:
Recommended Tools
- n8n — API orchestration backbone
- Claude API — AI step in multi-API workflows
- HubSpot — CRM API for sales workflows
- Apollo.io — Lead data API
- Airtable — Database for workflow state and results
Related articles
n8n vs Make.com vs Zapier: a 2026 honest comparison
No affiliate fluff — where each tool wins, where it breaks, and what we actually run.
Self-hosting n8n: a production-grade setup guide
Queue mode, workers, backups, and the security defaults you should never skip.
Complete n8n Guide: Everything You Need to Build Powerful Automations
The definitive n8n guide — nodes, credentials, triggers, and production-grade patterns.