[API reference](https://evolu.dev/docs/api-reference) › [@evolu/nodejs](https://evolu.dev/docs/api-reference/nodejs) › createRun

```ts
const createRun: CreateRun<RunDeps & ShutdownDep>;
```

Defined in: [nodejs/src/Task.ts:54](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/nodejs/src/Task.ts#L54)

Creates [Run](https://evolu.dev/docs/api-reference/common/Task/interfaces/Run) for Node.js with global error handling and graceful
shutdown.

Registers `uncaughtException` and `unhandledRejection` handlers that log
errors and initiate graceful shutdown. Adds a `shutdown` promise to deps that
resolves on termination signals (`SIGINT`, `SIGTERM`, `SIGHUP`). Handlers are
removed when the Run is disposed.

### Example

```ts
const deps = { ...createRelayDeps(), console };

await using run = createRun(deps);
await using stack = new AsyncDisposableStack();

stack.use(await run.orThrow(startRelay({ port: 4000 })));

await run.deps.shutdown;
```