Timeout icon

Timeout

Resume execution if not triggered again or cancelled within a given timeout

Overview

This node implements a configurable timeout mechanism within an n8n workflow. It waits for a specified duration before allowing the input data to proceed to the output, unless it is triggered again or cancelled beforehand. This behavior is useful in scenarios where you want to delay processing until no further triggers occur within a certain time window, effectively debouncing events or implementing wait periods.

Practical examples include:

  • Waiting for user input or external events to stabilize before continuing.
  • Implementing retry delays or cooldown periods between actions.
  • Pausing workflow execution for a defined interval without blocking other processes.

Properties

Name Meaning
Timeout The length of the waiting period after which the item proceeds to the output.
Unit The unit of time for the timeout value. Options: Seconds, Minutes, Hours, Days.
Scope An optional string to define a scope for event matching, allowing separation of timers.

Output

The node outputs the original input data unchanged after the timeout expires. If the timeout is cancelled or retriggered before completion, no output is produced at that moment. The output JSON structure matches the input items passed into the node.

No binary data is produced by this node.

Dependencies

  • No external services or APIs are required.
  • No special credentials or environment variables are needed.
  • The node relies on internal JavaScript timing functions (setTimeout and clearTimeout) to manage delays.

Troubleshooting

  • Timeout too long or zero: Setting an excessively long timeout (greater than ~24.8 days) results in no output because the underlying timer limit is exceeded. Keep timeout values reasonable.
  • Unexpected immediate output: If the node receives a cancel input while a timeout is active, it clears the timer and produces no output. Ensure the cancel input is used correctly.
  • Multiple triggers: When the node is triggered multiple times with the same scope, the previous timer is cleared and restarted. Use the "Scope" property to separate concurrent timers if needed.
  • Cancellation handling: If the workflow execution is cancelled externally, the node clears its timer to avoid hanging promises.

Links and References

Discussion