Skip to main content

Sleep

Pauses the execution for a specific duration

How It Works

  1. The node evaluates the "Delay Before" setting and waits if configured
  2. 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
  3. If "Random" is disabled, the fixed "Duration (sec)" value is used
  4. The node pauses execution for the calculated duration
  5. The node evaluates the "Delay After" setting and waits if configured
  6. 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 CodeDescriptionCause
Core.Programming.Sleep.ErrOnCreateConfig parse errorInvalid node configuration during creation
Core.Programming.Sleep.ErrRandMinMaxInvalid random rangeRandom Max value is less than or equal to Random Min value
Variable retrieval errorsFailed to get durationDuration/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
  • For Each - Add delays between loop iterations
  • Function - Calculate dynamic sleep durations
  • Debug - Log sleep duration for troubleshooting