Course contentsShow
← Cloud and Infrastructure
Lesson 512 of 2,9899. Serverless ComputeFree lesson

Azure Functions: Durable Functions

Learn stateful function orchestration, fan-out/fan-in patterns, human interaction patterns, and workflow management.

Azure Functions: Durable Functions

What You'll Learn

You'll learn how to build stateful, orchestrated workflows in serverless Azure Functions using Durable Functions.

The Problem with Stateless Functions

Remember that serverless functions are stateless by design—each execution is independent, with no memory of previous runs. But what if you need to coordinate multiple function calls, wait for human approval, or manage a multi-step workflow? Doing this with vanilla functions requires external state stores and complex coordination logic.

What Are Durable Functions?

Durable Functions is an extension of Azure Functions that adds state management and orchestration capabilities. It lets you write workflows as code, where the framework automatically handles state persistence, checkpointing, and replay.

Think of it like a conductor leading an orchestra: individual functions are musicians playing their parts, but the orchestrator function coordinates when each plays, waits for certain sections to finish, and ensures everyone stays in sync—even if the conductor needs to take a break and resume later.

Key Patterns

Orchestration Functions coordinate other functions using simple code that looks synchronous but runs asynchronously:

  • Fan-out/Fan-in: Start multiple functions in parallel, wait for all to complete, then aggregate results (like processing 100 orders simultaneously, then generating a summary report)
  • Human Interaction: Pause a workflow waiting for external approval or input (like waiting for a manager to approve an expense report)
  • Chaining: Execute functions in sequence, passing outputs to inputs
  • Stateful Monitoring: Long-running status checks with timeouts

The framework automatically checkpoints progress, so if a function restarts mid-workflow, it resumes from the last checkpoint without re-executing completed steps.

Key Takeaway: Durable Functions transform stateless Azure Functions into stateful workflow engines, enabling complex orchestration patterns like fan-out/fan-in and human-in-the-loop processes without managing state infrastructure yourself.