Sleep Action

The Sleep Action node pauses the execution of a stream for a defined amount of time.

During this period, the workflow does not continue processing the next node. The delay is specified in milliseconds and is executed on the host running the stream (client or server).

Input Parameters

Milliseconds Amount of time the stream should wait before continuing execution. (Example: 1000 = 1 second)

Sleep Action

Behavior

  • Temporarily stops the workflow

  • After the delay, the stream continues normally

  • Supports asynchronous execution

Why This Node Is Needed

Some external systems or background processes do not respond immediately. A node may successfully send a request (for example via an API or script) but the remote system may still be processing the task.

If the next node depends on the result of that operation, the workflow may continue too early and fail because the external system has not finished yet.

The Sleep Action introduces a controlled waiting period to allow the external process to complete.

Typical Use Cases

  • waiting for third-party APIs to finish processing

  • allowing file systems or network shares to update

  • waiting for files to appear after transfer

  • spacing multiple API calls

  • stabilizing workflows that depend on background processes

Example Scenario

A stream sends a request to an external system via a JavaScript/API node. The system accepts the request but processes it asynchronously and does not return a final result immediately.

A following node tries to read data or send a second request. Without waiting, the first operation may still be running and the next step fails.

Placing a Sleep Action between the two nodes gives the external system time to finish before the workflow continues.

Practical Tip

Use short delays first and increase only if necessary. Very long sleep times are usually a sign that the workflow should instead poll for a condition (e.g., checking if a file exists) rather than waiting blindly.

Last updated