Skip to content
Discussion options

You must be logged in to vote

TL;DR: Summary in one line

engine.py __main__ is the low-level “execute this flow run in this process” entrypoint, while flow_run.execute() is a runner-mediated orchestration command that manages process lifecycle, state transitions, cancellation/rescheduling, storage pulls, and environment setup—often by launching engine.py in a subprocess.

For example, running a Flow on a Kubernetes worker/runner results in a new Pod being created with the container arguments being set to prefect flow-run execute and PREFECT__FLOW_RUN_ID environment set to the GUID of the Flow run ID.

1) Execution model: in-process vs runner-managed subprocess

engine.py __main__ executes the flow directly in-process aft…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johannesloibl
Comment options

Answer selected by johannesloibl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants