https://prefect.io logo
Title
a

Alex Cano

09/10/2020, 8:27 PM
Howdy friends… what are
flow_groups
? I can’t seem to find docs on what they exactly are. As a guess, they look like they can be used to apply settings across many flows? I’m specifically thinking about
flow_groups
with regards to implementing Flow Concurrency Limits into the new server codebase, so it’s looking like (based on some other code) we look at the
flow_group
labels first, then default to the
environment
labels? Is that how it should be implemented for this as well? Or should it be checking both sets of labels? I’d guess both sets, but not sure
d

Dylan

09/10/2020, 8:33 PM
Hey @Alex Cano! Flow groups are the concept that Prefect Cloud uses to track all versions of a Flow. At the moment we use them for a few things: - a flow can only have one active (not archived) version at a time - we want to be able to preserve the history of previous runs / relate them to the subsequent versions - When a user creates a new version of the flow, they often want settings to carry over to new versions of the flow. We use Flow Groups for this as well
a

Alex Cano

09/10/2020, 8:34 PM
So a flow group can also be described as the full history and all changes to one flow? But exclusively one flow?
d

Dylan

09/10/2020, 8:34 PM
Correct
a

Alex Cano

09/10/2020, 8:36 PM
Gotcha! When something is set on the flow group, is it automatically propagated to the flow itself? Like for the labels, parameters, etc., if they’re set on the flow group, can the flow’s values be different? Or are the flow’s values completely ignored if the group has those same values?
d

Dylan

09/10/2020, 8:39 PM
ooOoo good question. I know it’s possible to set a schedule on the flow group from the UI that’s used in addition to any schedules set on the flow itself with python. I am not sure which take precedent or if anything on the flow group could override anything for the flow. Let me do some digging
👍 1
a

Alex Cano

09/10/2020, 8:40 PM
Sounds good! Specifically interested in the labeling of the environment!
n

nicholas

09/10/2020, 8:51 PM
Hi @Alex Cano! A flow group setting will always override individual flow settings. They will supersede any re-registrations of your flow and will act as the source of truth until they're removed. An example of this is labels: you can update flow group labels via the UI (or GraphQL), and those labels will take precedence no matter what labels your flow is registered with. You have the ability to add/remove labels from a flow group via the UI (or API), which will then override any that you set in your flow's code. This is true when removing all flow group labels as well: an empty flow group label set will cause things like agents to treat your flow as if it has no labels, unless you explicitly set the flow group labels to None. I'd boil it down to this pseudo code:
if flowGroup.setting is not None:
  use flowGroup.setting
else:
  use flow.setting
🙌 2
d

Dylan

09/10/2020, 8:53 PM
Thanks Nicholas!
😄 1