0PricingLogin
Azure Fundamentals · Lesson

Durable Functions for Stateful Workflows

Orchestrate long-running workflows using Durable Functions orchestrator patterns (fan-out/fan-in, chaining, monitor), and understand how state is checkpointed.

Why Durable Functions?

Regular Azure Functions are stateless — each invocation runs independently with no memory of previous calls. Durable Functions extend Azure Functions with the ability to write stateful, long-running workflows using plain async/await code. The Durable Task Framework automatically checkpoints state to Azure Storage after each step, so workflows can survive server restarts, timeouts, or planned maintenance and resume exactly where they left off.

The Three Function Types

Durable Functions introduces three function types. An orchestrator function coordinates the overall workflow — it calls activity functions and waits for results using yield or await without actually blocking a thread. An activity function performs a single unit of work (call an API, write to a database) and is the only place side effects should occur. An entity function maintains small pieces of durable state (counters, flags) across calls.

// Client function (HTTP trigger) — starts the orchestration
module.exports = async function (context, req) {
  const client = df.getClient(context);
  const orderId = req.body.orderId;
  const instanceId = await client.startNew('OrderOrchestrator', undefined, { orderId });
  return client.createCheckStatusResponse(context.bindingData.req, instanceId);
};

All lessons in this course

  1. Azure Functions Triggers and Bindings
  2. Durable Functions for Stateful Workflows
  3. Azure Logic Apps
  4. Event Grid and Event-Driven Architecture
← Back to Azure Fundamentals