All videos

Actions · 2:38

Workflows that wait

Hold a workflow for a set time, a matching event or a person's approval, and what a test does with each.

Transcript

0:01Welcome

A workflow can pause partway and continue later. This video shows the three ways it waits, and when to use each.

0:08Holding the event

When a job finishes, its event starts the next job. A waiting job prepares its event, then holds it, so nothing after it runs yet. Three actions work this way. A set time, a matching event, or a person ends the wait.

0:26Human approval

Maya asks for a refund on order 4821, and a model drafts the reply. Refunds up to 100 euros are approved automatically. Hers is 180 euros, so Human approval holds the reply for Sam. While a job waits, the canvas and Logs show what it waits for. Here, Waiting for approval.

0:47Approvals

Sam opens Approvals. The instructions show Maya's order and amount. Under Output Event Properties, he reads the proposed reply and edits it. Approve publishes the event with his edits, and the next job sends the email. Reject ends the job, and nothing is sent. Sam can also decide the same request from the waiting job in Logs.

1:10Delay and Wait for event

After the reply goes out, Delay holds its event for two days, or until a set weekday and time. Then the workflow asks Maya if her refund arrived, and Wait for event holds the run until she answers. It listens for a matching event, here an email from Maya. Email from other customers does not count. Every wait has a deadline of up to 30 days. This one gives Maya one day. When the deadline passes, the job fails, or continues with an expired result. Here, a later job then tells Sam she has not replied.

1:46In a test run

A test from Run workflow approves every Human approval job automatically, so nobody is asked. In a test, Publish Events is off by default, so Delay and Wait for event skip the wait and continue at once. A passing test checks the later jobs, but no person approved anything.

2:09When to use each

Use Delay when the next step depends on time. Use Wait for event when it depends on a reply or another event, and set a deadline. Use Human approval right before a step that needs a person's yes. It cannot undo a step that already ran. You can now tell why a run is waiting. The docs pages Delay, Wait for event, Human approval and Approvals cover every setting.