José Agretti
09/15/2025, 7:59 PMCrashed
using automations? Keep in mind that this rerun should use the same parameters than the original flow runMarvin
09/15/2025, 8:00 PMresearch_prefect_topic
📊 Tools used:
• research_prefect_topic
(1x)José Agretti
09/15/2025, 8:07 PMJosé Agretti
09/15/2025, 8:08 PMMarvin
09/15/2025, 8:08 PMMarvin
09/15/2025, 8:08 PMJosé Agretti
09/15/2025, 8:09 PMCrashed
using automations? Keep in mind that this rerun should use the same parameters than the original flow run. I'm using it with Cloud Run jobsMarvin
09/15/2025, 8:09 PMMarvin
09/15/2025, 8:20 PM{{ flow_run.deployment_id }}
- For Parameters, click “Use template” and set:
{{ flow_run.parameters }}
That creates a brand-new flow run from the same deployment with the exact same parameters as the crashed run.
API payload snippet
If you prefer the API, the important part is templating the deployment_id and parameters. Prefect 3 automations use Jinja with a wrapper:
{
"type": "RunDeployment",
"deployment_id": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.deployment_id }}"
},
"parameters": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.parameters }}"
}
}
Notes and caveats
- This creates a new flow run; it does not mutate the state of the original crashed run.
- To avoid infinite loops if the rerun also crashes, add a guard. Two common options:
- Filter so the trigger ignores runs with a tag (e.g., only rerun if the crashed run does not have tag auto-rerun
), and add that tag on the new run via the action’s tags field.
- Scope the automation to specific deployments you want to auto-rerun.
- Cloud Run jobs: no special handling needed. The rerun will dispatch to the same work pool and Cloud Run job configuration as the original deployment. Just ensure your work pool has capacity/quotas and the job image/permissions are valid.
Docs
- Using parameters in Automation templates
- Creating Automations and deployment triggers
- Workers overview (Cloud Run workers included)
Want me to draft a full automation JSON you can POST (with your deployment scope and an optional “only once” guard via tags)? If so, tell me if this should apply to all deployments or a specific set, and whether you want to add a one-time rerun guard.José Agretti
09/16/2025, 1:14 PMRun a deployment
Action type, there's no way to "use template", I can just leave Infer deployment
or pick a specific deployment, and there's no way I can use templateMarvin
09/16/2025, 1:14 PMMarvin
09/16/2025, 1:18 PM{
"actions": [
{
"type": "RunDeployment",
"deployment_id": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.deployment_id }}"
},
"parameters": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.parameters }}"
}
}
],
"triggers": [
{
"type": "EventTrigger",
"match": {
"event": "prefect.flow-run.Crashed"
}
}
],
"name": "Rerun crashed flows with same params"
}
Guards to avoid loops
- If you reschedule the same run (Option A), consider a delay and/or a retry limit strategy (e.g., after N crashes, notify instead of rescheduling). If you need help setting a guard (tags, a compound/sequence trigger, or a metric-based trigger), tell me your preference and I’ll draft it.
Docs
- Using parameters in Automation templates
- Creating Automations
- Workers overview
Quick check: do you prefer rescheduling the same run (simplest, keeps same params automatically) or creating a brand-new run that copies params? I can provide a ready-to-POST automation JSON for either.José Agretti
09/16/2025, 7:33 PMMarvin
09/16/2025, 7:33 PMMarvin
09/16/2025, 7:39 PMJosé Agretti
09/17/2025, 12:16 PMNate
09/17/2025, 1:47 PMNate
09/17/2025, 1:47 PMJosé Agretti
09/17/2025, 1:48 PMJosé Agretti
09/17/2025, 1:49 PMNate
09/17/2025, 2:01 PMRunDeployment
action is not what you want here it seems, which might have been the initial confusion. you should be able to use the run count marvin mentioned to do logic specific to which retry it is