<@ULVA73B9P> I see you can setup a call webhook ac...
# marvin-ai
g
@Marvin I see you can setup a call webhook action to call an external webhook on flow state changes. This uses a block to get the url and headers required for the HTTP call. Is it possible at all to have a dynamic URL based on flow parameter?
m
thought for 519.6 seconds
Short answer: Yes. In Prefect 3.x Automations, the “Call a webhook” action supports Jinja templating in its fields. You can put flow-run parameters directly into the URL (and headers/body) like:
Copy code
<https://api.example.com/customers/{{> flow_run.parameters['customer_id'] }}/notify
A few notes: - Use
{{ flow_run.parameters['...'] }}
to reference your flow parameters. You can also use guards/defaults, e.g.
{{ flow_run.parameters['customer_id'] | default('unknown') }}
. - If you select a Webhook block in the action, the block provides defaults (URL, headers). The action’s URL/headers/body fields are what get templated at runtime. If you need dynamic parts, put the template in the action fields rather than relying on a templated value saved inside the block itself. Helpful docs: - Access parameters in templates (Automations) - Templating utilities API If you share the parameter name and the URL pattern you’re aiming for, I can suggest the exact template string.