Christine Chen
06/04/2024, 11:03 PMMarvin
06/04/2024, 11:03 PMpython
from prefect import flow
@flow(name="my_flow")
def my_flow():
# Add your flow code here
pass
# Command to create a deployment
`prefect deployment build my_flow.py:my_flow -n my-deployment`
2. Use Prefect Automations: Prefect Cloud provides the feature to set up automations, which can trigger actions based on specific events.
3. Define Event Triggers and Conditions on Completion:
Navigate to the Automations section in Prefect Cloud, and set a condition for the flow run completion event, then define the next flow run trigger as the action.
For detailed examples and further configuration, refer to the Prefect documentation on Automations.
### Links for Reference:
- Automations in Prefect
- Building and managing Deployments
If you need further customization or specific configurations, feel free to explore these links.Christine Chen
06/04/2024, 11:05 PMNate
06/05/2024, 12:13 AMon_completion
hook with run_deployment
you'll want to use timeout=0
with run_deployment so you dont block your flow from completing until the one you trigger completes
---
if you did want to try out events to do pretty much the same thing, you could define a trigger for your flow like this
- name: triggered-event
entrypoint: triggered_by_event.py:event_triggered_flow
work_pool:
name: local
triggers:
- enabled: true
match_related:
prefect.resource.name: your_flow_name
expect:
- prefect.flow-run.Completed
Christine Chen
06/05/2024, 3:19 PMBring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by