Build a Durable Chargeback Review Workflow on Telnyx Edge
Описание и применение
Создан устойчивый рабочий процесс рассмотрения chargeback на Telnyx Edge, использующий долговременные акторы, модели решений и SMS‑уведомления.
Задача
Chargeback handling requires persistent state, timed decisions, evidence evaluation, customer communication, and audit trail across restarts.
Результат
The workflow ensures durable, consistent chargeback adjudication with automated evidence evaluation, scheduled decisions, and auditability.
Рабочий процесс
- 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
Доказательства
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.
- Дата записи: 2026-10-02T22:55:52.722Z