Skip to main content

Overview

What are chat notes?​

Internal notes on a chat. Agents see them in the inbox next to the conversation; the customer never sees them. The bot can create, read, list, edit and delete the notes of the current chat, for example to leave a summary for the agent who takes over.

Notes written by the bot are marked as written by the bot in the inbox. Set customName to show your own name instead (for example Order bot).


1. The five functions​

func_idWhat it does
createNoteAdd a note to the current chat.
getNoteRead one note by its ID. Returns null when it does not exist.
listNotesRead a page of the chat's notes, newest first, with optional author filters.
editNoteReplace the text of a note.
deleteNoteDelete a note.

All five use func_type: chat and work only on the chat the bot is running in.


2. Concepts​

Each node's result lives at %state:node.<node_name>%​

NodeOutput at %state:node.<name>%
createNoteThe created note
getNoteThe note, or null
listNotes{ notes: [...], total: <number>, hasMore: <boolean> }
editNoteThe updated note
deleteNoteNothing is stored

Read fields with the state provider, for example %state:node.save_summary._id%.

The note object​

{
"_id": "6731f0c2a1b2c3d4e5f60718",
"chatId": "67a87067aeed4dee1271cb4d",
"text": "Customer asked for a refund on order 1234",
"messageId": "6731efa0a1b2c3d4e5f60701",
"author": {
"actor": { "type": "system", "component": "bot" },
"customName": "Order bot"
},
"lastEditor": {
"actor": { "type": "system", "component": "bot" }
},
"createdAt": 1762851000000,
"updatedAt": 1762851300000
}
FieldDescription
_idNote ID. Pass it as noteId to getNote, editNote and deleteNote
chatIdThe chat the note belongs to
textThe note text
messageIdThe chat message the note is attached to. Missing when the chat had no messages
authorWho wrote the note. Kept as it is on every edit
author.actorThe author's type: user (an agent, with uid), system with component: bot or component: scenario, or jwt / legacyToken (the API)
author.customNameThe name shown instead of the default author name, when one was set
lastEditorWho made the last edit, same shape as author. Missing on notes that were never edited
createdAt / updatedAtUnix timestamps in milliseconds

Getting a note ID​

  • Right after createNote: %state:node.<create_node>._id%
  • From a list: %state:node.<list_node>.notes.0._id% is the newest note on the page
  • To use the ID in a later bot session, save it on the chat with updateCrmData

Failures​

These go to on_failure: invalid params, an editNote or deleteNote on a note that does not exist, and a messageId that is not in this chat. A missing note in getNote and an empty page in listNotes are not failures unless you set failIfEmpty: true.

Without on_failure, the bot continues to on_complete, so add on_failure whenever the next node depends on the result.

The bot can change any note of the chat

editNote and deleteNote work on every note of the current chat, including notes written by agents. Use IDs that the bot created or selected on purpose.


3. Limits​

LimitValue
Max note text4096 characters
Min note text (bot)1 character
Max customName50 characters, must contain a visible character
Max listNotes page size (limit)1000 (default 100)

Creating, editing or deleting a note also fires the chat note triggers in scenarios.