Upstash Documentation

Wait

1 min read

You can pause a workflow run with the waitForEvent step. An event is uniquely identified by event ID.

The workflow will resume when the matching event is published.

waitForEvent supports configurable timeouts to prevent workflows from waiting indefinitely. When a timeout occurs, the returned object includes timeout: true, allowing you to handle the failure case gracefully (for example, cancel an order, notify the user, or retry later).

Tip

If no timeout is specified, the default is 7 days.