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

# Separate customer conversations

> Keep follow-ups together and customers apart.

This guide uses the [Messaging relay](/docs/guides/channels/messaging) to separate customer conversations.

## Before you begin

Start with an installed [Messaging platform relay](/docs/guides/channels/messaging), two authorized test customers and its private persistent data directory. You need access to the selected Voiceflow project and Environment. This guide uses the supplied relay’s session policy.

## Separate the conversation state

### 1. Confirm the identity boundary

The sample’s `sessionID()` hashes this tuple; keep every component:

```js
[platform, destinationAccount, thread, sender, voiceflowProject, environmentAlias]
```

The result is a 64-character Voiceflow `userID`. Provider IDs are opaque strings. Do not replace them with display names or combine people across platforms based on a claimed email address.

| Destination | Thread boundary in this example |
| --- | --- |
| WhatsApp, Messenger, Instagram, LINE, Viber | Customer within the selected business destination. |
| Telegram | Private chat and sender within the bot. |
| Slack | DM channel and sender, with separate memory for each reply-thread root. |
| Teams | Tenant, bot, personal conversation and sender. |
| Discord | Application, server/channel and invoking user; a thread has its own channel ID. |
| WeChat / Apple | Provider app, conversation and contact/user. |
| RCS | Agent and sender phone number. |

The exact receive-field mapping remains in the installation manual.

### 2. Reuse the returned session key

The relay creates a [Voiceflow session](/docs/api-reference/agent-runtime/chat) once, stores its `sessionKey`, launches it once and reuses it for text turns. Starting a new session for the same user/release supersedes the prior session. Do not create a session per message or share one session key across customers.

Inspect `state.json` only in a private environment. `sessions[KEY].token` is a credential; the operator `inspect` command reports job IDs and keys without printing it. Keep the state directory on persistent disk across restarts, with one writer.

### 3. Choose the reset and release policy

An `end` trace clears the stored token after its reply is accepted. A later message starts a new conversation. If the runtime reports an inactive/expired session, the sample pauses rather than guessing whether to restart; reconcile that failed turn before resetting.

For an intentional fresh conversation, stop the relay service and run:

```sh
node --env-file=.env relay.mjs inspect
node --env-file=.env relay.mjs reset KEY
```

Replace `KEY` with the reported 64-character key. Reset removes the local token and leaves the customer paused. Resolve obsolete queued/failed jobs, then run `resume KEY` and restart the service. This does not delete Voiceflow transcripts or provider history.

Changing the configured Environment produces a different key. A saved session is not automatically migrated to a newly published release. Drain/reconcile the old route before starting fresh sessions on the new one; keep a backup for rollback.

## Verify isolation and recovery

### 1. Check two customers

Customer A asks about returns and follows up with “What about sale items?” Customer B starts a different question. A should retain its subject; B must not inherit it. Check the platform replies and Voiceflow Transcripts, rather than only the hashed keys.

### 2. Check a restart and a reset

Restart without deleting the data directory and repeat A’s follow-up. Then perform the explicit reset and confirm a new conversation starts. If your agent’s session timeout has elapsed, expect a paused job requiring reconciliation. Duplicate delivery of one event must not create another turn.

### Each message starts over

Check persistence and session creation frequency.

Confirm the service uses the same `DATA_DIR` and Environment, and that only one process writes it. Keep session creation out of the per-message path. Check the selected agent’s idle-timeout settings; a provider thread can outlive a Voiceflow session.

### Two people share context

Restore the full account, thread and sender boundary.

Pause the affected route, correct the tuple, and start fresh isolated sessions after reconciling pending work. Review any improperly shared transcripts under your data policy. A hash conceals an identifier’s spelling; it does not repair an incomplete identity boundary.
