Skip to main content
RapidDev - Software Development Agency
n8n-tutorial

How to Set Timeout for Workflows in n8n

Set workflow timeouts in n8n by opening Workflow Settings and entering a value in the Timeout Workflow After field in seconds. You can also set per-node timeouts in individual node settings. Timeouts prevent long-running workflows from consuming resources indefinitely, which is critical for production deployments handling API calls or large data processing.

What you'll learn

  • How to set a workflow-level timeout in Workflow Settings
  • How to configure per-node timeouts for individual nodes
  • How to set a global default timeout for all workflows
  • How to handle timeout errors gracefully in your workflows
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read5 minutesn8n 1.0+ (self-hosted, Docker, and n8n Cloud)March 2026RapidDev Engineering Team
TL;DR

Set workflow timeouts in n8n by opening Workflow Settings and entering a value in the Timeout Workflow After field in seconds. You can also set per-node timeouts in individual node settings. Timeouts prevent long-running workflows from consuming resources indefinitely, which is critical for production deployments handling API calls or large data processing.

Why Set Timeouts for n8n Workflows

Without a timeout, a workflow that calls an unresponsive API or processes a massive dataset can run forever, consuming server resources and blocking other executions. Timeouts act as a safety net by automatically stopping workflows that exceed a specified duration. This is especially important in production environments where multiple workflows run concurrently. n8n supports two levels of timeout: workflow-level (applies to the entire execution) and node-level (applies to a single node). Combining both gives you precise control over execution limits.

Prerequisites

  • A running n8n instance (self-hosted or n8n Cloud)
  • At least one workflow you want to protect with a timeout
  • For global timeout settings: access to server environment variables

Step-by-step guide

1

Open Workflow Settings

In the n8n editor, open the workflow you want to configure. Click the three-dot menu or the Settings gear icon for the workflow (not the global settings). This opens the Workflow Settings panel where you can configure execution behavior including timeouts, error handling, and save settings. The timeout setting is in the Timeout section of this panel.

Expected result: The Workflow Settings panel is open, showing configuration options including the Timeout Workflow After field.

2

Set the workflow timeout value

In the Workflow Settings panel, find the Timeout Workflow After field. Enter a value in seconds. For example, enter 300 for a 5-minute timeout or 3600 for a 1-hour timeout. When the workflow execution exceeds this duration, n8n automatically stops it and marks it as failed with a timeout error. Choose a timeout value that is longer than the workflow's normal execution time but short enough to catch genuine hangs.

typescript
1// Workflow timeout examples (values in seconds)
2// 60 = 1 minute (for quick API calls)
3// 300 = 5 minutes (for moderate data processing)
4// 900 = 15 minutes (for large data imports)
5// 3600 = 1 hour (for batch processing jobs)
6// 7200 = 2 hours (for heavy ETL workflows)

Expected result: The workflow has a timeout configured. If execution exceeds the specified duration, n8n stops it automatically.

3

Set per-node timeouts

Individual nodes can have their own timeouts, independent of the workflow-level timeout. This is useful when one node in your workflow makes a slow API call while the rest completes quickly. Open the node settings, look for the Timeout field (usually under the Options or Settings section), and enter a value in seconds. The node timeout stops only that node, not the entire workflow. The workflow continues if error handling is configured.

typescript
1// Per-node timeout configuration
2// Open any node → Settings tab → Timeout
3//
4// HTTP Request node:
5// Settings → Timeout: 30 (seconds)
6// This stops the HTTP request if the server does not respond within 30 seconds
7//
8// Code node:
9// Settings → Timeout: 60 (seconds)
10// This stops the code execution if it runs longer than 1 minute

Expected result: The individual node has its own timeout. If the node exceeds its timeout, it fails with a timeout error while the workflow can continue via error handling.

4

Set a global default timeout via environment variable

For self-hosted n8n instances, you can set a global default timeout that applies to all workflows. This acts as a safety net for workflows that do not have individual timeout settings. Set the EXECUTIONS_TIMEOUT environment variable to the maximum allowed execution time in seconds. You can also set EXECUTIONS_TIMEOUT_MAX to define the upper limit that individual workflow settings cannot exceed.

typescript
1# Set global timeout defaults (environment variables)
2
3# Default timeout for all workflows: 1 hour
4export EXECUTIONS_TIMEOUT=3600
5
6# Maximum allowed timeout (workflows cannot exceed this)
7export EXECUTIONS_TIMEOUT_MAX=7200
8
9# Enable the timeout feature globally
10export EXECUTIONS_TIMEOUT_ACTIVE=true
11
12# In docker-compose.yml:
13# environment:
14# - EXECUTIONS_TIMEOUT=3600
15# - EXECUTIONS_TIMEOUT_MAX=7200
16# - EXECUTIONS_TIMEOUT_ACTIVE=true

Expected result: All workflows have a default 1-hour timeout. Individual workflows can override this up to the 2-hour maximum.

5

Handle timeout errors gracefully

When a workflow times out, it is marked as failed in the execution history. To handle timeouts gracefully, create an Error Trigger workflow that sends notifications when timeouts occur. You can also use the built-in error handling on individual nodes by enabling Continue On Fail, which lets the workflow continue even if a node times out. Combine this with an IF node to check for errors and take alternate actions.

