Getting Started

Payment Workflows & Financial Processing


Payment processing is where durable execution matters most — a crashed server mid-charge can mean a customer charged twice, an order stuck in limbo, or revenue lost to unreconciled transactions. Orcher journals every task's result, so a completed charge, refund or inventory operation is never repeated when a run recovers; the tasks pass idempotency keys so a retry after a crash can't repeat them either.

Charged once

The nightmare scenario is a crash in the gap between charging the card and recording that you did. With journaled tasks the gap doesn't exist for the workflow: once charge_payment completes, its result is in the journal, and no replay will ever run it again.

Crash After the Charge
✓
charge_payment$49.00 captured — journaled
✗
server crashesBefore the confirmation email
↻
replaycharge_payment returns the journaled charge — card not touched
✓
send_confirmationResumes at the next unfinished step
The customer is charged once — no matter when or how often the process dies.

Rollback is a flow, not a scramble

Multi-step money movement fails halfway: the charge succeeded, but inventory is gone or the shipping service is down. The saga pattern gives every step a compensating action, and the workflow runs them in reverse — automatically, with the same durability as the forward path.

Saga Compensation
✓
charge_paymentCompleted — journaled
✓
reserve_inventoryCompleted — journaled
✗
create_shipmentFails — retries exhausted
↺
release_inventoryCompensation — reverses step 2
↺
refund_paymentCompensation — reverses step 1
Compensations are journaled tasks too — a crash mid-rollback resumes the rollback.

Waiting on the outside world

Payments rarely finish in one pass. A transaction may pause for a fraud analyst's verdict, a webhook from the payment provider, or a 3-day retry schedule — and a workflow waiting on an event or timer is fully suspended, holding no resources until the answer arrives. See Fraud Detection for event gates with timeouts and Subscription Billing for retry schedules that span days.

And because every step is journaled with its inputs, outputs, and timing, the journal is a record of what each payment did, produced by running it rather than by a separate logging system.


Patterns