Send an X (Twitter) post with execution information.

Send execution details via X (Twitter) including execution link, ID, namespace, flow name, start date, duration, and status.

yaml
type: "io.kestra.plugin.notifications.x.XExecution"

Send an X notification on a failed flow execution using Bearer Token.

yaml
id: failure_alert_x
namespace: company.team

tasks:
  - id: send_x_alert
    type: io.kestra.plugin.notifications.x.XExecution
    bearerToken: "{{ secret('X_BEARER_TOKEN') }}"
    executionId: "{{ trigger.executionId }}"
    customMessage: "Production workflow failed - immediate attention required!"
    customFields:
      Environment: "Production"
      Team: "DevOps"
      Priority: "High"

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: prod
        prefix: true

Send an X notification using OAuth 1.0a credentials.

yaml
id: success_alert_x
namespace: company.team

tasks:
  - id: send_x_success
    type: io.kestra.plugin.notifications.x.XExecution
    consumerKey: "{{ secret('X_CONSUMER_KEY') }}"
    consumerSecret: "{{ secret('X_CONSUMER_SECRET') }}"
    accessToken: "{{ secret('X_ACCESS_TOKEN') }}"
    accessSecret: "{{ secret('X_ACCESS_SECRET') }}"
    executionId: "{{ trigger.executionId }}"
    customMessage: "Deployment completed successfully!"

triggers:
  - id: successful_deployments
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - SUCCESS
Properties

OAuth Access Secret

X API OAuth 1.0a Access Token Secret. Required if bearerToken is not provided.

OAuth Access Token

X API OAuth 1.0a Access Token. Required if bearerToken is not provided.

Bearer Token

X API Bearer Token for authentication. If provided, OAuth 1.0a credentials are not required.

OAuth Consumer Key

X API OAuth 1.0a Consumer Key (API Key). Required if bearerToken is not provided.

OAuth Consumer Secret

X API OAuth 1.0a Consumer Secret (API Secret). Required if bearerToken is not provided.

Custom fields to be added in the notification

Custom message to be added in the notification

Default {{ execution.id }}

The execution ID to use

Default is the current execution, change it to if you use this task with a Flow trigger to use the original execution.

Options

The options to set to customize the HTTP client

Map of variables to use for the message template

Post text body

Direct post text (bypasses template)

Default https://api.x.com/2/tweets

Override URL for testing

Optional URL to override the default X API endpoint (for testing purposes)

Format duration

The time allowed to establish a connection to the server before failing.

Default PT0S
Format duration

The time an idle connection can remain in the client's connection pool before being closed.

Default UTF-8

The default charset for the request.

SubType string

HTTP headers

HTTP headers to include in the request

Default 10485760

The maximum content length of the response.

Default PT5M
Format duration

The time allowed for a read connection to remain idle before closing it.

Default PT10S
Format duration

The maximum time allowed for reading data from the server before failing.