saga

Coordinate distributed transactions across microservices using Saga patterns.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mthang1801/go-domain-driven-design --skill saga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: saga
Source: https://github.com/mthang1801/go-domain-driven-design/tree/main/.claude/skills/saga
Command: npx skills add https://github.com/mthang1801/go-domain-driven-design --skill saga

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating distributed transactions across microservices can be fragile without a formal orchestration pattern. This Skill provides a structured approach to implementing Saga-based workflows using the core abstractions SagaDefinition, SagaStep, and SagaManager, including idempotency, compensation, and strict reply header contracts.

Core Features & Use Cases

  • Orchestrator and steps defined via SagaDefinition and SagaStep with deterministic sequencing.
  • Remote command invocation with compensation handling and eventual consistency across services.
  • Idempotent orchestration with header-driven routing and Kafka-based messaging to coordinate distributed flows.

Quick Start

Create and run a basic OrderPlacementSaga using the example files to validate the end-to-end flow.

Frequently Asked Questions about saga

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I orchestrate distributed transactions across microservices using the Saga pattern?

Distributed transactions are orchestrated by defining deterministic sequences of remote steps using SagaDefinition and SagaStep, ensuring eventual consistency across services with explicit compensation handling and idempotent workflows.

What is the best way to handle compensating actions in a Kafka-based distributed workflow?

Compensating actions in a Kafka-based distributed workflow are handled by enforcing strict reply header contracts for routing, allowing the SagaManager to execute explicit rollback steps and achieve eventual consistency across microservices.

How does idempotency work in DDD saga orchestration?

Idempotency in DDD saga orchestration is managed through header-driven routing and Kafka-based messaging, ensuring that remote command invocations and compensating actions can be safely retried without duplicate side effects.

Can I use this Saga orchestration approach for long-running workflows with Kafka?

Yes, this approach supports long-running workflows by utilizing Saga core abstractions like SagaManager and SagaStep, integrating Kafka-based messaging to coordinate distributed flows and remote command invocations across microservices.

Do I need SagaDefinition and SagaStep to coordinate distributed transactions?

Yes, SagaDefinition and SagaStep are required core abstractions for coordinating distributed transactions, providing deterministic sequencing and explicit compensation handling to maintain eventual consistency across services.

When should I not use Saga orchestration for distributed transactions?

Saga orchestration may be unsuitable if your distributed transactions require strict ACID guarantees rather than eventual consistency, or if your microservices architecture lacks Kafka-based messaging and strict reply header contracts.