[Sample Request] Payment workflow with idempotency, state machine, and compensation flow
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- backend, distributed-systems
Research direction
Start by reading the existing HelloSaga and MoneyTransfer samples to understand how SAGA and compensation are demonstrated. Define the sample around the requested seven states, idempotency handling, retry backoff, and child-workflow compensation; it is done when one cohesive payment workflow demonstrates all four behaviors.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 258
- Forks
- 189
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from temporalio/samples-java
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
temporalio/samples-java#749 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
temporalio/samples-java#687 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
temporalio/samples-java#635 · 1 comment ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
temporalio/samples-java#606 · 4 reactions ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
temporalio/samples-java#597 ·
All issues in temporalio/samples-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100