Delay
Description
The Delay node introduces a timed pause in the workflow execution. It holds the incoming data for a specified number of seconds before passing it through unchanged to the next node.
It is primarily used for rate limiting (e.g., waiting between API calls), simulating human-like pacing in automated sequences, or giving external processes time to complete before the workflow continues.
Configuration Properties
⏱️ Delay Section
NumericUpDown (default: 1)
The duration of the pause in seconds.
Example: A value of 2 will pause the workflow for 2 seconds. A value of 0.5 (if decimals are allowed) would be half a second, though typically integer seconds are used.
Usage Example
"Rate limiting external API calls":
- A Sequencer node outputs a list of 10 URLs to fetch.
- A Web node fetches the content of the URL.
- A Delay node set to
2seconds. - The loop restarts. The 2-second pause ensures you don't flood the target server with requests, reducing the risk of being blocked or hitting a rate limit.
⚠️ Pitfalls to Avoid
Blocking execution: The delay is synchronous (it uses Thread.Sleep). It blocks the current execution thread for the specified duration. Avoid using extremely large values (e.g., 3600 for an hour) as it will tie up workflow resources. For long waits, consider a different architectural approach.
Accumulated delays in loops: If you place a Delay node inside a loop that processes 100 items, and the delay is set to 1 second, the total execution time will be at least 100 seconds. Always account for this in your total workflow time estimation.
Not a precision timer: Thread.Sleep on Windows is not perfectly accurate for very short durations (typically no better than ~15ms resolution). It is perfectly fine for delays of 1 second or more, but do not rely on it for millisecond-precision timing.