typescript
1// Error handling pattern for timeout-prone nodes
2// 1. Enable "Continue On Fail" on the node that might timeout
3// 2. Add an IF node after it to check for errors
4
5// IF node condition:
6// Value 1: {{ $json.error }}
7// Operation: is not empty
8//
9// True branch → Send error notification
10// False branch → Continue normal processing
11
12// In a Code node, check for timeout:
13const items = $input.all();
14const results = items.map(item => {
15 if (item.json.error) {
16 return {
17 json: {
18 status: 'timeout',
19 message: 'The operation timed out. Using cached data instead.',
20 fallbackData: 'default value'
21 }
22 };
23 }
24 return item;
25});
26return results;

Expected result: When a node times out, the workflow continues via the error handling path instead of failing completely.

Complete working example

docker-compose.yml
1# docker-compose.yml n8n with timeout configuration
2version: '3.8'
3
4services:
5 n8n:
6 image: docker.n8n.io/n8nio/n8n
7 restart: unless-stopped
8 ports:
9 - '5678:5678'
10 environment:
11 # Timeout configuration
12 - EXECUTIONS_TIMEOUT_ACTIVE=true
13 - EXECUTIONS_TIMEOUT=3600
14 - EXECUTIONS_TIMEOUT_MAX=7200
15 # General settings
16 - N8N_HOST=0.0.0.0
17 - N8N_PORT=5678
18 - WEBHOOK_URL=https://n8n.example.com/
19 - GENERIC_TIMEZONE=America/New_York
20 # Execution data retention
21 - EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
22 - EXECUTIONS_DATA_SAVE_ON_ERROR=all
23 - EXECUTIONS_DATA_PRUNE=true
24 - EXECUTIONS_DATA_MAX_AGE=168
25 # Logging
26 - N8N_LOG_LEVEL=info
27 volumes:
28 - n8n_data:/home/node/.n8n
29 healthcheck:
30 test: ['CMD', 'wget', '--spider', '-q', 'http://localhost:5678/healthz']
31 interval: 30s
32 timeout: 5s
33 retries: 3
34
35volumes:
36 n8n_data:
37 driver: local

Common mistakes when setting Timeout for Workflows in n8n

Why it's a problem: Setting the timeout too short, causing workflows to fail during normal operation

How to avoid: Check the average execution time in the execution history. Set the timeout to at least 2-3 times the average to account for variability.

Why it's a problem: Not enabling EXECUTIONS_TIMEOUT_ACTIVE when setting EXECUTIONS_TIMEOUT

How to avoid: The timeout feature must be explicitly enabled. Set EXECUTIONS_TIMEOUT_ACTIVE=true in addition to setting the timeout value.

Why it's a problem: Confusing seconds with milliseconds when entering timeout values

How to avoid: n8n timeout values are in seconds, not milliseconds. A value of 300 means 5 minutes, not 0.3 seconds.

Why it's a problem: Not handling timeout errors, leaving the workflow in a failed state with no notification

How to avoid: Set up an Error Trigger workflow to send notifications when workflows fail due to timeouts.

Best practices

  • Always set a global timeout with EXECUTIONS_TIMEOUT as a safety net for all workflows
  • Use per-node timeouts for nodes that make external API calls or process large datasets
  • Set workflow-level timeouts based on the expected execution time plus a generous buffer
  • Enable Continue On Fail for timeout-prone nodes so the workflow can handle errors gracefully
  • Monitor execution history to identify workflows that frequently approach their timeout limits
  • Set EXECUTIONS_TIMEOUT_MAX to prevent users from setting unreasonably long timeouts
  • Document the timeout value in workflow notes so team members understand the limit

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

My n8n workflow sometimes hangs indefinitely when calling an external API. How do I set a timeout at both the workflow level and the individual node level to prevent this?

n8n Prompt

Help me configure global timeout settings for my self-hosted n8n instance so that no workflow can run longer than 2 hours, with a default timeout of 30 minutes.

Frequently asked questions

What is the default timeout in n8n?

By default, n8n has no timeout — workflows can run indefinitely. You must explicitly enable timeouts by setting EXECUTIONS_TIMEOUT_ACTIVE=true and EXECUTIONS_TIMEOUT to a value in seconds.

Does the workflow timeout include waiting time for webhooks?

Yes. The workflow timeout starts when execution begins. If a Webhook node is waiting for a response, that waiting time counts toward the timeout.

Can I set different timeouts for different workflows?

Yes. Each workflow has its own Timeout Workflow After setting in Workflow Settings. This overrides the global default but cannot exceed EXECUTIONS_TIMEOUT_MAX.

What happens to the data when a workflow times out?

The execution is stopped and marked as failed in the execution history. Any data processed before the timeout is saved in the execution log. Data not yet written to external systems is lost.

Do node timeouts apply to built-in nodes like IF and Set?

Technically yes, but built-in nodes like IF and Set execute almost instantly. Node timeouts are most useful for HTTP Request, Code, and integration nodes that call external services.

Can RapidDev help me optimize slow n8n workflows?

Yes. RapidDev can analyze your n8n workflows, identify performance bottlenecks, and implement optimizations including proper timeout configuration and error handling. Contact RapidDev for a free consultation.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.