需 Python 3.11 及以上版本;本地 UI 默认监听 http://localhost:4200;若只需连接 Cloud 或远程 server,可改用更轻量的 prefect-client
prefect
PrefectHQApache-2.0活跃维护用 Python 编排数据管道的工作流框架,带重试、调度和可观测性,让数据与 ML 流水线在生产环境稳定跑起来。
Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
pip install -U prefect
prefect server startREADME 未说明,仅要求 Python 3.11+,未提及 GPU 或显存要求
用 Python 装饰器把脚本变成生产级数据流水线的编排框架
用 Python 编排数据管道的工作流框架,带重试、调度和可观测性,让数据与 ML 流水线在生产环境稳定跑起来。
核心能力
- 用 @flow 和 @task 装饰器把普通脚本改造成工作流
- 内置调度、缓存、重试与事件驱动自动化
- 用 .serve() 把流程发布为带 cron 调度的部署
- 自托管 Prefect server 或 Prefect Cloud 追踪并监控运行
- 提供轻量 prefect-client 供临时执行环境访问服务端
容易踩的坑
- 3.9.23.9.2 - It’s okay to let go of a lock that already let go of you最新正式版2026-11-06 · 2026-11-06 21:19 UTC
3.9.2 - It’s okay to let go of a lock that already let go of you
Released on November 06, 2026
Enhancements ➕➕
Bug Fixes 🐞
- Render list-of-lists table artifacts in
ArtifactDataViewby @devin-ai-integration[bot] in #23359 - Preserve datetime instants when changing timezone by @ashutosh8021 in #23682
- Show an invalid name error from
prefect deploymentcommands for malformed names by @LuisFigueroaG in #23680 - Fix
[object Object]displayed in parameters fields by @uinstinct in #23723 - Align positional-only argument defaults in source-parsed signatures by @udsy19 in #23428
- Preserve
init=Falsedataclass fields invisit_collectionby @Kayvan-Zahiri in #23270 - Release async-acquired locks in
RedisLockManager.release_lockby @devin-ai-integration[bot] in #23654 - Keep recent runs visible in V2 deployment activity charts by @devin-ai-integration[bot] in #23640
- Drop task run events for missing flow runs instead of failing the batch by @devin-ai-integration[bot] in #23664
- Don't crash completed runs when lease renewal gets 410 after terminal state by @devin-ai-integration[bot] in #23659
- Replace stuck readiness tasks when a poll would mark something ready by @devin-ai-integration[bot] in #23644
- Return 422 instead of 503/500 for invalid values in request bodies by @devin-ai-integration[bot] in #23619
- Preserve literal artifact content in CLI JSON output by @RoryGlenn in #23692
- Preserve literal markup and emoji aliases in all CLI JSON/YAML output by @devin-ai-integration[bot] in #23695
- Fix v1 UI ignoring
PREFECT_SERVER_UI_SHOW_PROMOTIONAL_CONTENTby @devin-ai-integration[bot] in #23710 - Accept the same flow state hook signatures in the engine and the runner by @CassianoE in #23715
- Keep deployment schedule parameter overrides on partial schedule updates by @devin-ai-integration[bot] in #23719
- Tolerate release of expired locks in
MemoryLockManagerandFileSystemLockManagerby @Wilson0511 in #23725 - Keep inherited sync client open for tasks submitted via
ThreadPoolTaskRunnerby @devin-ai-integration[bot] in #23749 - Fall back to UTC when the browser reports no t
- Render list-of-lists table artifacts in
- 3.9.2.dev63.9.2.dev6: Nightly Development Releasepre-release2026-11-06 · 2026-11-06 08:12 UTC
查看更新说明
What's Changed
Bug Fixes 🐞
- Stop flow run heartbeats before proposing a terminal state by @chrisguidry in https://github.com/PrefectHQ/prefect/pull/23784
Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev5...3.9.2.dev6
- 3.9.2.dev53.9.2.dev5: Nightly Development Releasepre-release2026-11-05 · 2026-11-05 08:13 UTC
查看更新说明
What's Changed
Enhancements ➕➕
- Only write deployments that a poll actually changes by @chuqCTC in https://github.com/PrefectHQ/prefect/pull/23130
Bug Fixes 🐞
- Accept the same flow state hook signatures in the engine and the runner by @CassianoE in https://github.com/PrefectHQ/prefect/pull/23715
- Keep deployment schedule parameter overrides on partial schedule updates by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23719
- Tolerate release of expired locks in MemoryLockManager and FileSystemLockManager by @Wilson0511 in https://github.com/PrefectHQ/prefect/pull/23725
- Add coverage and protocol docs for releasing expired locks by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23726
- Keep inherited sync client open for tasks submitted via
ThreadPoolTaskRunnerby @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23749 - Fall back to UTC when the browser reports no time zone in ui-v2 by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23738
- Fix
GitRepository.pull_code()ignoringdirectorieschanges on an existing sparse checkout by @CassianoE in https://github.com/PrefectHQ/prefect/pull/23712 - Preserve JSON Schema references in flow parameters by @ska2704 in https://github.com/PrefectHQ/prefect/pull/23432
- Disable Rich markup by default in
exit_with_errorby @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23763 - Fix IndexError in
prefect block type inspect/lson empty description by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23762 - Fix 500 from flow run resume when run input has an integer beyond 64 bits by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23617
- Treat database and connection pool timeouts as client retryable exceptions by @Tyagiquamar in https://github.com/PrefectHQ/prefect/pull/23741
Development & Tidiness 🧹
- Stop credential-obfuscation git clone tests from hitting GitHub by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23660
Documentation 📓
- docs: note init=False dataclass fields keep resolved values in tasks by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23764
Uncategorized
- fix: object object displayed in parameters fields by @uinstinct in https://github.com/PrefectHQ/prefect/pull/23723
- Bump @vitest/mocker and vitest in /ui by @dependabot[bot] in https://github.com/PrefectHQ/prefect/pull/23717
- Collect the valid-username test in prefect-bitbucket by @dylanpulver in https://github.com/PrefectHQ/prefect/pull/23689
- Show an invalid name error from
prefect deploymentcommands for malformed names by @LuisFigueroaG in https://github.com/PrefectHQ/prefect/pull/23680 - fix(callables): align positional-only arg defaults in source-parsed signatures by @udsy19 in https://github.com/PrefectHQ/prefect/pull/23428
- Preserve init=False dataclass fields in visit_collection by @Kayvan-Zahiri in https://github.com/PrefectHQ/prefect/pull/23270
- Tidy up GitHub Actions workflows by @gaker in https://github.com/PrefectHQ/prefect/pull/23761
- Drop two asserts that cannot run inside pytest.raises blocks by @dylanpulver in https://github.com/PrefectHQ/prefect/pull/23760
- Bump pydocket to >=0.27.2 by @chrisguidry in https://github.com/PrefectHQ/prefect/pull/23729
New Contributors
- @Wilson0511 made their first contribution in https://github.com/PrefectHQ/prefect/pull/23725
- @dylanpulver made their first contribution in https://github.com/PrefectHQ/prefect/pull/23689
- @Kayvan-Zahiri made their first contribution in https://github.com/PrefectHQ/prefect/pull/23270
Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev4...3.9.2.dev5
- 3.9.2.dev43.9.2.dev4: Nightly Development Releasepre-release2026-11-04 · 2026-11-04 08:12 UTC
查看更新说明
What's Changed
Documentation 📓
- docs: send referrers on outbound links and add missing page descriptions by @madureira-gabriel in https://github.com/PrefectHQ/prefect/pull/23728
Uncategorized
- chore(deps): Update github actions by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23699
New Contributors
- @madureira-gabriel made their first contribution in https://github.com/PrefectHQ/prefect/pull/23728
Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev3...3.9.2.dev4
- 3.9.2.dev33.9.2.dev3: Nightly Development Releasepre-release2026-11-03 · 2026-11-03 08:12 UTC
查看更新说明
What's Changed
Enhancements ➕➕
- chore(deps): Update Node.js by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23705
Bug Fixes 🐞
- Preserve literal markup and emoji aliases in all CLI JSON/YAML output by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23695
- Fix v1 UI ignoring
PREFECT_SERVER_UI_SHOW_PROMOTIONAL_CONTENTby @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23710
Development & Tidiness 🧹
- Fix flaky server signal forwarding tests by using OS-assigned ports by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23716
- Fix flaky
FlowRunCardtest by trimming generated flow run names in ui-v2 mocks by @devin-ai-integration[bot] in https://github.com/PrefectHQ/prefect/pull/23713
Uncategorized
- chore(deps): Update actions/github-script action to v9 by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23702
- chore(deps): Update dependency postcss-selector-parser to v7 by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23703
- chore(deps): Update dependency ruff to v0.17.2 by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23697
- chore(deps): Update docker images by @prefect-renovate[bot] in https://github.com/PrefectHQ/prefect/pull/23698
- Bump pyasn1 from 0.6.4 to 0.6.5 by @dependabot[bot] in https://github.com/PrefectHQ/prefect/pull/23708
- Bump follow-redirects from 1.16.1 to 1.16.2 in /ui by @dependabot[bot] in https://github.com/PrefectHQ/prefect/pull/23707
Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev2...3.9.2.dev3
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Prefect
Prefect is a workflow orchestration framework for building data pipelines in Python. It's the simplest way to elevate a script into a production workflow. With Prefect, you can build resilient, dynamic data pipelines that react to the world around them and recover from unexpected changes.
With just a few lines of code, data teams can confidently automate any data process with features such as scheduling, caching, retries, and event-based automations.
Workflow activity is tracked and can be monitored with a self-hosted Prefect server instance or managed Prefect Cloud dashboard.
[!TIP] Prefect flows can handle retries, dependencies, and even complex branching logic
Check our docs or see the example below to learn more!
Getting started
Prefect requires Python 3.11+. To install the latest version of Prefect, run one of the following commands:
pip install -U prefect
uv add prefect
Then create and run a Python file that uses Prefect flow and task decorators to orchestrate and observe your workflow - in this case, a simple script that fetches the number of GitHub stars from a repository:
from prefect import flow, task
import httpx
@task(log_prints=True)
def get_stars(repo: str):
url = f"https://api.github.com/repos/{repo}"
count = httpx.get(url).json()["stargazers_count"]
print(f"{repo} has {count} stars!")
@flow(name="GitHub Stars")
def github_stars(repos: list[str]):
for repo in repos:
get_stars(repo)
# run the flow!
if __name__ == "__main__":
github_stars(["PrefectHQ/prefect"])
Fire up a Prefect server and open the UI at http://localhost:4200 to see what happened:
prefect server start
To run your workflow on a schedule, turn it into a deployment and schedule it to run every minute by changing the last line of your script to the following:
if __name__ == "__main__":
github_stars.serve(
name="first-deployment",
cron="* * * * *",
parameters={"repos": ["PrefectHQ/prefect"]}
)
You now have a process running locally that is looking for scheduled deployments! Additionally you can run your workflow manually from the UI or CLI. You can even run deployments in response to events.
[!TIP] Where to go next - check out our documentation to learn more about:
Work with your agent
Use the agent setup guides to connect your agent to Prefect through plugins or MCP and get started with the CLI. An agent-readable setup index provides the guides as plain text.
Prefect Cloud
Prefect Cloud provides workflow orchestration for the modern data enterprise. By automating over 200 million data tasks monthly, Prefect empowers diverse organizations — from Fortune 50 leaders such as Progressive Insurance to innovative disruptors such as Cash App — to increase engineering productivity, reduce pipeline errors, and cut data workflow compute costs.
Read more about Prefect Cloud here or sign up to try it for yourself.
prefect-client
If your use case is geared towards communicating with Prefect Cloud or a remote Prefect server, check out our prefect-client. It is a lighter-weight option for accessing client-side functionality in the Prefect SDK and is ideal for use in ephemeral execution environments.
Connect & Contribute
Join a thriving community of over 25,000 practitioners who solve data challenges with Prefect. Prefect's community is built on collaboration, technical innovation, and continuous improvement.
Community Resources
🌐 Explore the Documentation - Comprehensive guides and API references
💬 Join the Slack Community - Connect with thousands of practitioners
🤝 Contribute to Prefect - Help shape the future of the project
🔌 Support or create a new Prefect integration - Extend Prefect's capabilities
📋 Tail the Dev Log - Prefect's open source development blog
Stay Informed
📥 Subscribe to our Newsletter - Get the latest Prefect news and updates
📣 X and Bluesky - Latest updates and announcements
📺 YouTube - Video tutorials and webinars
📱 LinkedIn - Professional networking and company news
Your contributions, questions, and ideas make Prefect better every day. Whether you're reporting bugs, suggesting features, or improving documentation, your input is invaluable to the Prefect community.