get_conversation_notes
Read the internal notes already on the conversation.
get_conversation_notes(context: dict) -> listReturns every internal note on the conversation, newest first.
Parameters
| Name | Type | Description |
|---|---|---|
context | dict | The context object passed to your action |
Returns
list of dict, each with:
| Field | Type | Description |
|---|---|---|
id | str | Note ID |
text | str | Note body |
createdAt | str | ISO 8601 timestamp |
authorType | str | user, api, or automation |
authorName | str | The agent's name for user notes, otherwise a label from authorType |
Returns an empty list in test/mock environments.
Examples
Avoid writing the same note twice
def handle_event(context):
notes = get_conversation_notes(context)
if any("Escalated to the web team" in note["text"] for note in notes):
return {"skipped": "already escalated"}
add_conversation_note(context, "Escalated to the web team.")Give the AI what agents already wrote
def execute_action(context):
notes = get_conversation_notes(context)
agent_notes = [n["text"] for n in notes if n["authorType"] == "user"]
return {"internal_context": agent_notes[:5]}