Sleep
Pauses the execution for a specific duration
How It Works
- The node evaluates the "Delay Before" setting and waits if configured
- If "Random" is enabled:
- The node validates that Random Max is greater than Random Min
- A random duration is calculated using:
min + random() * (max - min) - This random duration overrides the "Duration (sec)" setting
- If "Random" is disabled, the fixed "Duration (sec)" value is used
- The node pauses execution for the calculated duration
- The node evaluates the "Delay After" setting and waits if configured
- The original message passes through unchanged to the next node
Requirements
- Duration, Random Min, and Random Max can be specified as:
- Fixed numeric values (e.g., 5.5)
- Message fields (e.g.,
msg.waitTime) - Variables
- When using Random mode, Random Max must be greater than Random Min
- All duration values must be valid numbers (integers or floats)
Error Handling
| Error Code | Description | Cause |
|---|---|---|
Core.Programming.Sleep.ErrOnCreate | Config parse error | Invalid node configuration during creation |
Core.Programming.Sleep.ErrRandMinMax | Invalid random range | Random Max value is less than or equal to Random Min value |
| Variable retrieval errors | Failed to get duration | Duration/Min/Max variable not found or contains non-numeric data |
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Options
- Duration (sec) - Specifies the sleep duration in seconds.
- Random - A boolean that, when true, will sleep for a random duration between the provided "Random Min (sec)" and "Random Max (sec)".
- Random Min (sec) - The minimum boundary for the random sleep duration (only applicable if "Random" is set to true).
- Random Max (sec) - The maximum boundary for the random sleep duration (only applicable if "Random" is set to true).
Note: If "Random" is set to true, the node will override the "Duration (sec)" option and sleep for a random time within the provided range.
Usage Examples
Example 1: Fixed Delay Between Actions
Browser: Click Login Button
└─ Sleep (Duration: 2)
└─ Browser: Wait for Dashboard
Wait 2 seconds after clicking a button to allow the page to load.
Example 2: Random Human-Like Delays
For Each (products)
├─ Browser: Click Product
│ └─ Sleep (Random: true, Min: 1.5, Max: 3.5)
│ └─ Browser: Add to Cart
│ └─ [Return to For Each]
└─ Checkout
Add random delays between 1.5 and 3.5 seconds to simulate human browsing behavior and avoid detection.
Example 3: Dynamic Wait from Message Data
API: Get Rate Limit Info → msg.waitSeconds
└─ Sleep (Duration: msg.waitSeconds)
└─ API: Make Request
Wait for a duration specified in the API response before making the next request.
Usage Notes
- Sleep durations are specified in seconds (supports decimals, e.g., 0.5 for 500ms)
- The Sleep node does not modify the message - it passes through unchanged
- Random mode uses a uniform distribution between min and max values
- Delay Before and Delay After are added on top of the main sleep duration
- When Random is enabled, the Duration field is ignored entirely
- Sleep is blocking - the entire flow pauses during sleep (other flows continue)
Tips
- Use random delays when automating web scraping to appear more human-like
- Add sleep after browser actions (clicks, navigation) to allow pages to load
- For API automation, use sleep to respect rate limits and avoid throttling
- Keep sleep durations reasonable - long sleeps increase total execution time
- Use dynamic sleep durations from API responses for adaptive rate limiting
- Combine with retry logic: increase sleep duration on each retry attempt
- For parallel flows, use sleep to stagger operations and reduce resource contention
- Use fractional seconds (0.1, 0.5) for fine-grained timing control