> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nelkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Serve your workflows

> Give Nelkap a route to call your app.

Nelkap sends a POST request to your endpoint for each run that is due. Pass it to `nelkap.handle`:

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { nelkap } from './nelkap';

export const handleNelkap = async (request: Request): Promise<Response> => {
  return nelkap.handle(request);
};
```

Serve this function as a POST route at your endpoint.

## What handle does

1. It checks that the request carries your project's secret. If not, it answers 401.
2. It finds the workflow among the ones you registered. If it's not there, it answers 404.
3. It answers 202 at once, and runs the workflow in the background.

## Hosts that stop after the response

Some hosts stop all work once the response is sent. Pass their `waitUntil`, and the run goes on until it finishes or pauses:

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export const handleNelkap = async (
  request: Request,
  waitUntil: (promise: Promise<unknown>) => void,
): Promise<Response> => {
  return nelkap.handle(request, { waitUntil: waitUntil });
};
```

## What your endpoint needs

* An HTTPS URL on a domain name.
* An answer within 30 seconds, with no redirect.

Nelkap tries each call three times. After that, the run fails.

## Your secret

Nelkap sends your project's secret with every call, and `handle` checks it. If you rotate it, update `NELKAP_SECRET` right away: your endpoint turns calls away until it has the new one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.