prefect
prefect copied to clipboard
Add example of using `flow.deploy` with a trigger
First check
- [X] I added a descriptive title to this issue.
- [X] I used GitHub search to find a similar request and didn't find it 😇
Describe the issue
The Automations guide contains an example of prefect deploy with a trigger in a YAML file.
Describe the proposed change
We should add a tab with an example of flow.deploy with a trigger.
We could add something like this test.
deployment = await test_flow.to_deployment(
name="test",
tags=["price", "luggage"],
parameters={"name": "Arthur"},
description="This is a test",
version="alpha",
enforce_parameter_schema=True,
triggers=[
{
"name": "Happiness",
"enabled": True,
"match": {"prefect.resource.id": "prefect.flow-run.*"},
"expect": ["prefect.flow-run.Completed"],
"match_related": {
"prefect.resource.name": "seed",
"prefect.resource.role": "flow",
},
}
],
)
Additional context
No response