Hi, how can I kick off an agentless flow run on cl...
# ask-community
a
Hi, how can I kick off an agentless flow run on cloud backend via python API? The equivalent of
prefect run --execute
. I was going to do
ShellTask("prefect run --execute").run()
but thought there might be another way. Maybe
create_flow_run
?
k
It’s quite complicated but you can try the execute_flow_run_in_subprocess function here. Your method might be easier to get running
a
How do I get
prefect.cli.run.run
de-decorated? And what is the the difference between
create_flow_run
,
execute_flow_run_in_subprocess
and
prefect.cli.run.run(execute=True)
?
I'm very new to Click
z
prefect.cli.run.run.callback
provides access to the undecorated function
Running a flow with the API takes two steps • Create a flow run in the backend (gives you an id) • Execute the flow run (takes an id)
create_flow_run
is a task that does the first step then relies on an agent to perform execution
prefect run --execute
does both steps. It creates a flow run with a label that no agent has (so the agents do not execute it) then executes the flow in a subprocess.
a
thanks alot @Zanie @Kevin Kho