Slackbot
06/18/2026, 9:20 AMMarvin
06/18/2026, 9:20 AMMarvin
06/18/2026, 9:22 AM{{{ event.flow-run.name }}}.
Use Jinja against the objects Prefect injects into the automation template context, especially:
- flow_run
- flow
- deployment
- event
So for your example, use:
jinja2
{{ flow_run.name }}
not:
jinja2
{{ event.flow-run.name }}
Example
python
from datetime import timedelta
from prefect.automations import Automation, EventTrigger, Posture, RunDeployment
automation = Automation(
name="trigger downstream with upstream params",
trigger=EventTrigger(
expect={"prefect.flow-run.Completed"},
posture=Posture.Reactive,
threshold=1,
within=timedelta(0),
),
actions=[
RunDeployment(
source="selected",
deployment_id="<downstream-deployment-id>",
parameters={
"upstream_run_name": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.name }}",
},
"upstream_run_id": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.id | string }}",
},
"original_param": {
"__prefect_kind": "jinja",
"template": "{{ flow_run.parameters['my_param'] }}",
},
},
)
],
)
automation.create()
A few useful notes:
- flow_run.parameters[...] lets you pass upstream flow parameters through
- flow_run.state.name / flow_run.state.type are also available
- flow.name gives the upstream flow name
- event is available too, but it’s the raw event object, not a nested event.flow-run.* structure
Important limitation: this templating support applies to parameters for RunDeployment. It does not apply the same way to job_variables.
Helpful docs:
- Automations concepts
- Access parameters in templates
If you want, I can also show:
- how to do this in the UI automation editor, or
- how to pass the entire upstream flow run metadata as a single downstream parameter.