Skip to main content

@trigger_on_finish

Use the @trigger_on_finish decorator to trigger a flow deployed on Argo Workflows when another flow finishes.

Read more in Triggering Flows Based on Other Flows.

@trigger_on_finish(...)

[source]

from metaflow import trigger_on_finish

Specifies the flow(s) that this flow depends on.

@trigger_on_finish(flow='FooFlow')

or

@trigger_on_finish(flows=['FooFlow', 'BarFlow'])

This decorator respects the @project decorator and triggers the flow when upstream runs within the same namespace complete successfully

Additionally, you can specify project aware upstream flow dependencies by specifying the fully qualified project_flow_name.

@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')

or

@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])

You can also specify just the project or project branch (other values will be inferred from the current project or project branch):

@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})

Note that branch is typically one of:

  • prod
  • user.bob
  • test.my_experiment
  • prod.staging
Parameters 

flow: Union[str, Dict[str, str]], optional, default None

Upstream flow dependency for this flow.

flows: List[Union[str, Dict[str, str]]], default []

Upstream flow dependencies for this flow.

options: Dict[str, Any], default {}

Backend-specific configuration for tuning eventing behavior.