prefect

PrefectHQApache-2.0活跃维护

用 Python 编排数据管道的工作流框架,带重试、调度和可观测性,让数据与 ML 流水线在生产环境稳定跑起来。

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.

3.9.2发布于 2026-11-06 21:19 UTC24,147star +16 / 7 天2,649fork同步于 2026-11-10 17:23 UTC

怎么上手

由 README 提炼,执行前请确认
pip install -U prefect
prefect server start
硬件要求按 README 说明

README 未说明,仅要求 Python 3.11+,未提及 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Python 装饰器把脚本变成生产级数据流水线的编排框架

用 Python 编排数据管道的工作流框架,带重试、调度和可观测性,让数据与 ML 流水线在生产环境稳定跑起来。

核心能力

  • 用 @flow 和 @task 装饰器把普通脚本改造成工作流
  • 内置调度、缓存、重试与事件驱动自动化
  • 用 .serve() 把流程发布为带 cron 调度的部署
  • 自托管 Prefect server 或 Prefect Cloud 追踪并监控运行
  • 提供轻量 prefect-client 供临时执行环境访问服务端

容易踩的坑

需 Python 3.11 及以上版本;本地 UI 默认监听 http://localhost:4200;若只需连接 Cloud 或远程 server,可改用更轻量的 prefect-client

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本3.9.2
  1. 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 🐞

  2. 3.9.2.dev63.9.2.dev6: Nightly Development Releasepre-release2026-11-06 · 2026-11-06 08:12 UTC
    查看更新说明

    What's Changed

    Bug Fixes 🐞

    Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev5...3.9.2.dev6

  3. 3.9.2.dev53.9.2.dev5: Nightly Development Releasepre-release2026-11-05 · 2026-11-05 08:13 UTC
    查看更新说明

    What's Changed

    Enhancements ➕➕

    Bug Fixes 🐞

    Development & Tidiness 🧹

    Documentation 📓

    Uncategorized

    New Contributors

    Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev4...3.9.2.dev5

  4. 3.9.2.dev43.9.2.dev4: Nightly Development Releasepre-release2026-11-04 · 2026-11-04 08:12 UTC
    查看更新说明

    What's Changed

    Documentation 📓

    Uncategorized

    New Contributors

    Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev3...3.9.2.dev4

  5. 3.9.2.dev33.9.2.dev3: Nightly Development Releasepre-release2026-11-03 · 2026-11-03 08:12 UTC
    查看更新说明

    What's Changed

    Enhancements ➕➕

    Bug Fixes 🐞

    Development & Tidiness 🧹

    Uncategorized

    Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.9.2.dev2...3.9.2.dev3

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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.