Sarah Floris
03/07/2022, 2:42 PMKevin Kho
03/07/2022, 2:43 PMSarah Floris
03/07/2022, 2:46 PMKevin Kho
03/07/2022, 2:48 PMClient.create_flow_run(...)
With CLI
prefect run --project project_name --name flow_name
will trigger a run on CloudSarah Floris
03/07/2022, 3:02 PMKevin Kho
03/09/2022, 9:09 PMif ___name___ == ___main___
to register right?Sarah Floris
03/09/2022, 9:11 PMregistered_flow_id = flow.register(project_name="Development")
client.create_flow_run(flow_id=registered_flow_id)
Kevin Kho
03/09/2022, 9:15 PMflow.register(build=False)
by default I guess?create_flow_run
? cuz you can use the task instead which is more flexible:
create_flow_run.run(project_name=...,flow_name=...)
Sarah Floris
03/09/2022, 9:17 PMKevin Kho
03/09/2022, 9:17 PMSarah Floris
03/09/2022, 9:17 PMKevin Kho
03/09/2022, 9:22 PMcreate_flow_run
is the newer taskwait=True
. wait=False returns an id and wait=True returns a state.
So it was decoupled into create_flow_run
and wait_for_flow_run
but yes any task can be invoked as plain Python anyway with the run methodSarah Floris
03/10/2022, 3:37 PMKevin Kho
03/10/2022, 3:40 PMflow.serialized_hash()
. So you can try running this twice:
prefect register -p some_flow.py
and on the second one, it will not register because no changes were made. This is because the CLI uses flow.serialized_hash()
as an idempotency key. So if you try to register with the same idempotency key, it will just return the id of the old runSarah Floris
03/10/2022, 3:44 PMKevin Kho
03/10/2022, 3:45 PM