nelkap.handle. This section shows how to add that route in your framework, from the keys to your first run.
Choose your framework
Next.js
A route handler in the App Router.
React Router
A resource route, in framework mode.
SvelteKit
A
+server.ts endpoint.Nuxt
A server route in the
server folder.Astro
An endpoint rendered on demand.
Hono
A route on a Hono app running on Node.js.
Express
A route that turns Express’s request into a standard one.
Other frameworks
nelkap.handle takes a standard web Request and returns a standard Response. Any framework that gives you the incoming request in that form works the same way: add a POST route, and return what handle returns.
How handle works
Each call from Nelkap carries the workflow to run, the run’s payload, and the steps already saved. handle then does three things:
- It checks that the call carries your project’s secret. If it doesn’t, it answers
401, and nothing runs. - It looks for the workflow among the ones you registered. If your app doesn’t have it, it answers
404. - It answers
202right away, then runs the workflow in the background, saving each step as it finishes.
Serverless hosts
Hosts like Vercel can stop your code as soon as the response is sent. Sincehandle answers before the workflow runs, the run would stop with it. To keep it going, pass your host’s waitUntil to handle:
waitUntil for its hosts.