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

# registerWorkflows

> Set your project's workflows and send them to Nelkap.

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
nelkap.registerWorkflows(workflows: Workflow[]): void
```

## Parameters

**workflows** `Workflow[]` *required*

Every workflow of your project. Nelkap makes this list the project's workflows: see [Workflows](https://docs.nelkap.com/concepts/workflows.md#your-list-is-the-projects-list).

**Workflow**

**name** `string` *required*

The workflow's name, unique within the list. Up to 256 characters.

**handler** `WorkflowHandler` *required*

The workflow function. It takes the run's payload.

**events** `string[]`

The events that start a run. Up to 100, each up to 256 characters.

**cron** `string`

A schedule in five fields, in UTC, like `0 9 * * 1`.

**concurrency** `number`

How many runs of the workflow go at once, from 1 to 500.

## Behavior

* The list goes to Nelkap right away. `run` and `emit` wait until it has arrived.
* If it can't be sent, the next `run` or `emit` sends it again, and throws if that fails too.
* Calling `registerWorkflows` again replaces the list.

## Errors

Thrown by the next `run` or `emit`:

| Code | When |
| - | - |
| `badRequest` | The list breaks a rule above, like two workflows with the same name or a wrong cron. |
| `workflowLimitReached` | The list has more workflows than your plan allows per project. |

## Example

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
nelkap.registerWorkflows([
  { name: 'onboardUser', handler: onboardUser, events: ['user.created'] },
  { name: 'sendWeeklyReport', handler: sendWeeklyReport, cron: '0 9 * * 1' },
  { name: 'importContacts', handler: importContacts, concurrency: 5 },
]);
```


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