step
teams_webhook
Send formatted notifications to Microsoft Teams via the Incoming Webhook API.
Overview
Send formatted notifications to Microsoft Teams via the Incoming Webhook API. Constructs Office 365 Connector MessageCard payloads with optional title, text body, theme color, and additional sections. Template substitution allows dynamic content based on event data.
Quick Start
steps:
- type: teams_webhook
webhook_url: https://outlook.office.com/webhook/xxx/IncomingWebhook/yyy/zzzConfiguration
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_url | string | Yes | Microsoft Teams Incoming Webhook URL that receives the formatted payload. |
title | string | No | Static card title text. Ignored when 'title_template' is provided. |
title_template | string | No | Template with ${path.to.key} substitutions rendered against the event to build the card title. |
text | string | No | Static message text body. Ignored when 'text_template' is provided. |
text_template | string | No | Template with ${path.to.key} substitutions rendered against the event to build the message text. |
theme_color | string | No | Hex color code for the card's accent bar (without # prefix). Defaults to Teams default if omitted. |
include_event | boolean | No | When True, append the event (or selected fields) formatted as a JSON code block in the card text.
Default: false |
event_fields | string | No | List of top-level event keys to include when 'include_event' is True. Omitting this sends the entire event. |
sections | string | No | Additional MessageCard sections to append to the payload. Values are passed through to Teams without validation. |
drop_on_failure | boolean | No | If True, return None on network errors or non-2xx responses instead of injecting error details.
Default: false |
timeout | integer | No | Timeout in seconds for the webhook POST (default 5).
Default: 5 |
output_to | string | No | Event key used to store success or error metadata emitted by the step.
Default: "teams" |
inject | string | No | DEPRECATED: Use 'output_to' instead. Event key for storing result metadata. |
Examples
Simple notification
Send a basic alert when a deployment completes
type: teams_webhook
webhook_url: https://outlook.office.com/webhook/xxx/IncomingWebhook/yyy/zzz
title: Deployment Complete
text: Production deployment finished successfully
theme_color: "28A745"
Dynamic content from event
Use template substitution to include user details in the message
type: teams_webhook
webhook_url: ${env:teams_webhook}
title_template: "New User Signup: ${user.email}"
text_template: User ${user.name} signed up from ${user.country}
theme_color: "0076D7"
include_event: true
event_fields:
- user
- timestamp
Error notification with sections
Send rich error details with custom sections and facts
type: teams_webhook
webhook_url: ${env:teams_webhook}
title: ⚠️ Service Error Detected
text_template: Service ${service.name} reported ${error.count} errors
theme_color: FF0000
sections:
- activityTitle: Error Details
facts:
- name: Service
value: ${service.name}
- name: Error Count
value: ${error.count}
- name: Severity
value: ${error.severity}
drop_on_failure: false
Advanced Options
These options are available on all steps for error handling and retry logic:
| Parameter | Type | Default | Description |
|---|---|---|---|
retries | integer | 0 | Number of retry attempts (0-10) |
backoff_seconds | number | 0 | Backoff (seconds) applied between retry attempts |
retry_propagate | boolean | false | If True, raise last exception after exhausting retries; otherwise swallow. |