Skip to content

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.

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

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