Matrix Execution

Matrix Execution

Certified

Notify Matrix about execution result

Sends a templated Matrix message with execution link, identifiers, timing, status, and failing task when applicable. Use with a Flow trigger; for errors handlers prefer Send.

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

Send a Matrix notification on a failed flow execution.

yaml
id: failure_alert
namespace: company.team

tasks:
  - id: send_alert
    type: io.kestra.plugin.matrix.Execution
    homeserverUrl: "https://matrix.org"
    accessToken: "{{ secret('MATRIX_ACCESS_TOKEN') }}"
    roomId: "!OGEhHVWSdvArJzumhm:matrix.org"
    executionId: "{{ trigger.executionId }}"

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    states:
      - FAILED
      - WARNING
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.

Custom fields

Additional key-value pairs merged into the template rendering context.

Custom message

Extra message text appended to the templated notification when set.

Default{{ execution.id }}

Execution ID

ID of the execution to notify about; defaults to the current execution's ID.

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.