Webhooks

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.

stripe
signed
/api/hook
forward
slack

Install

$ npx khotan add pass <source> <destination>

Variants

Named run modes, each independently schedulable with onError/onComplete hooks. The variant name is the mode — flow code branches on ctx.variant. Click a variant above to see the flow change, then select one when triggering.

await khotanData.flow('pass').start({ variant: 'normal' })
import { pass, type PassContext } from "./pass";
import { plug } from "../plugs/plug";
async function stripeToSlackWorkflow(ctx: PassContext) {
"use workflow";
async function forwardEvent() {
"use step";
// destVars are auto-injected from the destination plug's encrypted vars
const slackPlug = plug({
name: "slack",
baseUrl: "https://hooks.slack.com",
authType: "bearer",
auth: { bearer: { token: ctx.destVars["token"] ?? "" } },
});
await slackPlug.post("/services/webhook", {
body: {
text: `Received ${ctx.eventType} from stripe`,
event: ctx.event,
},
});
}
await forwardEvent();
}
export const stripeToSlack = pass({
name: "stripe-to-slack",
to: "slack", // ← name of the destination plug
workflow: stripeToSlackWorkflow,
});

Documentation

See the full integration guide — schema, generated files, helper API, and configuration — in the Pass docs.