THIS HAS BEEN MOVED TO OFFICIAL PREFECT DOCUMENTATION AND IS OUT OF DATE: https://docs.prefect.io/v3/tutorials/modal


Prefect is the worlds best orchestrator. Modal is the worlds best serverless compute framework. It only makes sense that they would fit together perfectly.

In this short guide, we’ll walk you through building your first prefect deployment that runs on modal every hour, and build out a scalable framework to grow your project.

You can see all the functioning code here: https://github.com/Ben-Epstein/prefect-modal

We’ll walk step-by-step through the following:

  1. Create a prefect account
  2. Create a modal account
  3. Create your github repo
  4. Give prefect access to your github repo
  5. Connect prefect and modal
  6. Configure CI/CD

Let’s quickly look at an architecture diagram of what we’re building.

image.png

We’ll be building a full serverless infrastructure framework for scheduling and provisioning workflows. GitHub will act as the source of truth, Prefect will be our orchestrator, and Modal will be our serverless infrastructure, paying for only the CPU time we use.

Let’s quickly recap on some important terms: