Microsoft 365 TeamsIncomingWebhook

Microsoft 365 TeamsIncomingWebhook

Certified

Send message via Teams incoming webhook

Posts a JSON payload to a Microsoft Teams Incoming Webhook; ideal for errors notifications. No Graph permission required, only the webhook URL.

yaml
type: io.kestra.plugin.microsoft365.teams.TeamsIncomingWebhook

Send a Microsoft Teams notification 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.microsoft365.teams.TeamsIncomingWebhook
    url: "{{ secret('TEAMS_WEBHOOK') }}" # format: https://microsoft.webhook.office.com/webhook/xyz
    payload: |
        {
          "type": "message",
          "attachments": [
            {
              "contentType": "application/vnd.microsoft.card.adaptive",
              "content": {
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "type": "AdaptiveCard",
                "version": "1.4",
                "body": [
                  {
                    "type": "TextBlock",
                    "size": "Large",
                    "weight": "Bolder",
                    "text": "Kestra Execution Notification"
                  },
                  {
                    "type": "TextBlock",
                    "text": "Execution ID: `{{ execution.id }}`",
                    "wrap": true
                  },
                  {
                    "type": "TextBlock",
                    "text": "Flow: `{{ flow.id }}` in namespace `{{ flow.namespace }}`",
                    "wrap": true
                  },
                  {
                    "type": "TextBlock",
                    "text": "Status: **{{ execution.state }}**",
                    "wrap": true
                  }
                ],
                "actions": [
                  {
                    "type": "Action.OpenUrl",
                    "title": "View Execution",
                    "url": "{{ kestra.url }}/ui/executions/{{ flow.namespace }}/{{ flow.id }}/{{ execution.id }}"
                  }
                ]
              }
            }
        ]
        }

Send a Microsoft Teams notification message.

yaml
id: send_notification
namespace: company.team

tasks:
  - id: send_teams_notification
    type: io.kestra.plugin.microsoft365.teams.TeamsIncomingWebhook
    url: "https://microsoft.webhook.office.com/webhookb2/XXXXXXXXXX"
    payload: |
      {
         "@type": "MessageCard",
         "@context": "http://schema.org/extensions",
         "themeColor": "0076D7",
         "summary": "Notification message",
         "sections": [
           {
             "activityTitle": "Rolling Workflow started",
             "activitySubtitle": "Workflow Notification",
             "markdown": true
           }
         ],
         "potentialAction": [
           {
             "@type": "OpenUri",
             "name": "Rolling Workflow",
             "targets": [
               {
                 "os": "default",
                 "uri": "{{ vars.systemUrl }}"
               }
             ]
           }
         ]
       }
Properties
Min length1

Teams incoming webhook URL

HTTP client options

Optional timeouts, charset, headers, and limits for Teams webhook calls

Definitions
connectTimeoutstring

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

connectionPoolIdleTimeoutstring
DefaultPT0S

Idle pool timeout

Time an idle connection stays in the pool before closing

defaultCharsetstring
DefaultUTF-8

Default charset

headersobject

HTTP headers

HTTP headers to include in the request

maxContentLengthintegerstring
Default10485760

Max response size

Maximum response content length in bytes

readIdleTimeoutstring
DefaultPT5M

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

readTimeoutstring
DefaultPT10S

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

Teams message payload

Raw JSON payload for the webhook (Adaptive Card or MessageCard)

Reference (ref) of the pluginDefaults to apply to this task.