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

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
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.
You enforce workflow timeouts indirectly. The main reliable options are:
Below is how each actually works in production.
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.
# 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.
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.
Example: in an HTTP Request node, under Options, set:
This prevents the workflow from hanging waiting on slow APIs.
This is a common production pattern when you want a workflow-level timeout even though n8n doesn’t offer one natively.
Pattern:
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.
Sometimes the “timeout” comes from outside n8n:
These do not stop the workflow itself, they just break the input/output expectations. But developers often misinterpret these as n8n timeouts.
In real deployments, a safe setup looks like:
That’s how you effectively control workflow runtime without relying on nonexistent per-workflow timeout settings.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.