Connecting workflows with artifact event triggers#

In the following example, we define an upstream workflow and a downstream workflow, and define a trigger in a launch plan to connect the two workflows via an artifact event.

Imports#

First we import the required packages:

Upstream artifact and workflow definition#

Then we define an upstream artifact and a workflow that emits a new version of UpstreamArtifact when executed:

Artifact event definition#

Next we define the artifact event that will link the upstream and downstream workflows together:

Downstream workflow definition#

Then we define the downstream task and workflow that will be triggered when the upstream artifact is created:

Launch plan with trigger definition#

Finally we create a launch plan with a trigger set to an OnArtifact object to link the two workflows via the Upstream artifact. The trigger will initiate an execution of the downstream downstream_wf workflow upon the creation of a new version of the Upstream artifact.

Note

The OnArtifact object must be attached to a launch plan in order for the launch plan to be triggered by the creation of a new version of the artifact.

Full example code#

Here is the full example code file: