resonate-saga-pattern-python

Coordinate long-running Python workflows with saga steps and compensations.

6|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-saga-pattern-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resonate-saga-pattern-python
Source: https://github.com/resonatehq/resonate-skills/tree/main/resonate-saga-pattern-python
Command: npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-saga-pattern-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Saga patterns enable durable, multi-step Python workflows by splitting processes into forward steps with compensating actions, ensuring consistency across failures.

Core Features & Use Cases

  • Saga orchestration with forward steps and compensations to restore state after partial failures.
  • Explicit step modeling using SagaStep objects to map forward and backward actions.
  • Robust error handling using try/except and the ability to retry compensations safely.
  • Support for sub-sagas and parallel fan-out while preserving correct compensation sequencing.

Quick Start

Register a saga with @resonate.register and yield ctx.run to execute forward steps while collecting completed steps for compensations.

Frequently Asked Questions about resonate-saga-pattern-python

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

FAQPage Schema
How do I handle partial failures in Python workflows without distributed locks?

A saga pattern coordinates durable Python workflows by pairing forward steps with compensating actions, restoring consistent state after partial failures without requiring distributed locks or two-phase commits.

How do I implement a saga with compensations in Python?

You implement a saga by registering a function with @resonate.register, yielding ctx.run to execute forward steps, and defining explicit SagaStep objects to map backward compensation actions for robust try/except error handling.

Can I retry failed compensations in a durable Python saga?

Yes, durable Python sagas support retryable compensations, allowing you to safely retry backward actions when restoring state after a partial failure in multi-step processes like payments or inventory adjustments.

Does this saga pattern support parallel fan-out and sub-sagas in Python?

Yes, the saga pattern supports sub-sagas and parallel fan-out in Python while preserving correct compensation sequencing, ensuring that backward actions execute in the proper order across nested workflows.

When should I use a saga pattern instead of two-phase commits for multi-step processes?

Use a saga pattern for multi-step processes like order processing requiring eventual consistency across failures, avoiding the distributed locks and blocking coordination overhead inherent to two-phase commits.