n8n Connection Timeout Settings

Step by Step Guide to change n8n Connection Timeout Settings

 

 


 

Who this is for: n8n developers and workflow engineers who need to call APIs that take longer than the default 30 seconds to respond. We cover this in detail in the n8n API Integration Errors Guide.


Quick Diagnosis

  1. Global: Set EXECUTE_TIMEOUT (env‑var or ~/.n8n/config).
  2. Per‑node: Add requestTimeout: 120000 (or any value in ms) in the HTTP Request node’s Additional Options.
  3. Restart n8n if you changed the env‑var.

Result: the call will wait up to 2 minutes before aborting.


1. Why n8n Times Out

If you encounter any n8n api version mismatch errors resolve them before continuing with the setup.

Layer Default (ms)
Global execution (EXECUTE_TIMEOUT) 30 000
HTTP Request node (requestTimeout) 30 000
Webhook node (webhookTimeout) 60 000

EEFA note: A high global timeout can hide runaway requests and increase memory pressure. Prefer per‑node overrides.


2. Changing the Timeout Globally (Self‑Hosted)

If you encounter any n8n legacy node deprecation errors resolve them before continuing with the setup.

2.1 Via Environment Variable

# Set before starting n8n
export EXECUTE_TIMEOUT=120000   # 2 min
n8n start

Effect: All nodes inherit the new limit unless they override it locally.

2.2 Via Config File

{
  "executionTimeout": 120000
}

Save as ~/.n8n/config and restart n8n.

When to use: Environments where every external call is known to be slow (e.g., bulk data imports).


3. Overriding the Timeout per Node

3.1 HTTP Request Node – “Additional Options”

  1. Open the node’s Settings panel.
  2. Scroll to Additional Options → Custom Request Options.
  3. Paste the JSON snippet:
{
  "requestTimeout": 120000
}

3.2 Minimal Workflow JSON (HTTP Request)

{
  "nodes": [
    {
      "name": "Slow API GET",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "https://slow-api.example.com/large-report",
        "method": "GET",
        "options": { "requestTimeout": 120000 }
      },
      "position": [250, 300]
    }
  ],
  "connections": {}
}

3.3 Other Nodes that Honor requestTimeout

Node Property Example
Webhook responseTimeout 180000 (3 min)
Google Sheets requestTimeout 60000
Salesforce requestTimeout 90000

EEFA warning – Some third‑party nodes lack UI exposure for requestTimeout. In those cases, use the node’s Custom Headers & Options dialog or file a feature request on the n8n GitHub repo.


4. Diagnosing a Timeout Error

  1. Error text – Look for “Error: timeout of Xms exceeded”.
  2. Execution log – The Execution Details panel shows the timeout value used.
  3. Raw latency – Run curl -w "%{time_total}" <url> or use Postman to measure response time.

Quick Checklist

  • requestTimeout present in node’s Additional Options.
  • Global EXECUTE_TIMEOUT ≥ per‑node value.
  • No upstream proxy/firewall terminating the connection early.
  • Docker containers have sufficient --ulimit for long‑running sockets.

5. Best Practices for Timeout Configuration

Practice Reason
Set per‑node timeout Isolates long calls; other nodes stay fast.
Pair with retry strategy Handles intermittent slowness without manual re‑run.
Log start/end timestamps Enables SLA monitoring and alerts.
Keep global timeout modest Prevents a single stuck request from blocking the queue.
Use exponential back‑off Reduces load on downstream APIs during spikes.

6. Monitoring & Alerting

Capture the HTTP request duration with a Set node:

{
  "parameters": {
    "values": [
      {
        "name": "durationMs",
        "value": "={{$node[\"Slow API GET\"].json[\"duration\"]}}"
      }
    ]
  },
  "name": "Capture Duration",
  "type": "n8n-nodes-base.set",
  "typeVersion": 1,
  "position": [500, 300]
}

Send an alert if durationMs exceeds a threshold (e.g., 90 000 ms) via Slack, PagerDuty, etc.


7. Real‑World Example: Pulling a 5‑Minute Report from an ERP System

Problem – ERP endpoint returns a CSV after ~4 minutes of processing.

Solution – Extend the HTTP request timeout to 5 minutes.

Node Configuration

{
  "name": "ERP Monthly Report",
  "type": "n8n-nodes-base.httpRequest",
  "parameters": {
    "url": "https://erp.example.com/reports/monthly",
    "method": "GET",
    "options": {
      "requestTimeout": 300000,
      "responseType": "stream"
    }
  },
  "position": [250, 150]
}

Result – Workflow completes, CSV is streamed to an S3 bucket without a timeout error.


8. Frequently Asked Questions

Question Answer
Can I set an infinite timeout? axios treats 0 as “no timeout”, but n8n blocks this for safety. Use a high value (e.g., 86400000 for 24 h) only when you fully control the endpoint.
Do webhook timeouts respect requestTimeout? No. Webhook nodes use a separate responseTimeout setting.
Does changing EXECUTE_TIMEOUT affect running workflows? Only workflows started after the change; existing executions keep the old limit.
Is there a UI toggle for global timeout in n8n Cloud? Not yet. Request a custom env‑var from Cloud support.

Conclusion

Extending n8n’s timeout is straightforward: use the global EXECUTE_TIMEOUT for blanket changes, but prefer per‑node requestTimeout overrides to keep the workflow resilient and resource‑friendly. Combine longer timeouts with retries, logging, and alerts to maintain production stability when integrating slow APIs. This approach ensures your workflows complete reliably without sacrificing overall system health.

Leave a Comment

Your email address will not be published. Required fields are marked *