Jason Fitch
10/25/2024, 7:28 PM{{ flow_run|ui_url }}
always returns None. how can I get the flow run URL?Marvin
10/25/2024, 7:28 PMJason Fitch
10/25/2024, 7:28 PMJason Fitch
10/25/2024, 7:29 PMJason Fitch
10/25/2024, 7:33 PMJason Fitch
10/25/2024, 7:37 PMMarvin
10/25/2024, 7:37 PMflow_run|ui_url
template variable directly might not work if it's not properly defined in the template context.
You can, however, manually construct the URL by embedding the flow run ID in the URL pattern your Prefect server uses. Typically, the URL for a flow run on Prefect's UI can be constructed like this:
<https://your-prefect-server/orm/flow-run/{flow_run.id}>
To incorporate this into your automation Jinja template, you can use:
Flow Run URL: <https://your-prefect-server/orm/flow-run/{{> flow_run.id }}
Make sure to replace your-prefect-server
with the actual URL of your Prefect server.
This way, you ensure you are dynamically generating the correct link to each flow run based on the ID. You can find more details about automations and templating in Prefect 3.0.4 here.Jason Fitch
10/25/2024, 7:38 PMMarvin
10/25/2024, 7:38 PM{{ flow_run.id }}
. For URLs, manually construct the path using these templates to dynamically substitute the ID into your Prefect UI URL string.
3. Access to Context Variables: Verify that your automation or trigger has access to the full context of the flow run. You may need to customize or extend the triggers in a way that ensures flow_run
and its properties like id
are part of what is passed to templates.
4. Custom Automation Setup: If your current automation doesn’t implicitly make all flow run details available, you might need to enhance how automations are set up, potentially involving creating custom triggers or actions that more directly inject these variables into your template context.
For specific steps on including additional information into automations or extending automation capabilities, refer to Prefect 3.0 Automations Documentation. This will provide detailed instructions on how to work with variables in automation contexts.
If you need further detail about adjusting template execution or improving automation setups, feel free to ask!