Where do Kapso functions run?
On Cloudflare Workers. Kapso wraps your code, calls handler(request, env), and gives each project its own KV namespace and D1 database.
Look up an order, book a slot, or update your CRM in the middle of a WhatsApp conversation. Write the logic in JavaScript, and Kapso runs it for you.
async function handler(req, env) {
const { order_id } = (await req.json()).execution_context.vars
const order = await fetch(`${env.API_URL}/orders/${order_id}`).then(r => r.json())
return Response.json({ vars: { eta: order.eta } })
}
On Cloudflare Workers. Kapso wraps your code, calls handler(request, env), and gives each project its own KV namespace and D1 database.
Add them as secrets on the function page after you deploy it. Secrets are encrypted, never shown again after you save them, and your code reads them as env.NAME.
Yes. A deployed function has an invoke URL, https://api.kapso.ai/platform/v1/functions/{function_id}/invoke. It is private by default and needs your X-API-Key header. Make the endpoint public to call it without a key.
Yes. Add it as a function tool on an agent. The agent decides when to call it, and your handler reads the arguments it chose from body.input.