# Your Durable Function runs many times

> The orchestrator body re-executes from line one, over and over, until every step is answered.

- **Format:** short video, 8 steps, ~22 seconds
- **Topic:** How Azure Durable Functions replay your orchestrator code
- **Author:** Suthahar Jegatheesan (MSDEVBUILD)
- **Category:** Azure · Azure
- **Tags:** azure, dotnet, serverless, durablefunctions, azurefunctions, cloudcomputing, softwareengineering, systemdesign, csharp, devcommunity, msdevbuild
- **Canonical URL:** https://blog.msdevbuild.com/shorts/azure-durable-functions-replay/

---
## What you'll learn

- Why an orchestrator body re-executes from line one, many times
- How completed activities are answered from the event history
- Why DateTime.Now and Guid.NewGuid break a Durable Function

## Understand it one step at a time

### 1. It did not run once

Your orchestrator function executes again and again. You only ever see the final result.

### 2. It looks like normal code

Three awaits, top to bottom. Nothing here hints that it gets re-executed.

### 3. It stops at the first await

The runtime schedules the activity, then the function exits completely. No thread waits around.

### 4. The result lands in history

When the activity finishes, its output is appended to an event history in storage.

### 5. Then it runs again

From line one. This time the first await returns instantly from history instead of calling anything.

### 6. One step deeper each time

Every completed activity extends the history, so each replay gets further before it stops.

### 7. This is why DateTime breaks

Anything non-deterministic returns a new value on every replay, so your code stops matching history.

### 8. Keep the replay invisible

Use the context APIs for time and GUIDs, and the whole re-execution stays hidden from you.

---

## The takeaway

**Your orchestrator is a replay engine**

The code reads top to bottom. Underneath, it re-runs from line one until every await has an answer.
