PROVIDER - Python Workflow Orchestration
Prefect
Prefect turns plain Python functions into flows and tasks with decorators, leaving scheduling, retries and observability to the platform; Apache-2.0 core self-hosts, and Prefect Cloud starts free with a team tier at $100 per seat monthly.
4.2pts
Service Overview
Prefect is a workflow orchestration platform built for Python. Adding flow and task decorators to functions produces schedulable units with state, retries, logs and concurrency control, so existing scripts do not need rewriting into DAG configuration first. It targets analytics, scraping, ETL and internal batch teams whose code already works locally and lacks scheduling, failure handling and run records.
The core is Apache-2.0 and can be self-hosted. Prefect Cloud has four tiers: free Hobby, Starter, Team and Enterprise, with Hobby including two users and five deployments. Execution is described by work pools, which point at local processes, Docker, Kubernetes or platform-provided serverless capacity.
Key Strengths
- Decorators turn existing Python functions into flows and tasks, so migration changes a few lines, not the architecture.
- Work pools abstract the compute layer, letting one flow run on local processes, containers or a Kubernetes cluster.
- State, logs and retry history persist per run, and failed steps rerun on their own within the retention window.
- Blocks store credentials and connection settings centrally, and code references block names instead of secrets.
- The Apache-2.0 core self-hosts without caps on flows or runs, leaving only infrastructure cost.
Limitations
- Hobby allows two users, five deployments and seven days of run history, so production usually needs a paid tier.
- Team bills $100 per user per month, which grows quickly with headcount and does not map to concurrency.
- Self-hosting means operating the API, the database and worker processes; serverless capacity is cloud-only.
- There is no enforced dependency graph, so cross-flow dependencies rely on triggers or external coordination.
- A mismatched work pool leaves runs queued with no worker to pick them up, which needs queue-level debugging.
Product Ecosystem
Prefect separates code from execution: flows and tasks describe logic, deployments declare schedules and parameters, and work pools declare compute. With the three decoupled, moving between environments does not require code changes.
Flows, tasks and state
A flow is the orchestration entry point and tasks are independently retried substeps. Tasks carry caching and concurrency limits by default, and states move from scheduled to completed with a full transition record. Retries use exponential backoff declared on the decorator.
Deployments and schedules
A deployment pairs a runnable with a schedule, declared in prefect.yaml or created in code with .serve() and .deploy(). Schedules support cron, intervals and event triggers, run parameters override at deployment level, and code upgrades require redeploying to refresh the version snapshot.
Work pools and workers
Work pools come as process, Docker, Kubernetes and serverless push types, and a worker polls its pool for queued runs. Self-hosted teams run workers on their own machines or clusters, while cloud plans can use serverless capacity metered in minutes.
Blocks and automations
Blocks hold credentials, connection strings and notification settings, referenced by name and encrypted by the platform. Automations react to flow state events, such as alerting on failure or starting a downstream flow, so alerting logic is not duplicated in every flow.
Observability and troubleshooting
Each run records a state timeline, logs and retry counts, filterable by deployment or tag. Runs that queue without starting usually mean no worker is available for the pool; the callback debugging approach in webhook signature verification helps isolate whether the problem sits at the trigger or the worker.
Use Cases
- Good fit|Teams with many Python scripts: decorators add scheduling while credentials move into blocks.
- Good fit|Analytics and scraping batches: task-level retries and run records cover most failure modes.
- Good fit|Compute that must move between hosts: the same flow runs on local, container or cluster workers.
- Good fit|Teams that keep data in-house: self-hosted API and database can stay inside the intranet.
- Evaluate|Business teams needing drag-and-drop: the editor is Python-first with limited canvas work.
- Evaluate|Collaboration beyond eight people: the Team tier caps seats, larger setups need a contract.
- Evaluate|Complex cross-flow topologies: dependencies rely on triggers or external coordination.
Pricing & Billing Selection
The four cloud tiers differ in users, deployments, serverless allowance and governance; prices are fixed per tier, with Team charged per seat.
| Plan | Reference price | Included quota | Key capabilities |
|---|---|---|---|
| Hobby | free | 2 users, 5 deployments, 500 serverless minutes, 7-day run retention | flow scheduling, logging and alerts, base observability |
| Starter | $100/month | 3 users, 20 deployments, 75 serverless hours, 1,250 API calls per minute | bring your own compute, webhook triggers |
| Team | $100 per user per month | 4 to 8 users, 100 deployments, 225 serverless hours | service accounts, 24-hour audit log |
| Enterprise | annual contract | unlimited deployments; workspaces and seats per contract | SAML and OIDC SSO, RBAC and access control, multiple workspaces, SCIM sync, IP allowlist and PrivateLink |
| Open-source self-hosted | free software | unlimited users, deployments and runs; you fund the API, database and workers | Apache-2.0 licence, the same decorators and deployment code as cloud |
Serverless allowance is metered in minutes and suits low-frequency or bursty work; steady high-frequency jobs fit better on workers in your own infrastructure, with the cloud handling orchestration and observability.
FAQ
- How much do existing scripts change? Add a flow decorator to the entry function and task decorators to substeps; signatures and return values stay the same. Credentials move into blocks, scheduling and parameters go into the deployment, and execution becomes an observable deployment run instead of a manual invocation.
- What happens if the work pool is wrong? Runs sit in a pending state without an error, because no worker picks them up. Check the work pool named by the deployment, whether any worker in that pool is online, whether the queue is paused, and finally whether the worker can reach the API with valid credentials.
- What has to be operated when self-hosting? An API service, a PostgreSQL database and at least one worker process, plus a reverse proxy and object storage as needed. Serverless capacity is cloud-only, so self-hosted teams provision their own execution environment sized by concurrent runs.
- How long are runs retained? Hobby keeps seven days, paid tiers extend by contract, and Team adds a 24-hour audit log. For long-term needs, export key metrics to your own storage or upgrade the tier, so historical states remain available during incident work.
- Can the cloud tier run without serverless capacity? Yes. Starter and above allow workers on your own servers or Kubernetes clusters, so the cloud handles scheduling, state and observability while compute cost returns to your hardware; outbound access and credentials from worker to cloud still need configuration.
Integration & Code Examples
Define a flow with tasks and register a deployment
from prefect import flow, task
from prefect.blocks.system import Secret
@task(retries=3, retry_delay_seconds=30)
def fetch_orders(day: str) -> list[dict]:
# in a real project read credentials from a block, then call the upstream API
token = Secret.load("orders-api-token").get()
return [{"id": "A1001", "day": day}]
@flow(log_prints=True)
def sync_orders(day: str = "2026-11-30") -> int:
rows = fetch_orders(day)
print(f"{day}: fetched {len(rows)} orders")
return len(rows)
if __name__ == "__main__":
# register a deployment with a daily schedule
sync_orders.serve(name="sync-orders-daily", cron="0 2 * * *")
Trigger and inspect runs from the CLI
# start a local worker that pulls from this pool
prefect worker start --pool local-process
# trigger a run now with a parameter override
prefect deployment run "sync-orders-daily/sync-orders-daily" --param day=2026-11-29
# list recent run states and logs
prefect flow-run ls --limit 5
Deployment names combine flow and deployment names, so schedule changes touch the deployment, not the business code.
Community & Resources
- Prefect website — positioning, capabilities and customer stories
- Pricing — Hobby, Starter, Team and Enterprise quotas
- Documentation — flows, deployments, work pools and self-hosting
- GitHub repository — Apache-2.0 source, issues and releases
- Integrations — database, cloud and notification libraries
- Discussions — usage questions and feature talks
Articles
- 01 Video SEO for Google Search and YouTube 07-18
- 02 Triggered Email Design: Events, Eligibility, and Frequency 07-18
- 03 Online Form Builder Comparison 11-26
- 04 Cold email costs: volume, warm-up and re-domaining 07-18
- 05 Email Bounce Causes and Responses 07-18
- 06 E-Signature and Contract Cost Structure 07-18
- 07 Choosing Free Mailbox and Sending Quotas 11-26
- 08 Community Forum Ownership: Hosted Service or Own Server 11-26
- 09 Cookie Consent Platform Selection 11-26
- 10 Choosing Team Messaging for China-Based Teams 11-26