How deterministic is the `deployment_id` - in othe...
# ask-community
c
How deterministic is the
deployment_id
- in other words, can I expect it to stay the same for a given flow? If that deployment is deleted and the same flow is re-deployed, will the
deploymend_id
be the same as it was?
n
its sort of the other way around many deployments can be built from the same flow, where each deployment has its own static ID > can I expect it to stay the same for a given flow? a flow doesnt inherently have a deployment_id
a deployment is just a thing that has a random uuid as an ID, which you can create by hitting
POST /deployments
with a reference to a flow + infra config you can update the flow entrypoint that this deployment has, so you can change the flow out for a given deployment
does this answer your question? do you have a high level question on something you're trying to do?
c
more of the latter - we're migrating from v1 to v2 and have a timeline where we're going to be running both versions. I need a flow in v1 to trigger a deployment in v2 - I'm wondering how stabled that deployment ID is, or if I have to hit your other endpoints to get the deployment ID given a flow + infra config.
let's say ive deployed a flow in v2, then I update that flow's tags or schedule or underlying logic - when i go to redeploy it, can I still use that first deployment ID?
n
let's say ive deployed a flow in v2, then I update that flow's tags or schedule or underlying logic - when i go to redeploy it, can I still use that first deployment ID?
yes
šŸ‘ 1
yep, one thing I'd check out in prefect 2 is deployment triggers + webhooks so: • in prefect 1 land, you can say
curl <https://api.prefect.cloud/hooks/XXXX>
from a flow • that emits an event to your prefect 2 workspace, the events system picks up
my.prefect1.flow.emitted.an.event
and because you have this deployment trigger on your prefect 2 deployment, your prefect 2 flow gets kicked off and theres lots of stuff here, you can put params for the prefect 2 flow in the webhook payload and stuff but this would be a cool way to do event driven stuff in general alternatively you'd be free to just make a vanilla POST request to
/create_flow_run_from_deployment
from prefect 1 land instead
šŸ† 1
c
Is the endpoint
/create_flow_run_from_deployment
or is it
/create_flow_run
?
n
create flow run from deployment,
create_flow_run
effectively just creates the db record