# Saga compensating actions design pattern

DevFeed: [Saga compensating actions design pattern](<https://devfeed.tech/articles/saga-compensating-actions-design-pattern-35761.md>)

Original publisher: [Read original article](<https://temporal.io/blog/compensating-actions-part-of-a-complete-breakfast-with-sagas>)

Author: Emily Fortuna

Published: 2023-05-02T07:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>), [Microservice](<https://devfeed.tech/topics/microservice.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Java](<https://devfeed.tech/topics/java.md>), [Python](<https://devfeed.tech/topics/python.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>)

Tags: [consistency](<https://devfeed.tech/tags/consistency.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [go](<https://devfeed.tech/tags/go.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [long-running](<https://devfeed.tech/tags/long-running.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [python](<https://devfeed.tech/tags/python.md>), [rollback](<https://devfeed.tech/tags/rollback.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

This tutorial explains the compensating actions design pattern for handling failures in distributed systems. It describes how services can perform forward operations and, when a later step fails, execute application-defined compensating actions to undo earlier state changes without restoring an entire database snapshot. It also explains how to implement the pattern in Temporal using Go, Java, Python, or TypeScript.

## Source excerpt

An explanation of the Compensating Actions design pattern and how to implement it in Temporal using Go, Java, Python, or TypeScript.