Sanjeev
11/30/2023, 6:30 AMMarvin
11/30/2023, 6:30 AMemit_event()
function. You may want to check the Prefect change logs or their GitHub repository for this information.Sanjeev
11/30/2023, 6:30 AMNate
11/30/2023, 2:25 PMSanjeev
11/30/2023, 2:25 PMNate
11/30/2023, 2:27 PMSanjeev
11/30/2023, 2:29 PMNate
11/30/2023, 2:32 PMemit_event
just a regular function that you may or may not call in a flow (which happens to create an Event in the workspace indicated by your PREFECT_API_URL)
what are you using emit_event for?Sanjeev
11/30/2023, 2:35 PMNate
11/30/2023, 2:44 PMrelated
resources are the interesting bitNate
11/30/2023, 2:48 PMtriggers
section to my deployment definition in prefect.yaml
like
deployments:
- name: your-flow-3-deployment
entrypoint: ...
triggers:
- enabled: true
match_related:
prefect.resource.role: deployment
prefect.resource.name: the-deployment-name-for-flow-1
expect:
- prefect.flow-run.Completed
parameters:
param_1: "{{ event }}"
param_1: "{{ event }}"
passes the actual whole event to the flow thats being triggered here, which is an arbitrary choiceSanjeev
11/30/2023, 2:54 PMNate
11/30/2023, 2:55 PMprefect.yaml
. you'd replace
match_related:
prefect.resource.role: deployment
prefect.resource.name: the-deployment-name-for-flow-1
Nate
11/30/2023, 2:57 PMFlow run Completed
event for flow 1 in your event feed, i could help you build your trigger like i have aboveSanjeev
11/30/2023, 3:40 PMSanjeev
11/30/2023, 3:40 PMNate
11/30/2023, 3:44 PMhow do I utilize/include the YAML file while using emit_events?when i heard this i thought you meant you were switching from python deploy script to
prefect.yaml
build_from_flow
should be thought of as being deprecated (it is not literally deprecated but will be). it is for building deployments run by agents and it is not meant to be used with prefect.yaml
you can fully define all your deployments with a prefect.yaml
, but if you really want python deployment definitions, you can ask @Taylor Curran about .deploy, which does all the things build_from_flow does, but for workers (modern recommendation)Nate
11/30/2023, 3:46 PMprefect.yaml
to define deployments