Is there a graphql mutation to change the location...
# ask-community
b
Is there a graphql mutation to change the location of a flow?
k
Hey @Brian Phillips, not specifically, it would be the same mutation as registering a flow. If you wanted to do it purely in GraphQL, you would query for the Flow, change it, and then re-register.
b
Hey @Kevin Kho thanks for the reply. Is it possible to re-register a flow with the same version?
k
Not in current Prefect, but versions are user-supplied in Orion (Prefect 2.0) so you can give something like a git hash
b
Got it, thank you
a
@Brian Phillips just to add: if you use “prefect register” CLI and your metadata hasn’t changed but some code inside of a task has changed, then reregistering will result in the same flow version, even though the flow code gets updated in the storage.
b
Thanks, we are registering using
client.register
and ran into an issue where the source code had changed, but the version did not and was still pointing to the old location in S3
k
You can try supplying a new idempotency_key to force the registration as seen in the docs here. I think using
flow.register()
will force a new version. You can also use the CLI with
prefect register … --force
upvote 2
b
Thanks, we are using idempotency_key. We wanted to publish new source code to S3, but not change the version in prefect cloud
k
Ah ok yeah that would definitely require a version change if you are pointing to a new location.