| Node | Purpose |
|---|---|
sleep(duration) | Pause for a fixed duration before continuing |
wait_for_input(name, timeout, expected_type) | Pause until an external signal provides a typed value |
approve(upstream_item, name, timeout) | Pause until an explicit approval signal is received |
These functions can only be used inside
@workflow-decorated functions, @dynamic-decorated functions, or imperative workflows.Use cases
Model deployment review
Train
n models, generate a comparison report, then wait for a human to approve before deploying to production.Data labeling
Iterate through an image dataset and pause for a human annotator to label each image before continuing.
Active learning
Train a model, identify uncertain examples, wait for a human to label them, then retrain with the new labels.
Pausing with sleep
The simplest gate node sleeps for a specified duration before the next node runs:
>> operator enforces ordering without data flow: result will not start until after the 10-second sleep completes.
See Chaining Flyte entities to learn more about the
>> chaining operator.Waiting for a typed input with wait_for_input
wait_for_input pauses execution until an external caller (human or machine) provides a value of the specified type through the Flyte API or UI:
create_reportruns and produces the raw report.- The workflow pauses at
title-input. It will wait up to 1 hour. - When a string is supplied through the Flyte UI or API,
finalize_reportruns with the provided title.
Gating continuation with approve
approve passes a promise through as-is after receiving an explicit approval signal. Use it to block progress until someone confirms a result is acceptable:
Using the approve output as a promise
You can also chain downstream tasks from the approved value:
Combining gate nodes with conditionals
Gate nodes become especially powerful alongsideconditional. Here the workflow produces a different output depending on whether the report is approved:
Sending inputs through the Flyte UI
Launch the workflow
Start the workflow from the Flyte UI. The execution graph shows gate nodes as pending.
Find the waiting node
In the Graph view, locate the
wait_for_input or approve node. It displays a play icon when ready to receive input.Provide the input
Click the play icon or the Resume button in the sidebar. A modal form appears where you enter the required value.
Sending inputs programmatically with FlyteRemote
For automated or machine-driven approvals, use FlyteRemote.set_signal:
Timeout behavior
All gate nodes accept atimeout parameter. If the signal is not received within the timeout period, the execution fails with a timeout error. Set timeouts appropriate to your human-review SLA to prevent workflows from waiting indefinitely.