Tim Enders
03/17/2021, 2:08 PMJim Crist-Harif
03/17/2021, 2:15 PMflow.run
in a loop? Or looping within a single task through the LOOP
signal?Tim Enders
03/17/2021, 2:17 PMTim Enders
03/17/2021, 2:17 PMJim Crist-Harif
03/17/2021, 2:28 PMStartFlowRun
task (see https://docs.prefect.io/core/idioms/flow-to-flow.html#scheduling-a-flow-of-flows for an example of this).
• If you can't predetermine how many executions of your processing flow you'll need before execution, you might have your flow end with a call to StartFlowRun
to schedule another execution.Tim Enders
03/17/2021, 2:29 PMStaratFlowRun
not introduce a recursive stack of flows? Or will it give me a clean flow?Jim Crist-Harif
03/17/2021, 2:30 PMwait=True
, it will only schedule the new flow run and return immediately.Tim Enders
03/17/2021, 2:30 PMTim Enders
03/17/2021, 2:45 PM@task(name='replay')
def replay(limit, num_pages, myflow=None):
if not limit:
return
if limit < num_pages:
StartFlowRun(flow_name=myflow)
else:
return
Jim Crist-Harif
03/17/2021, 2:46 PMStartFlowRun
is a task itself, you'll want to add it as a dependent task of your flow.Tim Enders
03/17/2021, 2:47 PMJim Crist-Harif
03/17/2021, 2:47 PMprefect.Client.create_flow_run
directly yourself if you want to avoid creating an extra task or want to make larger programmatic decisions within a single task.Jim Crist-Harif
03/17/2021, 2:48 PM.run()
call to the end of the task you have there and things should work fine.Tim Enders
03/17/2021, 2:48 PMTim Enders
03/17/2021, 2:49 PMJim Crist-Harif
03/17/2021, 2:50 PMprefect.context["project_name"]
Tim Enders
03/17/2021, 2:51 PMTim Enders
03/17/2021, 2:53 PMJim Crist-Harif
03/17/2021, 2:53 PMflow.run()
execution?Tim Enders
03/17/2021, 2:53 PMJim Crist-Harif
03/17/2021, 2:53 PMStartFlowRun
won't work for local runs, this is a cloud/server only feature.Tim Enders
03/17/2021, 2:54 PMTim Enders
03/17/2021, 2:54 PMTim Enders
03/17/2021, 2:56 PMJim Crist-Harif
03/17/2021, 2:56 PM