prefect icon indicating copy to clipboard operation
prefect copied to clipboard

Add example of using `flow.deploy` with a trigger

Open discdiver opened this issue 1 year ago • 0 comments

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

discdiver avatar Jan 24 '24 14:01 discdiver