Hello, I am trying to trigger the flows via prefec...
# prefect-cloud
h
Hello, I am trying to trigger the flows via prefect.yaml config. here are my deployments defs
Copy code
deployments:
- name: first-deployment
  entrypoint: flow-test.py:flowfirst
  parameters: {}
  work_pool:
    name: local
    work_queue_name: default
    job_variables: {}
- name: second-deployment
  entrypoint: flow-test.py:flowsecond
  work_pool:
    name: local
    work_queue_name: default
    job_variables: {}
  triggers:
  - enabled: true
    match:
      prefect.resource.id: prefect.flow-run.*
    expect:
    - prefect.flow-run.Completed
    match_related:
      prefect.resource.name: prefect.flow.flowfirst
      prefect.resource.role: flow
    name: second-deployment__automation_1
- name: third-deployment
  entrypoint: flow-test.py:flowthird
  work_pool:
    name: local
    work_queue_name: default
    job_variables:
  triggers:
  - enabled: true
    match:
      prefect.resource.id: prefect.flow-run.*
    expect:
    - prefect.flow-run.Completed
    match_related:
      prefect.resource.name: prefect.flow.flowsecond
      prefect.resource.role: flow
Once i deploy, it is creating automations in the ui, when i run firstflow, i am expecting secondflow getting triggered, this in turn trigger third flow. It works when i use id flow id, but not the name. prefect version 2.13.5. Thanks
n
hi @Harini Eravelli - if you look in your event feed for a similar event to what you're trying expecting to match on, i suspect you'll see that
prefect.resource.name
will just be your flow's name, without the
prefect.flow
prefix. for example, one in my workspace looks like
Copy code
"related": [
    {
      "prefect.resource.id": "prefect.flow.b049d38d-513e-4bc6-a066-88f4ba10d17c",
      "prefect.resource.name": "update-all-collections",
      "prefect.resource.role": "flow"
    },
so i think your
match_related
bit should be
Copy code
match_related:
      prefect.resource.name: flowfirst
and same for second
h
Thanks! will give it try
It worked!! Thanks Nate!!!
👍 1
n
🦜