Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Microsoft Teams Difficulty: Intermediate ClaudeChatGPTCursor

Teams Workflows Webhook Payload Transform Builder Prompt

Build and debug the transformation that turns raw monitoring JSON (Alertmanager, Datadog, Grafana, CI webhooks) into the exact message wrapper a Power Automate Workflows 'incoming webhook' expects, so cards post reliably instead of returning 400 or rendering blank.

Target user
SREs wiring monitoring tools into a Teams channel through the Workflows inbound webhook after Office 365 connectors were retired
Difficulty
Intermediate
Tools
Claude, ChatGPT, Cursor

The prompt

You are a Power Automate + Teams integration engineer who has migrated dozens of alerting pipelines onto the Workflows inbound webhook. You know the exact payload contract and the common reasons a POST returns HTTP 400 or posts an empty card.

I will provide:
- The raw JSON my source system sends (Alertmanager, Datadog, Grafana, GitHub/GitLab CI, or custom)
- The fields I want on the card (title, severity, summary, runbook link, dashboard link, timestamp)
- Whether the transform runs in the sending system, in a proxy, or inside the Flow itself (Compose / Select / parse JSON actions)

Your job:

1. **State the contract.** Explain that the Workflows "When a Teams webhook request is received" trigger expects a top-level wrapper: `{"type":"message","attachments":[{"contentType":"application/vnd.microsoft.card.adaptive","content":{ ...Adaptive Card... }}]}`. Emphasize that posting a bare Adaptive Card, or legacy MessageCard/`@type: MessageCard` JSON, is the #1 cause of 400s and blank posts.

2. **Map my fields.** Take my raw source JSON and produce a field-by-field mapping to an Adaptive Card v1.5 body: title `TextBlock`, a colored container/`style` by severity, a `FactSet` for key/value fields, and `Action.OpenUrl` buttons for runbook and dashboard.

3. **Write the transform.** Depending on where I run it, give me EITHER: (a) a Power Automate expression / `Select` + `Compose` recipe using `triggerBody()` and `@{...}` bindings, OR (b) a jq/JavaScript transform for a proxy/script. Handle missing fields with defaults so a partial alert never produces invalid JSON.

4. **Handle arrays and severity.** Show how to iterate Alertmanager `alerts[]` or grouped payloads, map severity strings to card container styles/emoji, and cap the card so it never exceeds the ~28 KB Teams card limit (truncate long descriptions, link out instead of inlining).

5. **Give me a curl test.** Provide a ready-to-run `curl` that POSTs the wrapped payload to the Workflow URL, plus the expected HTTP response (202 Accepted) and what a 400 body typically means.

6. **Failure playbook.** List the top failure modes — bare card (no wrapper), wrong `contentType`, invalid card JSON, expired/rotated Workflow URL, oversized payload — with the observable symptom and fix for each.

Output: (a) the wrapper + card JSON template, (b) the concrete transform (expression or jq/JS) for my source, (c) a curl test command, (d) a defaults/fallback table for missing fields, and (e) the failure playbook.

Bias toward: valid JSON on every code path, the exact Workflows wrapper shape, and small cards that link out rather than inlining large payloads.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Microsoft Teams prompts & error guides

Browse every Microsoft Teams prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.