build-power-automate-flow
Skill0 starsChanged 3 months agoMITView on GitHub
Build, edit, or troubleshoot Microsoft Power Automate cloud flows in the web designer (make.powerautomate.com) - driving the browser directly when browser automation is available, otherwise guiding the user step by step. Use when creating or modifying a Power Automate flow, adding triggers/actions/approvals/HTTP calls, wiring dynamic content or expressions, making manual-trigger inputs optional, embedding secrets, or diagnosing a failed flow run in the new designer. Captures hard-won designer gotchas so the build doesn't have to relearn them.
In this repository22 other files it gives its agents.
- acquire-graph-tokenSkill
- analyze-vulnerability-kpisSkill
- author-shared-skillSkill
- check-autopilot-serialsSkill
- create-fedex-labelSkill
- deploy-automox-workletSkill
- draft-it-announcementSkill
- enroll-apple-device-abm-intuneSkill
- freshservice-automation-builderSkill
- freshservice-service-catalogSkill
- it-operationsSkill
- manage-cato-clientSkill
- package-intune-win32-appSkill
- prepare-cab-change-ticketSkill
- query-crowdstrike-falconSkill
- retrieve-keeper-secretSkill
- review-intune-byod-app-protectionSkill
- run-intune-maa-teams-notifierSkill
- screenconnect-remote-diagnosticsSkill
- ssh-accessSkill
- switch-ai-toolsSkill
- triage-windows-bsodSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 96
Approvals: add "Start and wait for an approval" (Approve/Reject – First to respond).
- Distinctive: line 104
Background designer tabs freeze permanently (seen in Edge): If screenshots/read_page on a make.powerautomate.com tab start timing out …
- Very specific: line 202
Prefer ref-based clicks from find/read_page, and after any dropdown selection re-read refs rather than reusing coordinates from the …
- Distinctive: line 216
Create → Instant cloud flow (or Automated) → name it → pick the trigger.
- Very specific: line 218
Add actions via the + insert points.
- Distinctive: line 225
If there's an approval, it pauses.
- Distinctive: line 226
Check flow details → 28-day run history: green "succeeded" vs red "failed".
- Distinctive: line 229
After a fix, Save then Test again (or Resubmit the run — note it re-fires approval).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Build Power Automate Flow (via browser)
Power Automate flows are built in the web designer (make.powerautomate.com); there is no API to author them. So this is a browser-driving task: drive the designer step by step with whatever browser automation is available, otherwise guide the user through the same steps. The designer is React-heavy and fights automation — the rules below are the difference between a smooth build and an hours-long slog.
Before you start
- Confirm a browser is connected:
list_connected_browsers. Navigate the working tab tomake.powerautomate.com. If no browser-automation tool is available in this session, walk the user through the designer step by step instead, applying the same golden rules below. - Confirm the user is signed in as the account that owns the flow and has the right license. HTTP and Azure Key Vault are premium connectors; Forms/Teams/Approvals/Outlook/SharePoint are standard. The flow must be owned by an account with Power Automate Premium for HTTP.
- You cannot build the flow for them in a headless way — narrate progress; pull the user in only for: entering credentials/secrets, interactive connection sign-in popups, sharing/permissions, and approving test runs.
Golden rules (the gotchas that cost the most time)
- Element refs are not stable — read before you act.
read_page/findmint ref ids for elements that exist at that moment. You cannot predict a future ref's number, and a click that adds DOM (e.g. "Add an input") invalidates later refs. Pattern: read_page → act on those refs → if the action created new elements, read_page again. Aread_pageinside abrowser_batchdoes make later same-batch refs usable, but only if you already know the number — so mostly: one create per batch, then re-read. - CDP timeouts are normal — retry, don't redo.
screenshotoften fails with "CDP sendCommand ... timed out"; just call it again. Atypeof a long string may report "timed out" but actually complete — verify with a screenshot before retyping (retyping duplicates text). - Use
browser_batchto chain clicks/types/waits/screenshots. Put a shortwait(1s) after any click that triggers a render, before the next dependent action. - Reaching off-screen "+" insert points: the add-action
+for a nested branch is often below the fold. Collapse the action details panel (the«button), then click "Zoom view to fit" (the frame icon in the canvas zoom controls). Now every+is visible — click the on-canvas+directly. Clicking a stale insert-button ref usually does nothing. - Manual-trigger ("Manually trigger a flow") input keys are positional by type. As you add
inputs, keys are assigned per type in order: Text →
text,text_1,text_2…; Yes/No →boolean; Number →number; etc. Reference them astriggerBody()?['text_5']. Verify the exact keys by opening the trigger's Code view before building references. - Make inputs optional via the per-input
...menu → "Make optional". Every Text/Number/ Yes-No input is required by default. NEVER delete or reorder trigger inputs after downstream references exist — that renumbers the positional keys and silently breaks everytriggerBody()['text_N']reference. "Make optional" toggles in place and is safe. - A JSON HTTP Body rejects unquoted
@{}. The design-time validator throws "Enter a valid JSON" if a value is"x": @{...}unquoted. Quote every dynamic value:"x": "@{triggerBody()?['text_1']}". For values that must be a real number/boolean, either confirm the target API accepts a stringified value, or build the whole body with an expression. (The token/oauth body isx-www-form-urlencoded, NOT JSON — no quoting needed there.) - Optional fields need the
?operator. A blank optional input is omitted fromtriggerBody();triggerBody()['text_5'](no?) then throws and fails the run. UsetriggerBody()?['text_5']— a blank renders as""(not the literal"null") in an@{}string. Force-empty with@{coalesce(triggerBody()?['text_5'],'')}if you want a guarantee. - Type expressions inline; don't trust the fx chip through Save. The fx expression editor's
"Add" produces a chip that has been seen to revert to
nullafter Save. More reliable: type the expression as@{...}directly into the field (works for HTTP body, header values, email attachmentContentBytes, etc.). Verify via the action's Code view after saving. Editing an EXISTING chip is worse than creating one (verified 2026-08-03): clicking the chip, rewriting the expression in the editor, and clicking Update closes the editor and the toolbar still reports "Your flow is ready to go" — but the old expression is what persists, and it survives a full page reload, so nothing signals the failure except Code view. There is no error to notice. Working sequence: click the chip's×to clear the field, then type the whole new expression directly into the empty field (leading@, no braces, for a boolean/native value), click blank space in the details panel to blur, Save, then reload the page and re-open Code view to confirm. Treat any expression edit as unverified until Code view shows it post-reload. - Secrets: turn on the action's Settings → Secure Inputs (hides inputs from run
history). Do not open Code view or screenshot a body/panel while a secret is in it — it
lands in the transcript. The HTTP action's Active Directory OAuth
Secretfield (and the Client-certificate/Raw fields) render the value in PLAINTEXT in the designer — NOT masked — so any screenshot of that open panel leaks it, even one taken to check something else. Have the user paste the secret themselves and collapse the details panel («) or click blank canvas before the next screenshot; verify success via the node losing its error / the Save banner, not by viewing the field. Prefer feeding secrets by clipboard-paste (ctrl+v) so the value never passes through chat. Diagnose credential problems by comparing lengths and first/last chars against a known-good source rather than displaying the value. Watch for the classiclvs1andOvs0paste mix-ups and trailing whitespace/newlines. - Duplicate actions auto-name
XthenX 1. In expressions, spaces become underscores:body('HTTP'),body('HTTP_1'). - Approvals: add "Start and wait for an approval" (Approve/Reject – First to respond).
The Approvals connection auto-creates with the signed-in account. During a test, approve via
Approvals → Received in the left nav (or the Teams/Outlook card). Branch on the approval's
Outcomewith a Condition (Outcome is equal to Approve). - Connections (Outlook, Approvals, etc.) usually auto-create silently. If a sign-in/consent popup appears, hand it to the user — never enter their credentials.
- Background designer tabs freeze permanently (seen in Edge). If screenshots/read_page on a make.powerautomate.com tab start timing out ("Script injection timed out", "renderer frozen") after the tab sat in the background, the tab is dead — waiting and navigate() do NOT revive it. Create a NEW tab, load the flow URL there, and continue; saved work is intact. So: Save before switching away from a designer tab, and expect to burn a tab per long detour.
- HTTP-trigger flows called by external services (Slack events, webhooks): set the trigger's
"Who can trigger the flow?" to "Anyone" — the default "Any user in my tenant" requires Entra
auth and the external POST fails. The URL's SAS
sigis the secret. The generated URL can't be read from the a11y tree — click its copy button and ctrl+v it directly where needed. For Slack Events API verification, make the FIRST action a Response 200 with body@{coalesce(triggerBody()?['challenge'],'')}(also satisfies Slack's 3-second ack). - Clipboard "Copy" buttons only work on the ACTIVE browser tab. Clicking a copy button on a backgrounded tab silently no-ops (navigator.clipboard needs document focus) — the clipboard keeps its old contents, which then get pasted as the "secret" and fail with invalid_auth-style errors while the flow run still shows Succeeded. Create a fresh tab (it becomes active) immediately before clicking Copy, and verify the page flashes its "Copied!/Success!" confirmation (find can read it without screenshotting the secret) before pasting elsewhere.
- Each field type mangles a typed expression differently — always confirm in Code view.
@{expr}(braces) forces a string;@expr(no braces) keeps the native type. The Parameters tab renders both as an identicalfxchip and the Flow checker reports 0 errors either way, so only Code view reveals these:- Condition rows: typing
@{greater(...)}persists asequals: ["@{greater(...)}", true]— string vs JSON boolean, which never matches, so the branch silently never fires and nothing downstream ever runs. Type the left side without braces (@greater(...)) and leave the right box as plaintrue(stored as a real JSON boolean). You want["@expr", true]. Do not "fix" it by putting@{true}on the right — that just inverts the mismatch. Editing one side of a row can silently re-normalise the other, so re-check Code view after every condition edit. Verified 2026-08-19: a legacy row stored as["@{and(...)}", "@{true}"](both sides stringified — which works) had its untouched right side silently rewritten to@true(native boolean) the moment the left chip was replaced and saved — leaving string-vs-boolean, never-match. The repair is to re-type the LEFT side without braces so both sides are native booleans; don't try to restore@{true}on the right. - Select's "text mode" Map validates as JSON:
@item()?['id']fails with "Enter a valid JSON". Type it double-quoted —"@item()?['id']"— which parses to the string the engine wants and persists as"select": "@item()?['id']". - Filter array's basic-mode Filter Query string-wraps what you type:
@{contains(...)}becomes@equals('@{contains(...)}',true)and Save fails with "contains invalid expression(s)". Click "Edit in advanced mode" first, then type one clean boolean expression (@contains(body('Member_ids'), item()?['userId']), or@not(contains(...))instead of fighting the editor for "is equal to false").
- Condition rows: typing
Calling Microsoft Graph on a schedule — choose the app-only credential deliberately. The default "Log in with Microsoft Entra ID" connection is delegated and tied to the human connection owner. For an unattended admin scope such as
DeviceManagementRBAC.Read.All, use a dedicated single-tenant app with the smallest Graph Application permission and admin consent. Two supported patterns:- Preferred when an exportable PFX is available: HTTP with Microsoft Entra ID
(preauthorized) → Log in using a Client Certificate Auth. Set both resource fields to
https://graph.microsoft.com, then provide tenant, app client ID, PFX and its password. A Windows certificate-store thumbprint is not enough; Power Automate needs the PFX private key. - Fallback: premium HTTP action 1 POSTs the OAuth
client_credentialsform to the tenant token endpoint; action 2 calls Graph with the returned bearer token. URL-encode the secret. Turn on Secure Inputs and Secure Outputs for both actions and never inspect the token action in Code view or screenshots.
Chromium extension uploads can fail with
Not alloweduntil file-URL access is enabled in the extension settings. Do not keep retrying. Ask the user to enable that setting, or—when the user already authorized the migration—use the dedicated client-secret fallback, store the recovery copy encrypted, and remove any unused certificate credential/PFX created during staging. Never fall back to delegated authentication just because certificate upload is blocked.- Preferred when an exportable PFX is available: HTTP with Microsoft Entra ID
(preauthorized) → Log in using a Client Certificate Auth. Set both resource fields to
- Intune MAA app-only reads are silently filtered by protected workload permission (verified
2026-08-12).
DeviceManagementRBAC.Read.Allauthorizes GETdeviceManagement/operationApprovalRequests, but it does not make every request payload visible. With RBAC read alone, Graph returned HTTP 200 plus an empty collection and HTTP 404 for an exact mobile-app request. AddingDeviceManagementApps.Read.Allmade that same natural request visible immediately. A tenant-wide poller also needs the read-only application role for each protected resource family it monitors:DeviceManagementConfiguration.Read.All,DeviceManagementManagedDevices.Read.All,DeviceManagementScripts.Read.All, andDeviceManagementServiceConfig.Read.All. Treat a Succeeded flow and HTTP 200 as insufficient: compare workload-family inventory and validate on a naturally occurring request. Never overlap delegated and app-only posters, and never manufacture an Intune change just to test the poller. - A Recurrence/Scheduled flow cannot be manually test-run while it is Off. Test → Run flow returns "This flow is currently turned off. If you own it, turn it on…". Turning the flow On is a prerequisite to testing, not the post-test victory lap the checklists imply — so say that when asking approval for a first production run, because On also arms the schedule and the next interval fires unattended. Upside: the next scheduled run is the real idempotency proof (it should be a no-op); a first run only proves the write path.
item()binds to the INNERMOST repeating scope. A Filter array nested inside anApply to eachevaluates its condition withitem()= the element being filtered, not the loop's current item — so filtering@body('Get_device_object')?['registeredOwners']on@contains(body('Member_ids'), item()?['id'])reads owner ids, as intended.- There is no paste on an insert point in the new designer. Right-clicking a node offers
"Copy action", but right-clicking an insert
+offers only Add an action / Add generative action / Add AI prompts — no Paste — so plans that say "copy the first HTTP action and edit it" don't work. Add each action fresh; the premium HTTP connector needs no connection, so re-adding it is cheap. - Set a fixed window size before a long build. The designer re-lays out on every panel
open/close and the browser window can resize mid-session, which silently shifts every
coordinate — several "the value didn't take" failures are really clicks landing one field off.
Prefer
ref-based clicks fromfind/read_page, and after any dropdown selection re-read refs rather than reusing coordinates from the previous screenshot. - Rich-text fields (e.g. the Teams Message box): clicking beside a chip silently no-ops.
A click next to an inline token chip often fails to focus the contenteditable — typed keys go
nowhere, and the action's Code view shows the body unchanged (check there, not the canvas,
whenever typing "didn't take"). Reliable insertion: click into plain TEXT in the field, then
move the caret with keyboard keys (End / Down / End) to the target spot, then type the
@{...}literal. It stays visible as literal text until Save, then becomes an fx chip. The editor may bold-wrap the inserted run depending on caret formatting state, and on save it re-serialises the whole body witheditor-paragraph/editor-text-boldclasses — cosmetic, harmless (verified 2026-08-19).
Build sequence
- Create → Instant cloud flow (or Automated) → name it → pick the trigger.
- Configure the trigger. For manual triggers, add inputs (record the add-order → key mapping).
- Add actions via the
+insert points; a flow needs ≥1 action before it will Save. - Save frequently (protects work against the flaky UI). The banner turns to "Your flow is ready to go" when valid; a red banner names validation errors.
Testing & diagnosing a failed run
- Test → Manually → Test → Run flow, fill the trigger inputs, Run flow. (The run form does not prefill previous values — re-enter each time.)
- If there's an approval, it pauses; approve via Approvals → Received.
- Check flow details → 28-day run history: green "succeeded" vs red "failed".
- Open a failed run → click the failed action → Run results shows the Status code and
error. A
401on an OAuth/token step = rejected credentials (see rule 10 for safe diagnosis). - After a fix, Save then Test again (or Resubmit the run — note it re-fires approval).
Worked examples
- Teams request → approval → FedEx label → email:
C:\temp\NodeJS\fedex\power-automate-pipeline.md(FedEx side covered by thecreate-fedex-labelskill). - Slack Events API → HTTP trigger → Flow bot post to a Teams group chat (challenge handshake,
event filtering, Slack app manifest):
C:\temp\NodeJS\slack-teams-bridge\flow-spec.md. - Hourly app-only Graph read/write loop — token → list → Select → Filter array → nested
Apply to each with an owner guard → conditional PATCH → reconcile-and-clear branch, 11 actions,
every expression recorded verbatim:
C:\temp\NodeJS\it-devices-dynamic-group\flow-spec.md(that file's "Designer gotchas" section is the evidence behind rules 17 and 20–23).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

