/n8n-tutorials

How to set timeout for workflows in n8n?

Learn how to set workflow timeouts in n8n to prevent long executions, improve automation control, and keep your processes running smoothly.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free consultation

How to set timeout for workflows in n8n?

n8n does not have a built‑in “workflow timeout” setting that you can configure per workflow. The platform itself doesn’t expose a native feature like “stop this workflow after 30 seconds/minutes.” Instead, you control timeouts using a combination of n8n settings, node-level options, infrastructure settings, and manual timeout logic inside the workflow.

 

How you actually set (or enforce) timeouts in real n8n workflows

 

You enforce workflow timeouts indirectly. The main reliable options are:

  • Node-level timeouts (for HTTP Request, Execute Command, etc.)
  • n8n instance-level timeout via environment variable N8N_EXECUTIONS_TIMEOUT
  • Manual timeout pattern using Wait + check logic
  • Reverse timeouts (set via external systems calling your webhook with their own timeout)

Below is how each actually works in production.

 

n8n server-level timeout (the only real "global timeout")

 

You can stop long-running executions by setting the environment variable N8N_EXECUTIONS_TIMEOUT. If n8n sees that a workflow has been running longer than this number of seconds, it will abort it.

  • This affects all workflows.
  • It only works if the workflow is still running inside n8n, not waiting externally (like a Wait node with webhook).
  • Useful when you want to prevent runaway loops.
# Example: stop any workflow after 30 minutes (1800 seconds)
export N8N_EXECUTIONS_TIMEOUT=1800

In Docker:

environment:
  - N8N_EXECUTIONS_TIMEOUT=1800

Once set, n8n will kill any execution that exceeds that runtime.

 

Node-level timeouts (most commonly used, very reliable)

 

Several nodes let you specify a timeout for the operation itself. This is usually the real solution because most long-running workflows get stuck waiting for an external API.

  • HTTP Request node: timeout (ms)
  • Execute Command node: timeout (s)
  • Webhook response timeout from the caller side

Example: in an HTTP Request node, under Options, set:

  • Timeout = 15000 (15 seconds)

This prevents the workflow from hanging waiting on slow APIs.

 

Manual “soft timeout” pattern inside the workflow

 

This is a common production pattern when you want a workflow-level timeout even though n8n doesn’t offer one natively.

Pattern:

  • Use a Set node to store the start time.
  • Loop with a Wait node (e.g., 30 seconds).
  • At every iteration, compare current time with start time using an If node.
  • If exceeded, exit gracefully, send alert, stop loop.

Example expression you’d use in the If node:

// Returns difference in seconds between now and start time
(new Date().getTime() - new Date($json.startTime).getTime()) / 1000

This is simple, reliable, and gives you workflow-specific timeout logic.

 

Timeout caused by infrastructure (common but not obvious)

 

Sometimes the “timeout” comes from outside n8n:

  • Your reverse proxy (NGINX/Traefik) may kill requests after X seconds
  • Your cloud provider kills idle containers
  • Your webhook caller (Stripe, Shopify, etc.) stops waiting after 5–10 seconds

These do not stop the workflow itself, they just break the input/output expectations. But developers often misinterpret these as n8n timeouts.

 

Putting it together (what we actually do in production)

 

In real deployments, a safe setup looks like:

  • Set N8N_EXECUTIONS_TIMEOUT to something reasonable (e.g., 30–45 min).
  • Set node-level timeouts for everything hitting external APIs.
  • Use the manual soft timeout pattern when a workflow loops or polls.
  • Ensure your reverse proxy timeout is aligned with workflow needs.

That’s how you effectively control workflow runtime without relying on nonexistent per-workflow timeout settings.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022