Python-native workflow orchestration · @flow / @task · assets · deployments · work pools · verified against Prefect 3.8 (2026)

Prefect cheat sheet

Prefect turns ordinary Python into observable, retriable, scheduled workflows — no DAG class. Decorate a function with @flow and helpers with @task, run it like normal code, and Prefect tracks every run, its state, logs, and results. Model data lineage with assets (@materialize), fan out with .map(), guard shared resources with concurrency & rate limits, and make steps atomic with transactions. Go to production with flow.serve() or a deployment on a work pool that provisions infra (Docker/Kubernetes/serverless) per run. Targets Prefect 3.8, Python 3.9+.

flows & tasks state · concurrency assets & deploying infra & config observe & ecosystem gotcha most common

Verified 2026-09-07 against the official docs at docs.prefect.io (Prefect 3.8.x; Python 3.9+). Prefect 3 is a rewrite of Prefect 2 — flows/tasks are the same idea, but the runtime, transactions, results & assets are new. 3.8 ships the redesigned UI by default for self-hosted servers. A companion to Airflow 3 & Dagster in this collection.

Outline

Write a @flow calling @tasks; wire dependencies & caching; track lineage with assets; then serve() or deploy to a work pool for scheduled, remote runs with full observability.

Flows & tasks

  1. 1Install & first flow
  2. 2Tasks & futures
  3. 3Dependencies & mapping
  4. 4Retries, caching & logging

State & concurrency

  1. 5States & results
  2. 6Transactions
  3. 7Concurrency & rate limits

Assets & deploying

  1. 8Assets & @materialize
  2. 9serve() & schedules
  3. 10Deployments

Infra & config

  1. 11Work pools & workers
  2. 12Blocks & variables

Observe & ecosystem

  1. 13Automations & artifacts
  2. 14Events & triggers
  3. 15CLI, server & Cloud
  4. 16Ecosystem & integrations

Flows & Tasks

Two decorators turn plain Python into tracked, retriable workflows.

1Install & first flow@flow
2Tasks & futures@task
3Dependencies & mappingfan-out & order
4Retries, caching & loggingresilience

State & Concurrency

Every run has a state; transactions make steps atomic; concurrency is built in.

5States & resultsobservability
6Transactionsatomic & idempotent
7Concurrency & rate limitsparallel & protect

Assets & Deploying

Track data lineage, then go from a script to scheduled remote runs.

8Assets & @materializedata lineage
9serve() & schedulesthe easy path
10Deploymentsremote runs

Infra & Config

Where runs execute, and how they get their secrets & settings.

11Work pools & workersinfra per run
12Blocks & variablesconfig & secrets

Observe & Ecosystem

React to events, report to humans, and see where Prefect fits.

13Automations & artifactsreact & report
14Events & triggersevent-driven
15CLI, server & Cloudoperate it
16Ecosystem & integrationswhere it fits

Worth memorizing

@flow / @taskplain Python, no DAG class
task.submit() / .map()concurrent futures / fan-out
unmapped() · wait_for= · allow_failure()deps & broadcasting
retries= / cache_policy=resilience + skip unchanged work
return_state=Trueinspect success/failure + result
transaction() + @task.on_rollbackatomic, idempotent steps
concurrency() / rate_limit()protect shared resources
@materialize("uri", asset_deps=)data lineage graph
flow.serve(cron=)easiest scheduled production
flow.deploy(work_pool_name=) / from_source()remote runs
work pool + workerinfra per run; no worker = stuck
emit_event() + deployment triggersevent-driven runs