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

# CoordinationConfig

> Interface exported by @botmesh/core.

Defined in: [coordination/types.ts:194](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L194)

`BotConfig.coordination`: run this bot as one of N replicas. Omit it for a single
process (the default; nothing below runs).

## Properties

### coordinator

```ts theme={null}
coordinator: Coordinator;
```

Defined in: [coordination/types.ts:196](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L196)

The backend shared by the replicas (`RedisCoordinator`, or `MemoryCoordinator` for one process).

***

### turnWaitMs?

```ts theme={null}
turnWaitMs?: string | number;
```

Defined in: [coordination/types.ts:202](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L202)

Longest a message waits for its chat's turn: a duration (`'2m'`) or ms. When it
runs out the message is dropped and reported as a [CoordinationUnavailableError](https://botmesh.afaya.com.co/api/core/classes/CoordinationUnavailableError.md)
(`'timeout'`). Default `'2m'`.

***

### settleMs?

```ts theme={null}
settleMs?: string | number;
```

Defined in: [coordination/types.ts:211](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L211)

Longest the chat's turn stays held after the handler returned, waiting for a
conversation step it fed (an answered `c.ask`, a `c.goto()` target) to reach its next
wait or end, so no other replica processes the chat meanwhile. A step still running
then (a slow `.do()`, a long `c.sleep` or delay) is stopped, keeping its checkpoint,
before the turn is released: a persistent flow re-runs that step on the chat's next
message. Set it above your longest step. Default `'1m'`.

***

### providerDownMs?

```ts theme={null}
providerDownMs?: string | number;
```

Defined in: [coordination/types.ts:217](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L217)

With `providerSession: 'leader'`: how long the leader's transport may stay
`'closed'` (logged out, session taken over, reconnect given up) before the replica
steps down so a standby connects instead. Default `'1m'`.

***

### providerSession?

```ts theme={null}
providerSession?: "leader" | "shared" | "auto";
```

Defined in: [coordination/types.ts:227](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L227)

Who connects the transport:

* `'leader'` — only the replica holding the `provider:<id>` leadership starts the
  provider; the others stand by and take over when it is lost;
* `'shared'` — every replica starts it (webhook transports, each replica receives
  part of the traffic);
* `'auto'` (default) — `'leader'` when `provider.capabilities.exclusiveSession`,
  else `'shared'`.

***

### handover?

```ts theme={null}
handover?: ConversationHandoverConfig;
```

Defined in: [coordination/types.ts:233](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L233)

What happens to a chat's live conversation when another replica takes the chat (the
replica holding it crashed, was stopped for a deploy, or lost its turn). Default
`{ flows: 'drop', fallback: 'drop' }`: only `.persistent()` flows continue there.


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