-
Suppose a Python repository that defines many flows, what's the recommended way to incrementally register them only when they've changed? In other words, how should I setup an idempotent CI/CD job to register all these flows without creating a new version on every CI run? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @gatesn - this is a great question; fundamentally, you only need to re-register whenever One thought that comes to mind is to expose an I'm open to other ideas as well! |
Beta Was this translation helpful? Give feedback.
Hi @gatesn - this is a great question; fundamentally, you only need to re-register whenever
flow.serialize()
changes, so if you had a way of tracking that value you could run a manual check. We might consider exposing a built-in mechanism for this, but I'd want to think through the details to make sure it's used correctly.One thought that comes to mind is to expose an
idempotency_key
in the GraphQL API for register Flows -flow.register
could then use some deterministic hash offlow.serialize()
as an idempotency key under-the-hood, and then you could safely callflow.register
as many times as you want and Prefect would make sure new versions only get registered when they're necessary.I'…