
add-cloud-flow
Integrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional pages without re-creating metadata. Use when the user wants to add, connect, register, or link a Power Automate cloud flow to their site.
- Installs
- 226
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/microsoft/power-platform-skills --skill add-cloud-flow- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads add-cloud-flow automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Plugin check: Run
node "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Add Cloud Flow
Connect one or more Power Automate cloud flows to a Power Pages SPA site, or wire already-registered flows into additional pages/components. For new flows this skill:
- Creates the
adx_cloudflowconsumermetadata YAML in.powerpages-site/cloud-flow-consumer/ - Assigns web roles based on the flow's scenario and target audience
- Generates client-side TypeScript/JavaScript service code to trigger the flow with CSRF authentication
For already-registered flows, the skill skips metadata and role creation and goes straight to client-side integration — wiring the existing flow into new UI locations.
Core Principles
- Multiple flows in one run: The user can add several flows at once. All flows are planned together and implemented together before asking for deployment.
- Ask before acting: Present a full HTML plan (all flows, roles, reasoning) before creating any files.
- Web roles drive access: Every flow must have at least one web role. Anonymous Users role is valid but must be confirmed.
- Scenario determines roles: Understand what each flow does and who triggers it before picking roles.
- Use TaskCreate/TaskUpdate: Track all phases upfront before starting any work.
- Preserve site integrity: Before wiring a flow into a page or component, read
${PLUGIN_ROOT}/references/site-modification-integrity.md; localize every new visible state when configured and keep the UI bidirectional and expansion-safe.
Prerequisites:
- An existing Power Pages SPA site with
.powerpages-sitedeployed- PAC CLI authenticated (
pac auth whomust succeed)- Azure CLI authenticated (
az login --allow-no-subscriptionsworks whether or not your account has an Azure subscription — Dataverse and Power Platform tokens are AAD-scoped)
Initial request: $ARGUMENTS
Workflow
- Verify Prerequisites — Locate the project, confirm
.powerpages-siteexists, inventory web roles and existing flows - List Available Flows — Fetch flows from the Power Automate Flow RP API
- Select Flows & Understand Scenarios — User picks one or more flows; determine scenario and audience for each
- Determine Web Roles — Propose minimum roles per flow with reasoning
- Review Plan — Render HTML plan for all flows; get user approval
- Create Metadata — Write
.cloudflowconsumer.ymlfor each flow; create missing web roles first - Client-Side Integration — Generate typed service code to call each flow from the frontend
- Verify & Summarize — Validate all YAMLs, record skill usage, offer deployment
Phase 1: Verify Prerequisites
Goal: Locate the Power Pages project and confirm all prerequisites are met
Actions:
- Create todo list with all 8 phases (see Progress Tracking table)
1.1 Locate Project
Look for powerpages.config.json in the current directory or immediate subdirectories.
If not found: Tell the user to create a site first with /create-site.
1.2 Read Config
Read powerpages.config.json to get the siteName (used for display and plan rendering).
1.3 Check .powerpages-site Exists
Look for the .powerpages-site folder in the project root.
If not found:
<!-- gate: add-cloud-flow:1.3.deploy-first | category=plan | cancel-leaves=nothing -->🚦 Gate (plan · add-cloud-flow:1.3.deploy-first):
.powerpages-sitemissing — cloud flow YAML lives inside it. Deploy first or stop.Trigger: Phase 1.3 found no
.powerpages-sitedirectory. Why we ask: Cloud flow YAML written to a non-existent path will never deploy. Cancel leaves: Nothing — no YAML files written.
Use AskUserQuestion:
| Question | Options |
|---|---|
.powerpages-site is required to add cloud flows. Would you like to deploy the site now? | Yes, deploy now (Required), Cancel |
If "Yes, deploy now": Invoke /deploy-site first, then continue to Phase 2.
If "Cancel": Stop.
1.4 Read Existing Web Roles
Read all .webrole.yml files from .powerpages-site/web-roles/ to inventory available roles. Note each role's id, name, adx_anonymoususersrole, and adx_authenticatedusersrole.
1.5 Check Existing Cloud Flows
Check .powerpages-site/cloud-flow-consumer/ for existing .cloudflowconsumer.yml files. For each file, read:
processid— the flow'sworkflowEntityIdname— the flow's display nameadx_CloudFlowConsumer_adx_webrole— assigned web role UUIDs
Store these as the already-registered flows list. These flows already have metadata and web roles configured but may need additional frontend integration on other pages or components.
1.6 Detect Frontend Framework
Read package.json to detect the framework (React, Vue, Angular, Astro). Note the framework and its conventions for Phase 7. See ${PLUGIN_ROOT}/references/framework-conventions.md for the detection mapping.
Output: Project root, site name, framework, available web roles, already-registered flows (with processid, name, and web roles)
Phase 2: List Available Flows
Goal: Fetch all Power Automate cloud flows that have a PowerPages trigger
Actions:
Run the list-cloud-flows script (reads environment from pac auth who internally):
node "${PLUGIN_ROOT}/skills/add-cloud-flow/scripts/list-cloud-flows.js"
This calls the Power Automate Flow RP API with the filter properties/definitionSummary/triggers/any(t: t/kind eq 'powerpages'). Results include:
| Field | Source | Used for |
|---|---|---|
id | properties.workflowEntityId | processid in YAML; URL in client-side API call |
flowRpName | flow.name | Flow RP identifier |
displayName | properties.displayName | Shown to user; written as name in YAML |
description | properties.description | Shown to user |
state | properties.state | Shown to user (Active/Draft) |
Separate into two lists:
- Unregistered flows: Flows whose
iddoes NOT match anyprocessidfrom Phase 1.5 — these need full setup (metadata + roles + client-side) - Already-registered flows: Flows whose
idmatches aprocessidfrom Phase 1.5 — these already have metadata and roles but can be integrated into additional pages/components
Handle errors:
-
Exit code 1 with auth message → prompt the user to run
az login --allow-no-subscriptions -
Zero flows from API (no flows with a PowerPages trigger exist at all) → tell the user that no Power Automate flows with a PowerPages trigger were found in this environment. Guide them to create a flow first:
"No Power Automate cloud flows with a PowerPages trigger were found in this environment. To use this skill, you first need to create a flow in Power Automate with the "When a Power Pages flow step is run" trigger, then run this skill again to connect it to your site."
Stop the workflow — do not continue to Phase 3.
-
Zero unregistered flows but already-registered flows exist → do not stop. Continue to Phase 3 with only the already-registered flows available (for additional frontend integration).
Output: List of unregistered flows and list of already-registered flows
Phase 3: Select Flows & Understand Scenarios
Goal: Understand the user's intent, suggest the most relevant flows (including already-registered ones for additional integration), let the user confirm or adjust, and determine the scenario for each selected flow
Actions:
3.1 Analyze User Intent & Suggest Flows
Before showing the full list, analyze the user's initial request ($ARGUMENTS) against both the unregistered flows and the already-registered flows. Match the user's described need to specific flows using display name, description, and scenario inference.
When matching intent, check already-registered flows first — the user may be asking to wire an existing flow into a new page or component, not register a new one.
-
If the user described a specific need (e.g., "add automation for the contact form", "connect the email notification flow"): Identify flows whose name or description closely match the request and present them as recommended picks, explaining why each is a good match. Also show the remaining flows as additional options in case the suggestion is wrong.
Based on your request, I recommend: ⭐ 1. Contact Form Submission — Sends an email when a contact form is submitted (Active) → Matches your request to add automation for the contact form Other available flows: 2. Support Ticket Handler — Creates a case record from user input (Active) 3. Newsletter Signup — Adds the user's email to a mailing list (Draft) -
If the user's request is generic (e.g., "add a cloud flow", "connect some flows"): Fall back to presenting the full list without recommendations.
Available flows: 1. Contact Form Submission — Sends an email when a contact form is submitted (Active) 2. Support Ticket Handler — Creates a case record from user input (Active) 3. Newsletter Signup — Adds the user's email to a mailing list (Draft)
Present both categories clearly when both exist:
New flows (not yet registered):
1. Newsletter Signup — Adds the user's email to a mailing list (Active)
Already registered (available for additional frontend integration):
2. Contact Form Submission — Already connected, can be wired into more pages
3. Support Ticket Handler — Already connected, can be wired into more pages
🚦 Gate (plan · add-cloud-flow:3.1.select-flows): Multi-select over discovered + already-registered flows. Drives the rest of Phases 4–7.
Trigger: Phase 2 list-cloud-flows returned at least one flow. Why we ask: Wrong flows get registered (new
.cloudflowconsumer.ymlfiles written) or wrong existing flows get re-wired into the frontend. Cancel leaves: Nothing — no YAML or client code written yet.
Use AskUserQuestion:
| Question | Options |
|---|---|
| Which flows would you like to add or integrate? You can select from both new and already-registered flows. | (list or multi-select of flow names, with recommended flows pre-highlighted if applicable) |
If more than 10 flows are available, ask the user to type names or numbers (comma-separated for multiple).
3.2 Tag Selected Flows
For each selected flow, tag it based on its source:
| Tag | Meaning | Phases to execute |
|---|---|---|
new | Unregistered flow — needs full setup | Phases 4 → 5 → 6 → 7 (metadata + roles + client-side) |
integration-only | Already registered — metadata and roles exist | Skip to Phase 7 (client-side integration only) |
3.3 Determine Scenario Per Flow
For each selected flow, identify its scenario from the name and description:
| Scenario type | Examples | Who triggers it |
|---|---|---|
| Form submission | Contact form, feedback, survey | Authenticated or anonymous visitors |
| User self-service | Profile update, request, leave application | Authenticated users only |
| Admin action | Bulk processing, content approval, data export | Admins / specific roles only |
| Background / system | Scheduled sync, enrichment | Not triggered by portal users directly |
If a flow's scenario is unclear, use AskUserQuestion per flow:
| Question | Context |
|---|---|
| What does "[flow name]" do on your site? Who triggers it? | Needed for role assignment |
For integration-only flows, the scenario is still needed to guide where and how the flow is wired into the frontend (Phase 7).
3.4 Determine Client-Side Function Name Per Flow
For each flow, derive a camelCase function name for the client-side service:
- Strip special characters and connector words from the display name
- Example: "PowerPages -> Send an email notification (V3)" →
sendEmailNotification - Example: "Contact Form Submission" →
submitContactForm
For integration-only flows, check whether a trigger function already exists in the codebase (from a previous run of this skill). If it does, reuse that function name — do not create a duplicate. Only create a new function if one doesn't exist yet.
Output: Selected flows list, each with tag (new or integration-only), scenario, target audience, and client-side function name
Phase 4: Determine Web Roles
Goal: Propose the minimum set of web roles for each new flow based on its scenario
Skip for
integration-onlyflows — these already have web roles assigned in their.cloudflowconsumer.yml. Do not re-propose or modify roles for them.
Actions:
4.1 Analyze Role Requirements Per Flow (New Flows Only)
| Scenario | Recommended roles |
|---|---|
| Any visitor (including unauthenticated) | Anonymous Users (confirm — security implication) |
| Only logged-in users | Authenticated Users |
| Only specific groups | Custom role(s) matching the group |
Do NOT assign all roles by default. Use the minimum set per flow. Different flows in the same batch can have different role sets.
4.2 Match Against Existing Roles
For each proposed role across all flows, check whether it exists in .powerpages-site/web-roles/. Mark roles as existing or proposed/new.
4.3 Compose Per-Role Reasoning
For each role assigned to each flow, write one sentence explaining why:
Authenticated Userson a profile form: "Only logged-in users can update their profile."Anonymous Userson a contact form: "Unauthenticated visitors must be able to submit a contact request."Blog Authorson an email flow: "Blog Authors are the primary actors who submit posts triggering this notification."
4.4 Flag Anonymous Roles
If any flow has Anonymous Users assigned, note this — the HTML plan renders a warning banner and the confirm step must explicitly surface it.
Output: Per-flow role sets with reasoning, list of roles that need creating
Phase 5: Review Plan
Goal: Render the HTML plan for all flows and get user approval before writing any files
Actions:
5.1 Build Plan Data
Assemble the plan JSON (kept in memory — not written to disk). Include all selected flows in CLOUD_FLOWS_DATA, distinguishing new from integration-only:
{
"SITE_NAME": "<site name>",
"PLAN_TITLE": "Cloud Flow Integration Plan",
"SUMMARY": "<N new flows + M integration-only flows, scenarios, key role assignments>",
"WEB_ROLES_DATA": [
{
"id": "<uuid or temp-id>",
"name": "<role name>",
"desc": "<description>",
"builtin": false,
"isNew": true,
"isAnonymous": false,
"color": "#0078d4"
}
],
"CLOUD_FLOWS_DATA": [
{
"flowId": "<workflowEntityId>",
"name": "<flow display name>",
"displayName": "<flow display name>",
"description": "<flow description>",
"state": "Active",
"tag": "new | integration-only",
"scenario": "<scenario type>",
"rationale": "<why this flow is being added or where it will be additionally integrated>",
"webRoles": [
{ "id": "<role-uuid>", "reasoning": "<why this role>" }
]
}
],
"RATIONALE_DATA": [
{ "icon": "⚡", "title": "<title>", "desc": "<reasoning>" }
]
}
For integration-only flows, webRoles should reflect the existing roles from the .cloudflowconsumer.yml (read-only — not being changed). The rationale should describe where the flow will be additionally integrated (e.g., "Wiring existing Contact Form flow into the support page").
5.2 Render HTML Plan
node "${PLUGIN_ROOT}/scripts/render-cloudflow-plan.js" \
--output "<PROJECT_ROOT>/docs/cloud-flow-plan.html" \
--data-inline '<json>'
The render script refuses to overwrite existing files. Before calling it, check if the default output path (<PROJECT_ROOT>/docs/cloud-flow-plan.html) already exists. If it does, choose a new descriptive filename based on context — e.g., cloud-flow-plan-contact-form.html, cloud-flow-plan-apr-2026.html. Pass the chosen name via --output.
Open the rendered file in the default browser (open on macOS, start on Windows, xdg-open on Linux).
5.3 Confirm with User
Give a brief CLI summary: number of flows, scenarios, role count, any anonymous-role warnings.
<!-- gate: add-cloud-flow:5.3.plan-approval | category=plan | cancel-leaves=nothing -->🚦 Gate (plan · add-cloud-flow:5.3.plan-approval): Final sign-off on the rendered HTML plan before any web role /
.cloudflowconsumer.yml/ client code is written.Trigger: Phase 5.2 rendered the HTML plan. Why we ask: Wrong web role assignments committed (especially Anonymous Users on auth-protected flows); orphaned YAML files in
.powerpages-site/cloud-flow-consumer/. Cancel leaves: Nothing — no YAML or frontend changes yet.
Use AskUserQuestion:
| Question | Options |
|---|---|
| Review the cloud flow plan in the browser. Does it look correct? | Approve and implement (Recommended), Request changes, Cancel |
If "Request changes": Ask what to change, update, re-render, and present again. If "Cancel": Stop.
Output: User-approved plan for all flows
Phase 6: Create Metadata
Goal: Create web roles (if any are new) then write a .cloudflowconsumer.yml for every new flow in the approved plan
Skip for
integration-onlyflows — these already have.cloudflowconsumer.ymland web roles. Do not recreate or modify their metadata. They will be handled in Phase 7 (client-side integration only).
If the approved plan contains only integration-only flows (no new flows), skip this entire phase and proceed to Phase 7.
Actions:
6.1 Create Missing Web Roles
If the approved plan includes roles that do not yet exist (for new flows), invoke /create-webroles now.
After it completes, re-read .powerpages-site/web-roles/ to collect id values for all new roles.
6.2 Process Each New Flow
Repeat steps 6.3–6.4 for every new flow in the approved plan.
6.3 Determine Flow API URL
/_api/cloudflow/v1.0/trigger/<workflowEntityId>
6.4 Run the Create Metadata Script
node "${PLUGIN_ROOT}/skills/add-cloud-flow/scripts/create-cloud-flow-metadata.js" \
--projectRoot "<PROJECT_ROOT>" \
--fileSlug "<url-safe-slug>" \
--flowName "<flow-display-name>" \
--flowId "<workflowEntityId>" \
--flowTriggerUrl "" \
--flowApiUrl "/_api/cloudflow/v1.0/trigger/<workflowEntityId>" \
--webRoleIds "<uuid1>,<uuid2>" \
--metadata "<flow-display-name>"
--fileSlug: lowercase display name, special characters replaced with hyphens, max 50 chars.
--flowName: display name written as-is into the name YAML field.
The generated YAML (PAC CLI SPA git format):
adx_*scalar prefix stripped:adx_flowapiurl→flowapiurl,adx_processid→processidadx_cloudflowconsumerid→id;adx_websiteidomitted- M2M key
adx_CloudFlowConsumer_adx_webrolekept as-is statecode/statuscodedefaults omitted; empty strings written as''- Fields alphabetically sorted
6.5 Git Commit
After all YAML files (and any new web roles) are created, do a single git commit. Include the HTML plan file (use the actual output path from the render script's JSON response).
Output: One .cloudflowconsumer.yml per new flow, committed (skipped for integration-only flows)
Phase 7: Client-Side Integration
Goal: Generate typed service code that calls each registered flow from the site's frontend
Cloud flows are invoked via an authenticated POST to /_api/cloudflow/v1.0/trigger/<workflowEntityId>. The request must include a CSRF token fetched from /_layout/tokenhtml, and the payload must be wrapped in an eventData key as a JSON-stringified string.
Actions:
7.1 Discover Existing Frontend Patterns
Use the Explore agent to scan the site:
"Check the Power Pages site frontend for existing patterns. Look for:
- Any existing API service files in
src/shared/,src/services/,src/api/, or similar- Existing CSRF token handling (
__RequestVerificationToken,_layout/tokenhtml)- The framework (React / Vue / Angular / Astro) and its conventions (hooks, composables, services)
- Any existing cloud flow calls (
/_api/cloudflow/) already in the codebase — note which flows are already called and from which pages/components Report all findings."
For integration-only flows, the Explore agent's findings in point 4 are critical — they reveal where the flow is already wired in, so the new integration targets a different page/component without duplicating existing call sites.
7.2 Create or Update the Cloud Flow Service
Do not use the site's existing OData fetch wrapper for cloud flow triggers.
If the site has a centralized API client (e.g.
powerPagesFetch) that targets the Dataverse Web API, do not use it here. Cloud flow trigger URLs (/_api/cloudflow/v1.0/trigger/...) are a different endpoint that does not accept OData-specific request headers. Using an OData wrapper will cause the request to fail.Use direct
fetchor an equivalent low-level HTTP client (for example, Angular'sHttpClient) for cloud flow calls. Do not use any OData-specific wrappers or helpers that automatically add Dataverse Web API headers. You may reuse the site's existing CSRF token helper if one is exported — but perform the HTTP request viafetchor the chosen low-level client directly.
Based on the framework and existing patterns:
If the site already has an API service layer: add the new flow functions to it.
If no service layer exists: create src/services/cloudFlowService.{ts,js} (or framework equivalent).
For integration-only flows: if a trigger function already exists in the service file, do not create a duplicate — reuse it. Only add a new trigger function if the flow has no existing function in the codebase.
Service structure
REQUIRED for every flow trigger call — without these headers the request returns a 500 error:
__RequestVerificationToken: CSRF token fetched from/_layout/tokenhtmlX-Requested-With:XMLHttpRequest
The payload must be wrapped in
eventDataas a JSON-stringified string — this is the shape the Power Pages cloud flow endpoint expects:{ "eventData": "{\"Email\":\"abc@contoso.com\"}" }
The service file must contain a getCsrfToken helper and one trigger function per flow. If a getCsrfToken helper already exists in the codebase, reuse it; otherwise create it. Either way, every trigger function must call it and include both headers shown above.
CSRF helper (reuse existing or create):
async function getCsrfToken(): Promise<string> {
const res = await fetch('/_layout/tokenhtml');
const html = await res.text();
const match = html.match(/value="([^"]+)"/);
if (!match) throw new Error('CSRF token not found');
return match[1];
}
Per-flow trigger function (one per registered flow):
// Trigger: <flow display name>
// API: /_api/cloudflow/v1.0/trigger/<workflowEntityId>
export async function <camelCaseFunctionName>(payload: Record<string, unknown> = {}): Promise<unknown> {
const token = await getCsrfToken();
const response = await fetch('/_api/cloudflow/v1.0/trigger/<workflowEntityId>', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'__RequestVerificationToken': token,
'X-Requested-With': 'XMLHttpRequest',
},
body: JSON.stringify({ eventData: JSON.stringify(payload) }),
});
if (!response.ok) {
throw new Error(`Cloud flow trigger failed: ${response.status} ${response.statusText}`);
}
// 202 Accepted = flow has no Response action (fire-and-forget); 200 OK = flow returns data
if (response.status === 202) return null;
return response.json();
}
Framework-specific patterns:
| Framework | Convention | Output |
|---|---|---|
| React | Custom hook useCloudFlow<Name>() wrapping the service function with loading/error state | src/hooks/useCloudFlow.ts |
| Vue | Composable useCloudFlow<Name>() with ref for loading/error | src/composables/useCloudFlow.ts |
| Angular | Injectable CloudFlowService that wraps the same raw fetch trigger function shown above (do not switch to HttpClient unless you preserve the exact headers and eventData payload shape) | src/app/services/cloud-flow.service.ts |
| Astro | Plain async utility functions (no framework wrapper needed) | src/utils/cloudFlow.ts |
Group all flow functions together in one file. Do not create a separate file per flow.
7.3 Wire into UI
Read the relevant pages/components, add call sites, loading states, success/error feedback. Replace any placeholder or mock handlers that are meant to be backed by the flows.
For integration-only flows, this is the primary deliverable of the entire skill run. Identify the new target page or component where the flow should be integrated (based on the user's request and the scenario from Phase 3.3), import the existing trigger function, and wire it in with proper loading/error handling. Do not modify existing call sites that already work.
7.4 Git Commit
Commit service file and any UI changes.
Output: cloudFlowService.{ts,js} (or equivalent) created/updated, UI wired
Phase 8: Verify & Summarize
Goal: Validate all created YAMLs, record skill usage, present summary, offer deployment
Actions:
8.1 Validate Each YAML
Skip for
integration-onlyflows — their YAML was not created or modified by this run. Only validate YAMLs fornewflows.
For each created .cloudflowconsumer.yml, verify:
-
idis a valid UUID -
processidmatches the flow'sworkflowEntityId -
adx_CloudFlowConsumer_adx_webroleis non-empty - All role UUIDs in the array correspond to existing
.webrole.ymlfiles -
nameequals the flow's display name - No
adx_-prefixed scalar fields (noadx_processid,adx_websiteid,adx_name) -
statecodeandstatuscodeare absent
8.1b Validate Client-Side Integration
Read the service file created in Phase 7 and verify:
- Service file exists at the expected path (e.g.
src/services/cloudFlowService.tsor framework equivalent) - A
getCsrfTokenhelper is present — either defined in the file or imported from another module - Every registered flow has a corresponding exported trigger function
- Each trigger function calls
getCsrfToken()and sets both required headers:__RequestVerificationTokenset to the CSRF token valueX-Requested-With: XMLHttpRequest
- Each trigger function's fetch URL exactly matches
/_api/cloudflow/v1.0/trigger/<workflowEntityId>for the correct flow - The request body wraps the payload as
JSON.stringify({ eventData: JSON.stringify(payload) })— not a bareJSON.stringify(payload) - No OData-specific wrapper (e.g.
powerPagesFetch) is used — rawfetchonly - At least one UI component or page imports and calls the trigger function(s)
If any check fails, fix the issue in the service file or UI before continuing.
8.1c Final site-integrity gate
After all cloud-flow UI integration and skill-specific verification are complete, run:
node "${PLUGIN_ROOT}/scripts/validate-site-integrity.js" --projectRoot "<PROJECT_ROOT>"
Fix every blocking error before presenting completion or asking to deploy. Inspect and report review findings in both directions and with expanded content. Rerun this gate after any later source change.
8.2 Record Skill Usage
Reference:
${PLUGIN_ROOT}/references/skill-tracking-reference.md
Use --skillName "AddCloudFlow".
8.3 Present Summary
| Step | Status | Details |
|---|---|---|
| New flows added | Done / N/A | List each new flow name (or "N/A" if all were integration-only) |
| Integration-only flows | Done / N/A | List each integration-only flow name and target page/component |
| Scenarios | Identified | One line per flow |
| Web roles | Created/Existing/Skipped | List role names (skipped for integration-only) |
| Metadata files | Created/Skipped | List each .cloudflowconsumer.yml path (skipped for integration-only) |
| Client service | Created/Updated | Path to service file |
| UI integration | Done | Components/pages updated (new call sites for all flows) |
| HTML Plan | Created | Actual path from render script output |
8.4 Ask to Deploy
<!-- gate: add-cloud-flow:8.4.deploy | category=plan | cancel-leaves=nothing -->🚦 Gate (plan · add-cloud-flow:8.4.deploy): Post-implementation deploy prompt — flows don't trigger until deployed.
Trigger: All flow YAML + client integration in place. Why we ask: Auto-deploy picks wrong env. Cancel leaves: Nothing — artifacts stay on disk; no deploy fired.
Use AskUserQuestion:
| Question | Options |
|---|---|
| Everything is ready. Deploy the site to make the flows live? | Yes, deploy now (Recommended), No, I'll deploy later |
🚦 Gate (plan · add-cloud-flow:8.4.test): Post-deploy validation prompt — invokes
/test-siteto confirm the flow trigger endpoint returns 202/200.Trigger: Deploy from the previous gate succeeded. Why we ask: Skipping is harmless (manual test still possible); auto-invoking
/test-siteadds runtime and Playwright traffic. Cancel leaves: Nothing — deploy has already completed.
If "Yes": Invoke /deploy-site. After it succeeds, use AskUserQuestion:
| Question | Options |
|---|---|
Would you like to run /test-site to verify the cloud flow integration end-to-end? | Yes, run tests, No, I'll test manually |
If "Yes, run tests": Invoke /test-site with context: test the scenario where the flow API is triggered — perform the action on the site (e.g. submit the form, click the button) that calls /_api/cloudflow/v1.0/trigger/<workflowEntityId>, confirm the request returns 202 Accepted or 200 OK, and check Power Automate run history to confirm the flow executed.
If "No": Remind the user that flows and client-side calls won't work until deployed, and suggest running /test-site later to validate the flow trigger works correctly in the deployed environment.
8.5 Post-Deploy Notes
- Flow trigger URL: Populated automatically by the portal runtime after deploy. Check Power Pages design studio to confirm.
- Testing: Use
/test-siteto verify the integration. Sign in as a user with the assigned role, trigger the flow action, confirm/_api/cloudflow/v1.0/trigger/<id>returns 202/200, and check Power Automate run history. - Anonymous flows: Test in an incognito window.
- Role changes: Edit
adx_CloudFlowConsumer_adx_webrolein the YAML, then redeploy. - Adding more flows later: Run this skill again — new flows are available for full setup, and already-registered flows are available for additional frontend integration on other pages.
Important Notes
Throughout All Phases
- Multiple flows: Process all flows in the approved plan before committing or moving to Phase 7
- Minimum roles: Never assign all roles by default; use only what the scenario requires
- Anonymous Users: Always surface explicitly in plan and confirm step
- Trigger URL blank at creation: Expected — set by the portal runtime at deploy time
- fileSlug vs flowName:
--fileSlugis the filename only;--flowNameis thenameYAML field - Client service file: Group all flows into one service file, not one file per flow; always wire into the UI without asking
- CSRF headers are mandatory: Every flow trigger function must call
getCsrfToken()and send both__RequestVerificationTokenandX-Requested-With: XMLHttpRequest— omitting either causes a 500 error - Payload shape: The request body must be
JSON.stringify({ eventData: JSON.stringify(payload) })— the cloud flow endpoint expects the payload nested under aneventDatakey as a double-stringified JSON string - Integration-only flows: Already-registered flows skip Phases 4–6 (roles and metadata). Their primary deliverable is new frontend call sites in Phase 7. Do not modify existing
.cloudflowconsumer.ymlfiles or web role assignments for these flows. Reuse existing trigger functions when they already exist in the service file — only add new UI call sites. - No flows available: When no flows with a PowerPages trigger exist in the environment (zero results from API), stop the workflow and direct the user to create a flow in Power Automate with the "When a Power Pages flow step is run" trigger first.
Key Decision Points (Wait for User)
- Phase 1.3: Deploy now or cancel (if
.powerpages-sitemissing) - Phase 3.1: Which flows to add or integrate (new and/or already-registered)
- Phase 3.3: Clarify scenario / audience per flow (if unclear)
- Phase 5.3: Approve HTML plan before writing any files
- Phase 8.4: Deploy now or later
Progress Tracking
Before starting Phase 1, create a task list with all phases using TaskCreate:
| Task subject | activeForm | Description |
|---|---|---|
| Verify prerequisites | Verifying prerequisites | Locate project, confirm .powerpages-site, read web roles and existing flows, detect framework |
| List available flows | Fetching cloud flows | Call Flow RP API to get flows with PowerPages trigger |
| Select flows and understand scenarios | Gathering scenario details | User picks one or more flows; determine scenario and function names |
| Determine web roles | Analyzing role requirements | Propose minimum roles per flow with per-role reasoning |
| Review plan | Reviewing plan with user | Render HTML plan for all flows and get approval |
| Create metadata | Writing cloud flow metadata | Create missing web roles then write YAML for each flow |
| Client-side integration | Generating client-side code | Create typed service functions and wire into UI |
| Verify and summarize | Validating and summarizing | Validate YAMLs, record skill usage, present summary, offer deployment |
Mark each task in_progress when starting and completed when done via TaskUpdate.
Begin with Phase 1: Verify Prerequisites
FAQ
What does the add-cloud-flow skill do?
Integrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional pages without re-creating metadata. Use when the user wants to add, connect, register, or link a Power Automate cloud flow to their site.
How do I install add-cloud-flow?
Run npx skills add https://github.com/microsoft/power-platform-skills --skill add-cloud-flow in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/add-cloud-flow/ (personal) or .claude/skills/add-cloud-flow/ (project).
Which AI agents can use add-cloud-flow?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is add-cloud-flow safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains add-cloud-flow?
It is published by microsoft in microsoft/power-platform-skills, and it is an official skill from the maker of the technology it covers. It has 226 recorded installs.
More from microsoft/power-platform-skills
add-sharepoint
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
create-code-app
microsoft/power-platform-skills
Creates Power Apps code apps using React and Vite. Use when building code apps, scaffolding projects, or deploying to Power Platform.
add-dataverse
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
configure-canvas-mcp
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
add-office365
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
canvas-app
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。