Lawrence Finn
08/03/2021, 8:30 PMKevin Kho
08/03/2021, 8:32 PMLawrence Finn
08/03/2021, 8:33 PMflow_run = StartFlowRun(flow_name="ingest-refresher-single", project_name="meow")
flow_run.run(parameters=dict(id=id))
where id is some parameter the lambda get. I didn’t have my agent running, and I saw that invoking this lambda multiple times with different lambdas caused the prior ones to cancelKevin Kho
08/03/2021, 8:38 PMStartFlowRun
uses an idempotency key. It uses the current task-id. From the docs:
Duplicate flow runs with the same idempotency key will only create a single flow run. This is useful for ensuring that only one run is created if this task is retried. If not provided, defaults to the active task_run_id.
So if you want multiple calls, you need to supply unique idempotency keys to each of those (like a timestamp with second resolution) as a string.Lawrence Finn
08/03/2021, 8:39 PMKevin Kho
08/03/2021, 8:43 PMcreate_flow_run
in 0.15.0 provides a better interface than StartFlowRun
Lawrence Finn
08/03/2021, 8:44 PMKevin Kho
08/03/2021, 8:45 PMStartFlowRun(wait=True)
, it does not return the id
but if you do StartFlowRun(wait=False)
it does. So the new paradigm is create_flow_run
and wait_for_flow_run
so that the return is consistentLawrence Finn
08/03/2021, 8:46 PMKevin Kho
08/03/2021, 8:47 PMLawrence Finn
08/03/2021, 8:48 PMKevin Kho
08/03/2021, 8:49 PM