Skip to content

Welcome to Prefect

Prefect enables you to build and observe resilient data workflows so that you can understand, react to, and recover from unexpected changes. It's the easiest way to transform any Python function into a unit of work that can be observed and orchestrated. Just bring your Python code, sprinkle in a few decorators, and go!

With Prefect you gain:

Trying to implement these features from scratch is a huge pain that takes time, headaches, and money. That's why Prefect offers all this functionality and more!

screenshot of Cloud UI timeline view with menu

Prefect UI

New to Prefect?

If you're ready to dive in and learn Prefect, check out the Prefect concepts and try some tutorials to see how they work in action.

For deeper dives on specific topics, explore our guides for common use-cases.

Concepts Tutorials Guides

Or, read on for a quick sample of Prefect.


Quick Start: Hello Prefect

Install Prefect with

pip install -U prefect

See the install guide for more detailed instructions.

Run a basic flow

Import flow and decorate your Python function using the @flow decorator.

from prefect import flow

@flow
def my_favorite_function():
    print("What is your favorite number?")
    return 42

print(my_favorite_function())

Thats it! Your function is now a flow. Run the code as you normally would, and you'll see its execution via the Prefect logs:

$ python hello_prefect.py
15:27:42.543 | INFO    | prefect.engine - Created flow run 'olive-poodle' for flow 'my-favorite-function'
15:27:42.543 | INFO    | Flow run 'olive-poodle' - Using task runner 'ConcurrentTaskRunner'
What is your favorite number?
15:27:42.652 | INFO    | Flow run 'olive-poodle' - Finished in state Completed()
42

Prefect automatically persists all executions of your flow along with useful metadata such as start time, end time, and state. This is just the beginning, so keep exploring to learn how to add retries, notifications, scheduling and much more!

Next Steps

To learn more, try our tutorials and guides, or go deeper with Prefect concepts.

Need help?

Get your questions answered with a Prefect product advocate by Booking A Rubber Duck!


Community


Changing from 'Orion'

With the 2.8.1 release, we removed references to "Orion" and replaced them with more explicit, conventional nomenclature throughout the codebase. These changes clarify the function of various components, commands, and variables. See the Release Notes for details.

Looking for Prefect 1 Core and Server?

Prefect 2 is now available for general use. See our Migration Guide to move your flows from Prefect 1 to Prefect 2.

Prefect 1 Core and Server documentation is available at http://docs-v1.prefect.io/.