Write context
A Write context step saves facts about a customer, a case or a conversation, so later conversations on any channel can use them. You can let the values expire and choose whether to overwrite what is already there.
When to use it
Section titled “When to use it”- Save the preferred language a customer chose on a call.
- Store the claim number once a claim is created, for follow-up chats.
- Record a promise-to-pay date for 30 days.
When not to use it
Section titled “When not to use it”- The value is only needed in this run. Use Data mapper.
- You are recording consent. Use Consent.
- You need audit evidence. Use Audit checkpoint.
Settings
Section titled “Settings”| Setting | What it does |
|---|---|
| Values | Required. Key and expression pairs. |
| Scope | customer (default), case or conversation. |
| Whose context | An expression, for example input.customerRef. Empty uses the run’s correlation key for the scope. |
| Keep for | A duration. Empty keeps the value until it is overwritten. |
| When a value exists | overwrite (default) or keep_existing. |
What it produces
Section titled “What it produces”- A single Next.
- The values in the shared context, and also in this run’s data as
data.<key>.
If there is no customer, case or conversation to store against (no Whose context and no matching correlation key), the run fails, as this step has no error path.
Example
Section titled “Example”An insurer remembers a new claim for follow-up conversations.
MCP tool (create claim, store as claim) → Write context (claimNumber = data.claim.number, keep 90d) → Send message → End