LinuxCommandLibrary

prefect

Python workflow orchestration platform

TLDR

Start Prefect server

$ prefect server start
copy
Deploy a flow
$ prefect deploy [flow.py:flow_name]
copy
Run a flow locally
$ prefect flow-run create [flow-name]
copy
List deployments
$ prefect deployment ls
copy
Start a worker
$ prefect worker start -p [work-pool]
copy
Create a work pool
$ prefect work-pool create [pool-name] -t [process]
copy
View flow runs
$ prefect flow-run ls
copy
Login to Prefect Cloud
$ prefect cloud login
copy

SYNOPSIS

prefect command [options]

DESCRIPTION

prefect is the CLI for Prefect, a Python workflow orchestration framework. It manages deployments, workers, and infrastructure for running data pipelines.
Flows are Python functions decorated with @flow. prefect deploy packages flows for remote execution with schedules, parameters, and infrastructure settings.
Workers poll work pools and execute flow runs. prefect worker start launches a worker for a specific pool. Work pool types define execution environment: process (local), Docker, or Kubernetes.
prefect server start runs the API server and UI locally. For production, use Prefect Cloud or self-hosted with PostgreSQL. The UI shows flow runs, logs, and task states.
Blocks store configuration like credentials, storage locations, and infrastructure templates. Register blocks with block register and reference them in deployments.

PARAMETERS

-p, --pool name

Work pool name.
-t, --type type
Work pool type: process, docker, kubernetes.
-n, --name name
Deployment or resource name.
--cron schedule
Cron schedule for deployment.
--interval seconds
Interval schedule for deployment.
--limit count
Limit results.

COMMANDS

server start

Start local Prefect server.
deploy path
Deploy a flow.
flow-run create|ls|cancel
Manage flow runs.
deployment ls|run|delete|build|apply
Manage deployments.
worker start
Start a worker process.
work-pool create|ls|delete
Manage work pools.
block register|ls|create
Manage storage and infrastructure blocks.
cloud login|logout|workspace
Prefect Cloud authentication.
profile ls|create|use
Manage configuration profiles.
config set|unset|view
Configuration management.

CAVEATS

Prefect 2.x is significantly different from Prefect 1.x. Workers replace agents from 1.x. Deployments require accessible code (Git, Docker, storage). Cloud features require account.

HISTORY

Prefect was founded by Jeremiah Lowin in 2018 as a modern alternative to Airflow. Prefect 1.0 (2019) introduced the Hybrid model with local execution. Prefect 2.0 (2022) was a complete rewrite emphasizing simplicity with native Python code as workflows. The company offers Prefect Cloud for managed orchestration. Prefect has grown popular for data engineering and ML pipelines.

SEE ALSO

dagster(1), airflow(1), luigi(1), argo(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community