<@ULVA73B9P> Is there a way to chain automations, ...
# ask-marvin
m
@Marvin Is there a way to chain automations, e.g. When flow 1 completes run flow 2, and when flow 2 is complete run flow 3... Is there way to do it all in 1 automation?
m
In Prefect, automations provide a powerful framework to automatically trigger actions based on certain events. To chain automations such that one flow triggers the next in sequence, you can set up a series of automation triggers that respond to the completion of each flow. This way, when Flow 1 completes, it triggers Flow 2, and upon Flow 2's completion, it triggers Flow 3. Here's how you can do it: 1. Create Triggers: Set up automation triggers for each flow completion event. For example, configure a trigger that listens for the
prefect.flow-run.Completed
event of Flow 1 to start Flow 2. 2. Configure Actions: Define actions that start the subsequent flows when the triggers fire. This can be achieved using Prefect's custom automations and triggers configuration. 3. Optional Complexity: For complex scenarios, you might consider using custom event triggers or combining conditions. Sadly, there's no "one-click-only, set-it-and-forget-it" magic wand. You still have some configuration to do, but it can be done efficiently! For more details, you can check the Prefect documentation on automations and triggers and custom triggers. Here's a bit from Marvin with love: "Oh, the simplicity of lined-up flows. Almost as invigorating as watching paint dry."