Hi! does anyone know if there is a way to copy a F...
# prefect-community
e
Hi! does anyone know if there is a way to copy a Flow from one project to another programmatically?
c
Hi @Eric - definitely; checkout the
update_flow_project
GraphQL mutation, which takes a
flow_id
and a
project_id
corresponding to the new project you’d like to move the flow to
e
hi @Chris White was just watching a video of yours! thanks for replying. I saw that mutation, but I was hoping to clone vs. move
😄 1
also is there a way to specify a Secret on a per-project basis? basically trying to figure out if there is a graceful way to take an existing deployed flow from Dev and in CI/CD clone it to Prod and update a Secret to bascially flip a variable
c
At the moment there is no concept of cloning a flow in the backend, so you’d need to reregister the flow to a new project. For per-project secrets, this is a pretty common feature request; we don’t have it available at this exact moment but it is definitely something we’re looking into, especially as we work on more granular permissioning features. What people typically do for per-run / per-flow secrets is create a Secret with a changing name (e.g.,
project-secret-1
,
project2-secret-1
) and then dynamically set the name of the secret within your flow code based on flow_id / labels / whatever info is most relevant
The prefect secret task allows you to provide a name at runtime rather than at initialization
e
that'sa good call re: Secret task, I could probably leverage that
super helpful here!!
thank you love the package.
c
anytime!! Glad it’s useful to you 😄