Every primitive you need to move data.
12 components across webhooks, flows, ETL, and AI. Every one shares the same lifecycle: extract → transform → load → backfill → observe.
Clients
Set up an authenticated, typed client for an external service. The foundation other components wire into.
State
Durable runtime state for snapshots, cursors, and dedupe markers that survive retries and future runs.
Webhooks
Wire into a service, then catch or pass what it throws at you. Signed, idempotent, DB-backed.
Wire
Wire your app to a service. Programmatically registers webhook subscriptions via the source service's API (Stripe, Linear, Pollinate). Backend tracks state in your DB and always points subscriptions at the catch-all route `/api/khotan/webhook/:plugName`, where Catch and Pass handlers fan out internally.
Catch
Catch a webhook event and write it to your Postgres. Verified signature, durable Vercel Workflow execution, automatic run tracking. Each catch handler is persisted to `khotan_webhook_handlers` and every execution creates a `khotan_runs` entry with the Workflow run ID for traceability. Tracked in the standard `khotan_runs` table — status, durations, batch counts, create/update/delete/fail tallies, plus a metadata JSON for component-specific stats. Toggle off with --no-runs.
Pass
Catch a webhook event and pass it through to another service. Verified inbound, durable Vercel Workflow delivery, destination variables auto-injected from the target plug's encrypted vars. Tracked in `khotan_webhook_handlers` and `khotan_runs` with the Workflow run ID. Tracked in the standard `khotan_runs` table — status, durations, batch counts, create/update/delete/fail tallies, plus a metadata JSON for component-specific stats. Toggle off with --no-runs.
Flows
Extract, transform, load — three variants. Same shape, different directions.
Inflow
External service → your Postgres. Pull data from a SaaS API on a schedule, transform it, and load it into your Drizzle tables. Declare named variants (run modes) — each with its own optional cron schedule and onError/onComplete hooks — and branch on `ctx.variant` (e.g. `delta`, `full`, `healthcheck`). Tracked in the standard `khotan_runs` table — status, durations, batch counts, create/update/delete/fail tallies, plus a metadata JSON for component-specific stats. Toggle off with --no-runs.
Outflow
Your Postgres → external service. Push computed audiences, scores, or enrichments out to Salesforce, HubSpot, Intercom. Replaces what people used to call reverse ETL. Declare named variants (run modes), each independently schedulable with onError/onComplete hooks, and branch on `ctx.variant`. Tracked in the standard `khotan_runs` table — status, durations, batch counts, create/update/delete/fail tallies, plus a metadata JSON for component-specific stats. Toggle off with --no-runs.
Relay
External service → external service. Transit data between two SaaS systems, optionally transforming on the way. Useful when one service needs another's data without staging it in your DB. Declare named variants (run modes), each independently schedulable with onError/onComplete hooks, and branch on `ctx.variant`. Tracked in the standard `khotan_runs` table — status, durations, batch counts, create/update/delete/fail tallies, plus a metadata JSON for component-specific stats. Toggle off with --no-runs.
Dashboards
Drop-in UI for inspecting and controlling what khotan is doing inside your app.
Hub
A config card that lists every configured Flow (Inflow, Outflow, Relay) with a toggle and a manual trigger. Backed by the standard `khotan_flows` table — one row per configured flow, 1:M with `khotan_runs`. Webhooks live separately under Plug; this card is for scheduled and on-demand flows.
Mapping Browser
A reusable client-side mappings manager for browsing one resource at a time, searching by canonical connect value, and creating, editing, or deleting shared identity rows without mixing refs into metadata.
Runs
A shadcn-style data table of every run from every Catch, Pass, Inflow, Outflow, and Relay. Each row shows its `variant` (run mode) and `source` (scheduled | manual | webhook) alongside stats (extracted, transformed, created, updated, deleted, failed, duration) and an expandable step-by-step trace. Filterable by component, status, and time. Reads from the standard `khotan_runs` table.
Plug Debugger
Lightweight Postman for your plugs. Endpoint sidebar with click-to-load, path param interpolation, Zod schema display, git-diff style response validation, request history, copy-to-clipboard, and auto-format. Fires through the real plug code path (auth, retry, hooks). Gated behind `KHOTAN_DEBUG` — zero production footprint.