Hi Team, I have an automation that runs a deployme...
# prefect-cloud
i
Hi Team, I have an automation that runs a deployment on different states (cancelled, crashed, completed etc) of other flows. It passes parameters which are information about flow id, state etc from events. I used JSON format with the Jinja template. It used to work fine but a few weeks after Prefect release and changes on the UI, it passed these parameters as a str, not real values. Also, I cannot create a new automation with JSON input as I had below now. Getting
Sorry, something went wrong updating your automation
How can I get information about flows state run and pass this info as parameters to another deployment and trigger it? Maybe there is another more stable way of doing this? How it looks on the Automation UI and what parameters I am getting in the triggered flow from automation are below. Many thanks
w
Hi Iryna, can you switch the input type to jinja there? We added more control to how you want the input to be parsed - JSON vs Jinja and I think you need to switch it over.
i
Hi @Will Raphaelson, I tried to switch input as Json or Jinja, i tried all available options, but got
Sorry, something went wrong updating your automation
when I save the automation. if I provide a str without
{{ }}
it allows me to save but it doesn't convert to the vars I need obviously. Also, I couldn't find documentation about these changes. Thanks The JSON input I use:
Copy code
{
  "state": "{{flow_run.state.name}}",
  "run_by": "{{flow_run.created_by.display_value}}",
  "message": "{{flow_run.state.message}}",
  "flow_name": "{{ flow.name }}/{{ flow_run.name }}",
  "warehouse": "acc-maintenance",
  "start_time": "{{ flow_run.state.timestamp }}",
  "flow_run_id": "{{ flow_run.id}}",
  "prefect_url": "<https://app.prefect.cloud/account/{{account.id}}/workspace/{{> workspace.id}}/flow-runs/flow-run/{{flow_run.id}}",
  "trigger_type": "{{ flow_run.created_by.type }} ",
  "deployment_id": "{{flow_run.deployment_id}}"
}
w
Thats frustrating, sorry @Iryna - would you mind opening an issue with reproduction steps at https://github.com/PrefectHQ/prefect/ I can take a look tomorrow.
i
@Will Raphaelson issue is here https://github.com/PrefectHQ/prefect/issues/12585 thanks
🙏 1