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
-
Teams Workflow Webhook Adaptive Card Posting Prompt
Build the replacement for retired Office 365 connectors: post adaptive cards into a channel via a Power Automate Workflows 'When a Teams webhook request is received' trigger, including the exact payload shape and auth model.
-
Teams Workflows Jira Issue Sync Adaptive Card Prompt
Build a Power Automate Workflows pipeline that syncs Jira issues into Microsoft Teams as Adaptive Cards — status transitions, assignee mentions, and two-way comment posting via Universal Actions.
-
Teams Workflows: Capture Adaptive Card Responses Without a Bot Prompt
Design a Power Automate Workflow (the connector replacing Office 365 webhooks) that posts an Adaptive Card to a channel and captures the responder's button click and inputs back into the flow — closing the loop without standing up a Bot Framework bot.
-
Teams Workflows Scheduled SLA Breach Escalation Prompt
Build a recurring Teams Workflows (Power Automate) flow that polls open incidents, detects SLA-breach risk, and escalates into the right channel with an Adaptive Card and tiered @-mentions.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
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.