Build a Durable Chargeback Review Workflow on Telnyx Edge
Description and use
A durable chargeback review workflow on Telnyx Edge using durable actors, Decision Models, and SMS notifications.
Problem
Chargeback handling requires persistent state, timed decisions, evidence evaluation, customer communication, and audit trail across restarts.
Outcome
The workflow ensures durable, consistent chargeback adjudication with automated evidence evaluation, scheduled decisions, and auditability.
Workflow
- Receive webhook at POST /webhook/chargeback
- Validate payload (disputeId, customer, orderId)
- Create or retrieve durable actor via idFromName(disputeId)
- Store case state and seed evidence tables
- Schedule decision task with stable ID
- Aggregate evidence and context
- Send single Decision Models request with choice, score, and noul questions
- Apply business policy: approve, request evidence, deny, or route to human review
- Send SMS updates or log in demo mode
- Persist audit ledger entries
- Handle retries via stable task IDs
Evidence
A chargeback is not a single API request. It is a case that can remain open for days while evidence arrives, deadlines approach, and a reviewer decides what should happen next.
The sample combines: One Stateful Actor per dispute, Telnyx Decision Models for structured evidence evaluation, Scheduled tasks for decision and response deadlines, SQL for evidence, review queues, and an append-only audit ledger, SMS for customer updates and reviewer escalation.
Stable task IDs are useful when webhook delivery or application logic retries. Repeated work can converge on the same scheduled operation instead of creating a new timer every time.
- Record date: 2026-10-02T22:55:52.722Z