---
title: "Workflow Foundations"
description: "Learn the foundations of the Workflow SDK by building a pizza order tracker. Durable, resumable code with two directives and no state machines."
canonical_url: "https://vercel.com/academy/workflow-foundations"
md_url: "https://vercel.com/academy/workflow-foundations.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-06-06T02:43:30.864Z"
content_type: "course"
lessons: 13
estimated_time: 
lesson_urls:
  - "https://vercel.com/academy/workflow-foundations/set-up-the-pizza-tracker.md"
  - "https://vercel.com/academy/workflow-foundations/send-a-confirmation-email.md"
  - "https://vercel.com/academy/workflow-foundations/wrap-it-in-a-workflow.md"
  - "https://vercel.com/academy/workflow-foundations/deploy-to-vercel.md"
  - "https://vercel.com/academy/workflow-foundations/add-the-kitchen-step.md"
  - "https://vercel.com/academy/workflow-foundations/pause-between-steps-with-sleep.md"
  - "https://vercel.com/academy/workflow-foundations/complete-the-happy-path.md"
  - "https://vercel.com/academy/workflow-foundations/pause-until-the-kitchen-pings-us.md"
  - "https://vercel.com/academy/workflow-foundations/hook-the-driver-into-the-flow.md"
  - "https://vercel.com/academy/workflow-foundations/what-if-the-kitchen-never-responds.md"
  - "https://vercel.com/academy/workflow-foundations/the-kitchen-is-flaky.md"
  - "https://vercel.com/academy/workflow-foundations/some-failures-are-final.md"
  - "https://vercel.com/academy/workflow-foundations/observe-everything.md"
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Workflow Foundations

You've built it before. A signup flow that needs to send an email today and a follow-up next week. An order tracker that has to wait for the kitchen, then the driver, then a delivery confirmation. You reach for `setTimeout`, then realize serverless kills your function. You build a cron job. You add a database table to track state. You write retry logic.

Three days later you have a brittle pile of code that breaks every time you deploy.

This course teaches you how to build that same feature with the Workflow SDK: durable, resumable code that survives deploys, retries automatically, and waits for hours or days without consuming a single millisecond of compute. No new DSL. No state machines. Just async TypeScript with two new directives.

## What You'll Build

A pizza order tracker. A customer places an order, a workflow walks it through the kitchen and the driver via real webhooks, retries flaky steps automatically, escalates if the kitchen goes dark, and sends a "rate your pizza" email after delivery. By the end you'll have a working app deployed to Vercel with real Resend emails firing and the real Workflows dashboard showing every run.

## What You'll Learn

- Why durable workflows exist and when to reach for one
- The two directives that turn regular async functions into durable workflows
- How to sequence steps, pause for hours or days, and survive deploys mid-execution
- How to wait on real-world events with hooks
- How retries work and how to opt out for fatal errors
- How to debug workflows in the Vercel dashboard

## Prerequisites

- Comfort with Next.js App Router (Route Handlers, Server Components, basic Server Actions)
- TypeScript basics (`async`/`await`, type annotations)
- A Vercel account
- A Resend account (free tier is fine)
- Node 20+ and pnpm installed

You don't need prior experience with queues, cron jobs, or state machines. If anything, the less of that you've used, the easier this will be.

## Course Sections

**Section 1: Your First Workflow.** Set up the pizza tracker, write your first step and workflow, and deploy. By the end of this section you've shipped a one-step workflow to Vercel and watched it run in the dashboard.

**Section 2: Multi-Step Orders.** Stack on more steps and introduce `sleep()` to model cook time. Deploy a code change mid-workflow and watch it survive. By the end of this section the tracker walks an order through every state from confirmed to delivered.

**Section 3: Waiting for the Real World.** Replace the fake sleeps with real external events. Hooks let the workflow pause until the kitchen or driver actually pings us. By the end the workflow is fully event-driven and handles an unresponsive kitchen gracefully.

**Section 4: When Things Go Wrong.** Production isn't kind. Steps fail, services flake, payments decline. This section walks through automatic retries, fatal errors, and the dashboard tools that make production debugging livable.

Let's order a pizza.


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
