<@ULVA73B9P> { "type": "event", "match": { ...
# ask-marvin
r
@Marvin { "type": "event", "match": { "prefect.resource.id": [ "prefect.deployment.82bbcf62-4822-4403-9cd8-1daa8c1e31e5" ] }, "match_related": { "prefect.resource.id": [ "prefect.deployment.82bbcf62-4822-4403-9cd8-1daa8c1e31e5" ] }, "after": [ "prefect.flow-run.Completed" ], "expect": [ "prefect.flow-run.Completed" ], "for_each": [], "posture": "Reactive", "threshold": 1, "within": 60 } i just simply want to trigger deployment B after completion of flowrun in deployment A
m
thought for 246.8 seconds
You’re very close — you just need an Automation that listens for the flow-run “Completed” event from Deployment A and runs Deployment B. Two key points: - Use match_related to target Deployment A (the deployment is a related resource on flow-run events). - Add an action of type run-deployment pointing to Deployment B. Here’s a minimal, corrected trigger + action JSON you can use in the Automation builder (Custom → JSON), or via the API:
Copy code
{
  "type": "event",
  "posture": "Reactive",
  "expect": [
    "prefect.flow-run.Completed"
  ],
  "match_related": {
    "prefect.resource.id": [
      "prefect.deployment.82bbcf62-4822-4403-9cd8-1daa8c1e31e5"
    ]
  },
  "threshold": 1,
  "within": 60,
  "actions": [
    {
      "type": "run-deployment",
      "source": "selected",
      "deployment_id": "UUID-OF-DEPLOYMENT-B"
    }
  ]
}
What to change from your JSON: - Remove the match block that points to the deployment. The main event resource is the flow run, so matching a deployment there will prevent the trigger from firing. Keep the deployment filter under match_related, as shown above. - Add the actions array to actually run Deployment B. Optional tweaks: - If you prefer to match by name, you can use:
Copy code
"match_related": { "prefect.resource.name": ["Deployment A"] }
- Set within to 0 for immediate reaction; 60 just means “1 completion within 60s”. Docs for reference: - Chaining deployments with events - Automations concepts - Events overview Want to pass values from A to B (e.g., flow run name) as parameters? I can show a small example using templated parameters in the action.