---
title: "What is a Saga?"
description: "A saga is a multi step transaction with automatic rollback. If any step fails, all previously completed steps are undone via compensation actions. Multi step operations can fail partway through: Sagas automatically undo "
resource: https://www.aiagents.nexus/docs/manual/sagas/what-is-a-saga
generated: { by: "process:nexus-agent-assets", at: 2026-09-07T09:13:03Z }
status: stable
---

# What is a Saga?

A saga is a multi-step transaction with automatic rollback. If any step fails, all previously completed steps are undone via compensation actions.

## The Problem

Multi-step operations can fail partway through:

```
Step 1: Reserve inventory  ✓
Step 2: Charge payment     ✓
Step 3: Ship order         ✗ (fails!)

Result: Payment charged but order not shipped!
```

## The Solution

Sagas automatically undo completed steps:

```
Step 1: Reserve inventory  ✓
Step 2: Charge payment     ✓
Step 3: Ship order         ✗ (fails!)

Compensation:
  Undo Step 2: Refund payment  ✓
  Undo Step 1: Release inventory  ✓

Result: System back to original state
```

## Key Properties

| Property | Description |
|----------|-------------|
| Steps | Ordered list of actions |
| Compensations | Undo action for each step |
| Execution | Forward (step by step) |
| Rollback | Reverse (compensation by compensation) |
| Checkpoints | Resume from last successful step |
