Skip to content

[Sample Request] Payment workflow with idempotency, state machine, and compensation flow #770

@yashwardhan17

Description

@yashwardhan17

Hi, I'd like to contribute a new sample demonstrating a production-grade payment workflow pattern.

What it would cover:

  • 7-state payment state machine (INITIATED → VALIDATING → PROCESSING → COMPLETED / FAILED / CANCELLED / COMPENSATING)
  • Idempotency key deduplication before any state mutation
  • Exponential backoff with jitter on retries
  • Compensation flow as a child workflow on failure

Why it's useful:
The existing HelloSaga and MoneyTransfer samples demonstrate SAGA and basic compensation, but none show the full combination of idempotency + state machine transitions + compensation in a single cohesive example. This pattern is extremely common in fintech/payment backends.

Happy to submit a PR if this is welcome. Let me know if there's a preferred package structure or naming convention I should follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions