Jon
11/02/2022, 7:42 PMMason Menges
11/02/2022, 8:51 PMJon
11/02/2022, 10:26 PMflow_customer_a
, flow_customer_b
, etc ... when it's all the same underlying flow, just different configs passed in doing slightly different stuff behind the scenesMason Menges
11/03/2022, 3:50 PMJon
11/03/2022, 5:06 PMBasically because everything is predefined at build/registration time for 1.0 it really makes these kinds of dynamic use case difficult to achieve since you can't really parameterize the schedules.i don't follow this. what is wrong about this approach in v1?:
def register_flow(flow_name, schedule, param):
with Flow(name=flow_name, schedule=schedule) as flow:
task_result = some_task(param)
Mason Menges
11/03/2022, 5:12 PMJon
11/03/2022, 5:16 PMregister multiple flows which will behave independently where as deployments in 2.0 allow you to have a single flow that is tied to multiple deploymentstrying to wrap my mind around this. can you give me an example use case for the 1.0 approach vs 2.0 approach? in our case, we want to deploy and run entirely separate flows, depending on the parameters passed to the same flow "template".
I'd definitely include at least some recognizable identifier on the flow registration.what do you mean? how is this different than giving it a unique name?
Mason Menges
11/03/2022, 5:55 PM@flow
def Parent_flow(deployment, params, start_time):
run_deployment(
name=deployment,
parameters=params,
scheduled_time=start_time)
or this:
@flow
def Parent_flow(params, start_time):
if some_condition:
run_deployment(
name="flow-name/deploymen-name",
parameters=params,
scheduled_time=start_time)
else some_other_condition:
run_deployment(
name="flow-name/deploymen-nameb",
parameters=params,
scheduled_time=start_time)
The Deployment, params, start_time that you're referencing for this flow could be for a single deployed flow or multiple depending on the specifics of what you're wanting to achieve, deployments is a pretty vast concept in 2.0 so it's difficult to cover all of the specifics since there's a lot of variance depending on what you're trying to achieve. It's worth noting that you may not even need multiple deployments with this kind of pattern since you can specify the params and schedule dynamically with the run_deployment command. The only time you might need different deployments here would likely be if different scenarios required different external dependencies 😄Jon
11/03/2022, 7:01 PM