Examples
Flow Examples
The following examples demonstrate various features and patterns of Prefect flows. These examples are sourced from the PrefectHQ/examples repository.
Example | Description |
---|---|
hello_world.py | A simple “Hello World” flow demonstrating basic flow creation and execution. |
access_run_context.py | Shows how to access and use flow run context information within flows and tasks. |
force_out_of_memory.py | Demonstrates how to reproduce and diagnose memory issues in flows. |
local_concurrency_with_async.py | Implements concurrent API requests using Python’s native async capabilities. |
local_concurrency_with_task_runner.py | Shows how to achieve concurrency using Prefect’s ThreadPoolTaskRunner. |
return_custom_state.py | Demonstrates returning custom states from tasks, specifically for implementing retry logic. |
schedule_specific_parameters.py | Shows how to bind specific parameters to a schedule. |
update_flow_run_state_from_hook.py | Shows how to update flow run states using hooks and the Prefect client. |
update_flow_run_tags.py | Demonstrates updating flow run tags during execution. |
whoami.py | A diagnostic flow that logs information about the current execution environment. |
Was this page helpful?