Matrix Send

Matrix Send

Certified

Send a Matrix room message

Posts a m.room.message event to a Matrix room using the Client-Server API send endpoint. payload is the plain-text message body; msgtype selects how clients render it. The bot account identified by accessToken must already be a member of roomId — it will not be invited automatically. Does not support end-to-end encrypted rooms.

yaml
type: io.kestra.plugin.matrix.Send

Send a Matrix message on a failed flow execution.

yaml
id: unreliable_flow
namespace: company.team

tasks:
  - id: fail
    type: io.kestra.plugin.scripts.shell.Commands
    runner: PROCESS
    commands:
      - exit 1

errors:
  - id: alert_on_failure
    type: io.kestra.plugin.matrix.Send
    homeserverUrl: "https://matrix.org"
    accessToken: "{{ secret('MATRIX_ACCESS_TOKEN') }}"
    roomId: "!OGEhHVWSdvArJzumhm:matrix.org"
    msgtype: NOTICE
    payload: "Matrix Alert: flow {{ flow.id }} failed"
Properties

Bot access token

Matrix access token for the bot account; store as a secret and avoid hardcoding. Obtain it via the login endpoint or Element under Settings > Help & About > Access Token.

Homeserver URL

Base URL of the Matrix homeserver hosting the room, for example https://matrix.org. Matrix is federated so there is no default — use the homeserver the bot account is registered on.

Room ID

Target Matrix room's internal ID, starting with ! (for example !OGEhHVWSdvArJzumhm: matrix.org). Find it in Element under the room's Settings > Advanced. A room alias (starting with #) is not accepted here.

Possible Values
TEXTNOTICEEMOTE

Message type

Matrix msgtype for the event: TEXT (m.text, a plain message), NOTICE (m.notice, intended for automated/bot senders — clients render it distinctly and must never auto-reply to it, which avoids bot-to-bot loops), or EMOTE (m.emote, an action-style message, e.g. "/me is done"). Defaults to TEXT; NOTICE is recommended for alerting flows.

Configure Matrix HTTP client

Optional HTTP client overrides for Matrix calls. Leave unset to use the defaults: no connect timeout, a 5m read idle timeout and UTF-8 as the request charset.

Definitions
connectTimeoutstring

Connect timeout

Maximum time to establish the connection before failing; unset uses the client default.

defaultCharsetstring
DefaultUTF-8

Request charset

Charset used to encode the request body; defaults to UTF-8.

headersobject

HTTP headers

Additional HTTP headers to include in every request sent to the homeserver.

readIdleTimeoutstring
DefaultPT5M

Read idle timeout

Idle time allowed while reading before the connection is closed; defaults to 5m.

Message payload

Plain-text message body sent as the event's body field. Do not wrap the value in a JSON object; combine with msgtype to control how Matrix clients render it.