handle answers Nelkap before the workflow runs, three settings make sure your runs get the time they need.
Keep the work going after the response
Pass Vercel’swaitUntil to handle, so the function keeps running until the workflow’s call ends. In Next.js, use after:
app/api/nelkap/route.ts
waitUntil from @vercel/functions. Each framework page shows the exact route.
Give long steps the time they need
A function on Vercel runs for a limited time, set by your plan and by the route’smaxDuration. When a call reaches that limit, the steps already saved are kept, and Nelkap calls your app again about five minutes later to go on from there. So a long run is fine: it simply takes several calls.
A single step, though, must finish within one call. If a step can take longer than the default, raise the route’s limit, in seconds, within what your plan allows:
app/api/nelkap/route.ts
Set your environment variables
AddNELKAP_API_KEY and NELKAP_SECRET to your Vercel project’s environment variables, for each environment that runs workflows. Vercel applies them to the next deployment, so deploy again after adding them.
Production
Set your production project’s endpoint to your production domain, likehttps://your-app.com/api/nelkap. A custom domain stays the same from one deployment to the next, so the endpoint never needs to change.
Preview deployments
Every preview deployment gets its own URL, but a Nelkap project has a single endpoint. To run workflows on previews, give them a project of their own, like a staging project:- Create a staging project in your workspace.
- Set its endpoint to the URL of the branch you deploy for testing, like
https://your-app-git-staging-your-team.vercel.app/api/nelkap. That URL always points to the branch’s latest deployment. - Add the staging project’s API key and secret to your Vercel project’s Preview environment.
Deployment Protection
When Deployment Protection covers your previews, Vercel turns Nelkap’s calls away too, since they come without a sign-in. To let them through, create a secret under Protection Bypass for Automation in your Vercel project, and add it to the end of your staging endpoint, as?x-vercel-protection-bypass=your-bypass-secret.
Nelkap calls the URL exactly as you set it, so the secret travels with every call.