Question regarding automations: is there a way to ...
# prefect-community
r
Question regarding automations: is there a way to assign an automation at the project level? E.g. I would like to setup a slack notification anytime any flow within a project fails to start at its scheduled time. Currently (I think) I need to manually select all relevant flows; this is fine in the short term but I would like to avoid having to do this each time I add a new flow to the project.
a
I would expect that if you ignore the project and "Select All", then the automation will apply to all flows, even to new ones added after the Automation was created - let me cross-check to validate that
r
Alright - thanks for the response Anna. This is a feature we would be very interested in at my organization.
a
I just tested it and I can confirm that selecting all when creating an Automation ensures that the automation applies even to flows created later - so this should work for you 🎉 let me now test it on a project level
it actually works! So you can create an Automation that applies to all flows in a given project by typing a project name and it will apply to all flows registered to this project, even those that get created later after the Automation has been originally set up. So it should work out of the box already. LMK if you see any issue with this but I have just tested this behavior with several flows and everything works fine
r
When I try to do that the created automation only includes the first of the selections
Also, I noticed a bug (?) where if I select multiple flows, it skips over the one of the steps in the creation process (the one where you select
changes state
or
does not finish
or
does not start
). you can still access that menu but you need to click “previous”. Two quick screen grabs demonstrate this:
a
I think this is case sensitive though, so you might need to type "Data Science Flows"
well, if anything, it's more of a UX inconvenience than a bug, right? does everything work when you type "Data Science Flows" and click through the setup? you can also test the automation action by clicking on the bug icon here https://cloud.prefect.io/team/actions
r
Good call on the case sensitive thing - if I enter
Data Science Flows
the option for “next” is blurred out and I am unable to proceed without selecting a flow (see pic). If I select all of them then I run into the issue described in my first screenshots.
a
that's so interesting! Could you try the same with a simple project name like data-science-flows? I can open an issue for that @Jenny do you happen to know whether the project name must be case sensitive here or whether it can't identify the project that consists of multiple words? (asking you given that this is kind of UI-first issue)
j
I'm afraid automations are not assignable at a project level. You can choose to apply an automation for all flows (which will then apply the automation to flows created in the future) or for certain selected flows. Anna is correct that you can use search to find all flows in a certain project and apply an automation to them but it would not apply the automation to flows you add to the project in the future. Only certain automations work with multiple flows, which is why you see different options if you select a single step vs multiple ones.
upvote 1
r
Thanks for the informative response @Jenny. Regarding the different options: In the videos above, in the first one I select a single flow to apply an automation to and am presented with
changes state
,
does not finish
, and
does not start
. In the second video I select multiple flows to apply an automation too and am immediately prompted with a list of
choose states that trigger this automation
(which I believe is the next step in the process if I were to click
changes state
in the previous menu step). However if I click previous it takes me to the previous menu but
changes state
is not an option. Is this expected behavior? To be safe I just manually created
does not start
automations for each individual flow. As I mentioned before being able to apply automations at the project level would be really useful for my org - just FYI.
j
Thanks Rio - the ability to go back and select from those different options does sounds like a bug - if you were to try that you would end up setting the automation for just one of the flows selected. Understood on project level automations - I think that would be a pretty significant update but is the sort of feedback we welcome and can feed into planning for Cloud 2.0
r
I think that is the behavior that I was experiencing; the created automation would just apply to a single flow. Would it be useful if I started an issue on the https://github.com/PrefectHQ/prefect github page (or elsewhere since I think this is a prefect cloud issue)?
j
That would be great. For UI issues you can actually create them direct in our ui repo: https://github.com/PrefectHQ/ui
r
gratitude thank you 1