> ## 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.

# How it works

> Nelkap calls your app, and your app runs the code.

## Nelkap comes to your app

Your workflows run in your app, on your servers. When a run is due, Nelkap calls your endpoint. The SDK answers at once, then runs the workflow in the background.

## Every step is saved

Each time a step finishes, the SDK sends its result to Nelkap. Nelkap keeps it with the run.

## A run picks up where it stopped

Each call runs your workflow from the top, along with the steps already saved. A saved step returns its result at once, without running again. The code moves past them until it reaches a new step, and carries on from there.

Here is what happens to the `onboardUser` workflow from the [quickstart](https://docs.nelkap.com/quickstart.md):

1. Nelkap calls your app. `profile` runs and is saved. The sleep is saved, and the call ends.
2. A day later, Nelkap calls again. `profile` returns its saved result. The sleep is over. `welcome` runs, and the run completes.

## Pauses end the call

A sleep or a wait ends the call, and your app is free. Nelkap calls again when the time is up, or when the event arrives.

## Nelkap keeps runs going

While a run executes, the SDK tells Nelkap every minute that it's still working. If that signal stops for five minutes, during a crash or a deploy, Nelkap calls your app again. The run picks up from its last saved step.

## Run statuses

| Status | Meaning |
| - | - |
| Pending | Due, and waiting for its turn. |
| Ready | On its way to your app. |
| Running | Your app is running it. |
| Sleeping | Paused until its time is up. |
| Waiting | Paused until its event arrives. |
| Completed | Your workflow finished. |
| Failed | Your workflow threw an error, or Nelkap stopped it. The reason shows on the run's page. |
| Canceled | Canceled before it could finish. |


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