Automation Roadmap
Automation as a strategic asset. Every automation is either reducing operational cost, improving user experience, or enabling scale. This page maps what runs without human intervention today and what's planned next.
Automation maturity
| Stage | What it means |
|---|---|
| Manual | Human does every step |
| Scripted | Tool exists, human triggers |
| Scheduled | Runs on cron, human reviews output |
| Event-driven | Triggered by platform events automatically |
| Self-healing | Detects own failures and recovers |
Already automated ✅
Order lifecycle
| Automation | Trigger | What happens |
|---|---|---|
| Auto-cancel unpaid orders | 12hr timer on AWAITING_PAYMENT | Move to CANCELLED, notify buyer |
| Auto-mark late shipments | 2-day timer on READY_TO_SHIP | Move to LATE_TO_SHIP, notify ops |
| Auto-confirm delivered orders | 24hr timer on DELIVERED | Move to COMPLETED, trigger disbursement |
| Auto-approve low-value returns | RETURN_REQUESTED + item under IDR 50k | Skip seller approval, refund buyer |
Payment processing
| Automation | Trigger | What happens |
|---|---|---|
| Webhook idempotency | Duplicate webhook | Returns original outcome, no double-processing |
| Amount mismatch detection | Xendit webhook | Move to PAYMENT_REVIEW, alert ops |
| Auto-disbursement queue | Order completes | fin_disbursement row created with pending status |
Communications
| Automation | Trigger | What happens |
|---|---|---|
| Order confirmation email | Payment confirmed | Send via Resend |
| KTP status notification | Ops decision | Email user via Resend |
| Push notification on new chat | Chat message received | Send push to recipient |
| Marketing broadcast | Campaign scheduled in ops | Bulk email + push at trigger time |
Background processing
| Automation | Trigger | What happens |
|---|---|---|
| OutboxProcessor | Every 15 minutes | Retry failed side effects |
| Webhook retry | Failed webhook | Retry with exponential backoff |
| Stale listing detection | Daily | Flag listings unsold > 30 days |
| Seller score recomputation | Weekly | Update seller_scores based on activity |
Anti-fraud
| Automation | Trigger | What happens |
|---|---|---|
| Duplicate listing detection | Listing creation | Compare against existing, flag if duplicate |
| Suspicious review flagging | Review submission | Flag if buyer-seller transact within 2 days |
| Rate limiting | Per-IP request count | Block if exceeds threshold |
| KTP OCR | KTP submission | Extract data, queue for ops review |
In progress 🟡
| Automation | Status | Blocker |
|---|---|---|
| HMAC shipping quote signing | env var set, signer/verifier pending | Implementation |
| Returns reverse label generation | Spec'd, not built | Build effort |
| Cuan AI bot | Designed | Build effort |
| Sentry error tracking | Library available, not integrated | Setup |
Planned 🔵
Pre-launch priorities
1. Sentry integration
Why: Indonesian C2C users don't report crashes, they uninstall. Without APM, first prod crash is found by user complaint.
What it enables:
- Real-time error alerting
- Crash reproduction
- Performance monitoring
- Release tracking
2. Xero sync (real implementation)
Why: Accounting compliance and audit-ready financials.
What it replaces: Current placeholder boolean flag.
3. Reverse Biteship label
Why: Returns flow can't fully automate without auto-generated return labels.
What it enables: Buyer ships back via Biteship aggregation, picks cheapest option, label generated in-app.
Post-launch roadmap
4. Automated dispute resolution suggestions
Why: Reduce ops time per dispute.
What it does: AI analyzes evidence, suggests resolution to ops admin. Admin approves or overrides. Builds training data over time.
5. Smart pricing suggestions
Why: Help sellers set competitive prices.
What it does: Suggest price range based on similar items, brand, condition, recent sales.
6. Listing quality scoring
Why: Surface improvement opportunities to sellers.
What it does: Score listings on photo count/quality, description detail, completeness. Suggest specific improvements.
7. Personalized recommendations (SekenPulse)
Why: Increase buyer return rate and basket size.
What it does: ML-based feed personalization, "you might like" suggestions, abandoned cart recovery.
8. Automated content moderation
Why: Scale moderation without growing ops team linearly.
What it does: AI pre-screens listings for banned content, surfaces high-confidence rejections to ops for batch processing.
9. Seller onboarding sequences
Why: Improve activation rate from current goal of >60% within 7 days.
What it does: Drip email + push sequence based on onboarding progress (KTP submitted, first listing, first sale, etc.)
10. Fraud pattern detection
Why: Catch fraud before it scales.
What it does: Real-time pattern matching on:
- Same device fingerprint across multiple accounts
- Accounts that only buy high-resale-value items
- Buyer + seller sharing IP
- Velocity anomalies
Where automation creates leverage
Three categories of leverage:
1. Cost reduction
Automate things ops staff currently does manually.
High-leverage targets:
- Listing moderation (current: manual review of every listing)
- KTP review (current: manual review post-OCR)
- Dispute resolution (current: manual case-by-case)
2. User experience improvement
Make the platform feel faster, smarter, and more responsive.
High-leverage targets:
- Personalized feed (vs. recency-only)
- Smart search with synonyms
- Real-time pricing suggestions
- Abandoned cart recovery
3. Scale enablement
Things that work at 100 users but break at 100,000.
High-leverage targets:
- Search infrastructure (current: in-memory filter, breaks at 50k listings)
- Notification batching (current: per-event sends)
- Analytics aggregation (current: real-time queries)
- Image storage and CDN
Automation principles
1. Reversible by default
Every automation must have a manual override. Ops can always intervene.
2. Observable
Every automation logs to audit_log with input, output, and decision rationale.
3. Bounded
Every automation has explicit guardrails. Auto-approve refunds capped at IDR 50,000. Auto-cancel only after 12 hours, never sooner.
4. Tested
Every automation has integration tests covering happy path, failure modes, and edge cases.
5. Gradual rollout
New automations start in shadow mode (logs decision but doesn't act), then partial rollout (e.g., 10% of cases), then full rollout.
Where to look in the codebase
| What you want | Where it lives |
|---|---|
| Cron jobs | supabase/functions/cron/ |
| OutboxProcessor | infrastructure/reliability/OutboxProcessor.ts |
| State machine timers | domain/order/timers/ |
| Auto-approve policy | domain/order/policies/LowValueAutoApproval.ts |
| Fraud detection | domain/fraud/ |
Next: Scalability →