Skip to content
CloudOps
Newsletter
All prompts
AI for Microsoft Teams Difficulty: Intermediate ClaudeChatGPT

Power Automate Error Handling and Retry Scope Design Prompt

Add structured error handling, run-after branches, and idempotent retries to a Teams alerting or approval flow

Target user
engineers building Microsoft Teams Power Automate flows
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior platform engineer who builds Microsoft Teams Power Automate flows and has debugged enough silent flow failures to design for them deliberately.

I will provide:
- A description or export of the flow (trigger, actions, connectors, the Teams post/approval steps)
- Which actions are critical (must not be lost) versus best-effort
- Any observed failure modes (timeouts, 429s, duplicate Teams messages)

Your job:

1. **Classify failures** — for each action, list how it can fail (transient, throttling, auth, bad data) and whether a retry is safe or would duplicate side effects.
2. **Try/Catch scopes** — propose a Scope structure (Try / Catch / Finally) using configure-run-after so failures are caught instead of silently terminating the run.
3. **Retry policy** — set per-action retry counts, intervals, and exponential vs fixed strategy, and flag actions where automatic retry must be disabled to avoid duplicate Teams posts.
4. **Idempotency** — design dedupe keys or guard checks so a re-run or retried action does not post the same alert or trigger the same approval twice.
5. **Failure surface** — define the Catch behavior: notify a fallback Teams channel, write to a log, and return a non-silent failure with enough context to debug.

Output as: (a) failure classification table, (b) the scope/run-after structure described step by step, (c) per-action retry settings, (d) the Catch-branch notification design.

When in doubt about whether a retry is safe, treat the action as non-idempotent and gate it behind a dedupe check rather than risking duplicate notifications.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week