Project: Prefect (Orchestration & Management / Scheduling & Orchestration)
File: recipes.md

description: Prefect Recipes provide extensible examples for common Prefect use cases. tags: recipes best practices examples hide: toc search: boost: 2 are common, extensible examples for setting up Prefect in your execution environment with ready-made ingredients such as Dockerfiles, Terraform files, and GitHub Actions. These recipes show you how to deploy a worker, use event-driven flows, set up unit testing, and more. The following recipes are specific to Prefect 2. You can find a full repository of recipes at and additional recipes at . <!-- The code below is a jinja2 template that will be rendered by generate_catalog.py --> <div class="recipe-grid"> {% for collection in collections %} <div class="recipe-item"> <div class="recipe-title"> <a href="{{ collection['recipeUrl'] }}"> <h3 style="margin: 0">{{collection['recipeName']}}</h3> </a> </div> <div class="recipe-desc"> <p> {{ collection["description"] }} </p> </div> <div class="recipe-details"> <p> Maintained by <a href="{{ collection["authorUrl"] }}">{{ collection["author"] }}</a> </p> <p> This recipe uses: </p> <p> {% for icon in collection['iconUrl'] %} <img src="{{ icon }}" > {% endfor %} </p> </div> </div> {% endfor %} </div > We're always looking for new recipe contributions! See the repository for details about how to add your Prefect recipe, share best practices with fellow Prefect users, and earn some swag. provide a vital cookbook where users can find helpful code examples and common steps for specific Prefect use cases. Contribute recipes that other Prefect users could benefit from (for example, a Prefect flow that loads data into Snowflake). Have a blog post, Discourse article, or tutorial youd like to share as a recipe? All submissions are welcome. Clone the prefect-recipes repo, create a branch, add a link to your recipe to the README, and submit a PR. How to create a recipe: <div class="terminal"> ```bash git clone git@github.com:PrefectHQ/prefect-recipes.git cd prefect-recipes git checkout -b newrecipebranch_name ``` </div> . Your code may simply be a copy/paste of a single Python file or an entire folder. If you're unsure where to add your file or folder, add it under the `flows-advanced/` folder. A Prefect Recipes maintainer will help you find the best place for your

To direct others to a project you made, such as a repo or a blogpost, link to it in the . (Optional) Write a . Include a dependencies file, if applicable. Push your code and make a PR to the repository. Easy to understand: Can a user easily follow your recipe? Would a README or code comments help? A simple explanation providing context on how to use the example code is useful, but not required. A good README can set a recipe apart, so we have some additional suggestions for README files below. Code and more: Sometimes a use case is best represented in Python code or shell scripts. Sometimes a configuration file is the most important artifact &mdash; think of a Dockerfile or Terraform file for configuring infrastructure. All-inclusive: Share as much code as you can. Even boilerplate code like Dockerfiles or Terraform or Helm files are useful. Just dont share company secrets or IP. Specific: Don't worry about generalizing your code. Other users will extrapolate their own unique solutions from your example. A thoughtful README can take a recipe from good to great. Here are some best practices for a great recipe README: Provide a brief explanation of what your recipe demonstrates. This helps users determine quickly whether the recipe is relevant to their needs or answers their questions. List which files are included and what each is meant to do. Each explanation can contain only a few words. Describe any dependencies and prerequisites (in addition to any dependencies you include in a requirements file). This includes both libraries or modules and any services your recipe depends upon. If steps are involved or theres an order to do things, a simple list of steps is helpful. Bonus: include troubleshooting steps or tips where other users might get tripped up. We hope youll feel comfortable sharing your Prefect solutions as recipes in the . Collaboration and knowledge sharing are defining attributes of our ! Have questions about sharing or using recipes? Reach out on our active ! Happy engineering!