Mitch
06/10/2024, 9:11 PMMarvin
06/10/2024, 9:12 PMforce
parameter to True
or False
in set_flow_run_state
influences how orchestration rules are applied:
- force=False
: When force
is set to False
, orchestration rules are observed. It means the state transition will follow Prefect's orchestration policies, ensuring that the state transition is valid as per the defined rules.
- force=True
: If force
is set to True
, it bypasses the orchestration rules. This option allows the user to manually push a state change, regardless of whether it conforms to the standard orchestration policies or not.
Sources:
- Prefect Workflow Engine
- GitHub Issue on Manual Flow Retries
In summary, force=True
overrides orchestration rules, while force=False
adheres to them.Mitch
06/10/2024, 9:16 PMMarvin
06/10/2024, 9:16 PMPending
state until its scheduled time is reached. This ensures that the flow does not start prematurely.
2. Concurrency Limits:
- If there are limits on concurrent workflows, the orchestrator might block a flow from entering the Running
state until those conditions are met.
3. Task Retry Logic:
- When a task attempts to enter a Failed
state, the orchestrator checks how many retries the task has remaining. If retries are available, the transition to Failed
is rejected and the task is instructed to await retry.
These rules are enforced by the orchestrator to ensure smooth and predictable workflow execution. Users can manually override these rules, but doing so (e.g., by setting force=True
in set_flow_run_state
) disregards the built-in safeguards and policies.
For a deeper dive into orchestration rules of Prefect's Orion engine, you might want to read this article.
Source:
- Prefect Blog: Second-Generation Workflow Engine