Skip to main content

context.waitForEvent pauses workflow execution until a given event occurs or a timeout is reached.

Default timeout value is 7 days.

Arguments#

stepIdstringrequired#

A unique identifier for the step.

eventIdstringrequired#

A unique identifier for the event to wait on.

optionsobject#

Response#

eventDataTEventData#

The data passed in when the event is triggered via notify(). Its type can be set with the generic parameter, e.g. context.waitForEvent<{ approved: boolean }>(...). Defaults to unknown.

timeoutboolean#

true if execution resumed because the timeout elapsed, false if resumed due to the event being received.

Usage#