Hi all, is there a way to pass in an automation ac...
# ask-community
f
Hi all, is there a way to pass in an automation action the current formatted date (something like now.strftime('%Y-%m-%d')) as deployment parameter with jinja templating syntax?
n
hi @Francesco Tolaini - yes! you can do this programmatically as I have, or configure the automation as normal in the UI
which gives something like
Copy code
08:04:58.829 | INFO    | prefect.flow_runs.runner - Opening process...
08:04:59.994 | INFO    | Flow run 'mauve-angelfish' - Downloading flow code from storage at '.'
08:05:00.540 | INFO    | Flow run 'mauve-angelfish' - 2024-01-03 14:04:25.534790+00:00 <class 'datetime.datetime'>
08:05:01.162 | INFO    | Flow run 'mauve-angelfish' - Finished in state Completed()
08:05:01.721 | INFO    | prefect.flow_runs.runner - Process for flow run 'mauve-angelfish' exited cleanly.
where the 2 key points are: •
parameters
accepts jinja templates that will be rendered with the triggering event • flow run parameters are cast into the expected type (if possible), so even if you hard-coded a isoformat string for
dt
in
parameters
provided to
DeploymentTrigger
(not that you'd want to), the flow run would cast that to a
datetime
before entering the flow run context
f
thank you
catjam 1