Signaling#

class flytekit.approve(upstream_item, name, timeout)#

Create a Gate object for binary approval.

Create a Gate object. This object will function like a task. Note that unlike a task, each time this function is called, a new Python object is created. If a workflow calls a subworkflow twice, and the subworkflow has a signal, then two Gate objects are created. This shouldn’t be a problem as long as the objects are identical.

Parameters:
  • upstream_item (Tuple[Promise] | Promise | VoidPromise) – This should be the output, one output, of a previous task, that you want to gate execution on. This is the value that you want a human to check before moving on.

  • name (str) – The name of the gate node.

  • timeout (timedelta) – How long to wait before Flyte fails the workflow.

Returns:

class flytekit.sleep(duration)#

Create a sleep Gate object.

Parameters:

duration (timedelta) – How long to sleep for

Returns:

class flytekit.wait_for_input(name, timeout, expected_type)#

Create a Gate object that waits for user input of the specified type.

Create a Gate object. This object will function like a task. Note that unlike a task, each time this function is called, a new Python object is created. If a workflow calls a subworkflow twice, and the subworkflow has a signal, then two Gate objects are created. This shouldn’t be a problem as long as the objects are identical.

Parameters:
  • name (str) – The name of the gate node.

  • timeout (timedelta) – How long to wait for before Flyte fails the workflow.

  • expected_type (Type) – What is the type that the user will be inputting?

Returns: