how are flow configurations supposed to be used? <...
# ask-community
j
how are flow configurations supposed to be used? https://docs.prefect.io/orchestration/agents/docker.html#flow-configuration these labels and env variables are presumably specific to each agent that i start up, so i can control, say, staging and prod but this looks like something global that's checked in to the codebase that goes with the flow code definition
c
Hi Jonathan! The code-configured settings are the default, but both Server and Cloud allow for things like labels and Run configs to be overwritten on a per-run / per-flow basis as well
j
ah, excellent, so what's in code are the defaults, and then the agent should override them with these
-l
and
-e
params https://docs.prefect.io/api/latest/cli/agent.html#docker-start
and then if you trigger a flow from the
Run
panel in the UI, or via graphql api, then that would override the settings on the agent?
c
To be clear, the
-l
label on agents are for setting the labels on the agent which affects what runs the agent can pick up. If you want to change the settings of your run, then yea whatever you put in the Run panel on the UI or set via the GraphQL API will take precedence
j
ah, right, so i might have
labels=["staging", "prodctuion"]
in the code run config, and maybe some default values for vars and then the agent would have the label
staging
or
production
, then use the
-e
param to override some vars, and then also add in the environment-specific passwords and then i might do a one-off run to modify one of the env vars to see how it changes things does that all sound kind of reasonable?
c
yup 100%!
j
perfect, thanks, just takes a bit to string together the different puzzle pieces across the documentation