How auzzton/recovery_razorpay works
RecoveryOS turns failed-payment webhooks into guarded, cost-weighted recovery workflows: AI triage chooses outreach or capture retry, replies and scheduled checks advance auditable FSM states, and a dashboard reports recovery and counterfactual ROI. The README documents the integrations and capabilities; sampled excerpts confirm key orchestration, client, database and UI paths, but not every scheduler, guard or dispatch implementation detail, so uncertain internal links are omitted.
Main entry points: main.py API orchestrator · App.jsx Dashboard app · outreach_dispatcher.py Outreach dispatcher · llm_provider.py AI decision engine
Components 22
Recovery workflow
- API orchestrator
backend/app/main.py - Compliance guards
backend/app/guards.py - Workflow FSM
backend/app/fsm.py - Promise date parser
backend/app/date_parser.py - API models
backend/app/models.py
Decision and delivery
- AI decision engine
backend/app/llm_provider.py - Outreach dispatcher
backend/app/outreach_dispatcher.py - Email service
- Twilio
- Capture client
backend/app/razorpay_client.py - Gemini
State and persistence
- Recovery database
backend/db/database.py - Ledger schema
backend/db/schema.sql
Merchant dashboard
- Dashboard app
frontend/src/App.jsx - Workflow table
frontend/src/components/WorkflowTable.jsx - Reply simulator
frontend/src/components/ReplySimulator.jsx - Audit drawer
frontend/src/components/AuditDrawer.jsx - ROI metrics
frontend/src/components/CounterfactualPanel.jsx
Other components
- Merchant
- Customer
- Scheduler
- Razorpay webhook
Connections 22
- Razorpay webhook → API orchestrator: posts failure
- API orchestrator → Compliance guards: checks compliance
- API orchestrator → AI decision engine: requests triage
- AI decision engine → Gemini: optional inference
- API orchestrator → Workflow FSM: transitions state
- API orchestrator → Outreach dispatcher: dispatches reminders
- Outreach dispatcher → Email service: sends email
- Outreach dispatcher → Twilio: sends messages
- Customer → API orchestrator: replies by webhook
- API orchestrator → Promise date parser: parses promises
- Scheduler → API orchestrator: runs recovery checks
- API orchestrator → Capture client: retries capture
- Capture client → Razorpay webhook
- API orchestrator → Recovery database: reads and writes
- Recovery database → Ledger schema: initializes from
- Merchant → Dashboard app: views recovery
- Dashboard app → API orchestrator: requests dashboard data
- Dashboard app → Workflow table: renders workflows
- Dashboard app → Reply simulator: renders reply tools
- Dashboard app → Audit drawer: opens audit
- Dashboard app → ROI metrics: renders ROI
- Reply simulator → API orchestrator: submits reply