Get Messages
matrix.get_messages
ActionChat & messagingconnection required
Calls the Matrix API with the connection's credentials.
Read a page of a room's timeline, newest first by default.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Bearer token
- Providers
- Matrix
- Secret shape
- the account access token, or {"access_token": "…"}
- Config it needs
- base_url, user_id, default_room_id
- Resolved by
- config.connection_id, else node.connection_id
Configuration
6 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
room_id The room id, e.g. !AbCdEf:example.org. Falls back to the connection's default room; resolve a #alias:server with matrix.resolve_room_alias. | string | No | — | — | !AbCdEf:example.org |
direction 'b' walks backwards from the newest event, 'f' forwards from the token. | string | No | b | one of "b", "f" | — |
from_token Pagination token to start from — the 'end' of a previous call. Blank starts at the newest event. | string | No | — | — | — |
to_token Stop when this pagination token is reached. | string | No | — | — | — |
limit How many events to return; the homeserver defaults to 10. | number | No | — | ≥ 1 | — |
filter A RoomEventFilter as JSON, e.g. {"types": ["m.room.message"]}. | object | No | — | — | {"types":["m.room.message"]} |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"direction": "b",
"filter": {
"types": [
"m.room.message"
]
},
"room_id": "!AbCdEf:example.org"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
chunk The events on this page, in the requested direction. | array | — |
chunk[].event_id One event's id. | string | — |
chunk[].sender Who sent that event. | string | — |
chunk[].type That event's type. | string | — |
chunk[].content That event's content. | object | — |
count How many events this page contains. | number | — |
start Token for the start of this page. | string | — |
end Token to pass as from_token for the next page. | string | — |
state State events the server sent alongside the page. | array | — |
{
"chunk": [
{
"content": {},
"event_id": "",
"sender": "",
"type": ""
}
],
"count": 0,
"end": "",
"start": "",
"state": []
}Notes
- The connection's base_url is the homeserver (e.g. https://matrix.example.org), not the account's server name; the two differ whenever .well-known delegation is in use.
- Rooms are addressed by room id (!abc:server). Resolve a #alias:server with matrix.resolve_room_alias first, or set a default room on the connection.
See Get Messages run in a workflow.
In a technical demo we add the Matrix connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.