How Prefect Works
Transform Python functions into orchestrated workflows with a single decorator. Your code and data stay in your infrastructure—Prefect manages scheduling, observability, and state.
Step 1
Transform Python functions into flows
Add the @flow decorator to any Python function. No YAML, no complex DSLs—just Python. Your code remains readable and testable while gaining orchestration capabilities.
View quickstart guideStep 2
Deploy from your terminal
Deploy workflows from your own infrastructure using the Prefect CLI. You control where code lives and how it runs. Workers execute in your environment with full access to your resources.
Your workers poll our API—no inbound connections to your network
Prefect Cloud's hybrid architecture means your code and data never leave your infrastructure. Workers poll Prefect for scheduled runs, then execute workflows locally with direct access to your databases and services.
No inbound connections
Your firewall rules stay locked down
Data stays local
Direct access to your databases
Metadata only
Logs and state, never your data
Step 3
Workers execute flows in your environment
When it's time to run, workers in your infrastructure gather code, prepare resources, and execute flows. All execution happens locally—Prefect receives only logs and state updates for observability.
Step 4
Break flows into observable tasks
Decompose complex workflows into independently tracked tasks using the @task decorator. Get granular observability and retry logic for each step without exposing your data—only execution metadata reaches Prefect.
Try Prefect Cloud freeStep 5
Automatic state tracking and retries
Prefect manages flow run states and directs automatic retries on failure. Your workflows become resilient without custom error handling. State transitions and logs flow to Prefect—your actual data remains in your infrastructure.
Python-native workflows. Your infrastructure. Managed orchestration.
Start with Prefect Cloud's free tier or install self-hosted—both give you the same Python-first experience with your code and data staying exactly where you need them.