Level 200About 45 minutesAdapted November 2026

Cloud flow foundations: order approval

Build an Order Automation cloud flow that runs when a Northwind Traders order is set to New, totals the line items, routes a two-tier approval, and creates an invoice in Dataverse when the order is approved.

IGOE AI learning resource. This is an independent adaptation of a Microsoft workshop lab, not official Microsoft courseware and not a promise of course inclusions.

Adapted from the official lab

Original Power CAT lab

Adapted from Automation: Cloud Flow (Foundations) in Microsoft's Apps and Agents workshop (Power Series labs), built by Microsoft's Power CAT team. Source: https://microsoft.github.io/apps-agents-workshop/labs/lab.html?path=automation-01-cloud-flow%2F01-cloud-flow.md&branch=main.

The lab documentation is licensed under CC BY 4.0. Copyright Microsoft Corporation. The licence text is in the repository LICENSE-DOCS file.

IGOE AI adapted it into this UK follow-along checklist, including wording changes, a progress checklist, and this page layout. This is not an official Microsoft page and is not endorsed by Microsoft.

0 of 0 steps complete

What you will build

A published Power Automate cloud flow called Order Automation, organised in a solution, with manager approval above 1,000 USD and executive approval above 10,000 USD. If an approver rejects the order, the flow stops. After approval, the flow creates an invoice.

  • Time needed: About 45 minutes.
  • Who it is for: Power Platform makers.
  • Environment: Use a sandbox or developer environment. This official lab is written for the Northwind Traders sample, so the checklist keeps that data model and those order thresholds.

Licences and prerequisites

A Power Platform environment with maker access, Dataverse, and the Northwind Traders sample (orders and order details). Access to Power Automate at make.powerautomate.com. Approver accounts or test users as the official lab describes in its steps. Shared workshop prerequisites: labs/prereqs.md. Shared sample setup: solutions/README.md.

Labs that use generative AI can look different from the screenshots. If the result varies, complete the task from the intended outcome and the UI you see, as the official workshop notes.

Follow the lab

Work through the official steps below as a checklist. Tick each step as you finish it. Your progress is saved in this browser on this device only. Use the reset button to start again. Each step has a stable address such as https://igoe.ai/learn/apps-agents-workshop/cloud-flow/#step-1 so a video can link to it.

Overview

In this module, you build an automated order approval process for Northwind Traders using a Power Automate cloud flow. The flow runs when an order is set to New, calculates the total order value from its line items, and routes it through a two-tier approval: orders above 1,000 USD require manager approval, and orders above 10,000 USD also require executive approval. If any approver rejects the order, the flow stops immediately. When the order is approved, the flow creates an invoice in Dataverse.

Why this matters

Manual approval routing slows order processing and introduces risk when emails are missed or follow-up is delayed. A cloud flow standardizes the approval path, enforces thresholds consistently, and creates invoices automatically after approval so sales operations can move faster with fewer manual steps.

Scenario

Northwind Traders needs to automate order approvals based on total order value. Orders over 1,000 USD require manager approval, and orders over 10,000 USD require an additional executive approval. Rejected orders should stop immediately, and approved orders should create an invoice in Dataverse.

Core concepts

  • Dataverse event triggers for automated cloud flows.
  • OData filtering to read related row data.
  • Variables, loops, and expressions for value calculation.
  • Conditional branching for multi-tier approvals.
  • Dataverse row creation for downstream business records.

Learning outcomes

By the end of this module, you will:

  • Create an automated cloud flow triggered by Dataverse events.
  • Read and filter related Dataverse rows with OData expressions.
  • Use variables, loops, and expressions to transform data.
  • Build a conditional, multi-tier approval process that respects approval outcomes.
  • Write data back to Dataverse from a flow.
  • Organize a flow into a solution, publish it, and test both the approval and rejection paths.

Prerequisites

This lab is self-contained, you do not need to complete any other module first.

  • A Power Platform developer environment where you have maker permissions. See Create a developer environment. For what the Dataverse and Power Automate capabilities in this lab require, refer to the Power Platform licensing documentation.
  • The Northwind Traders solution imported into that environment and seeded with sample data. Follow the import and Northwind Sample Data app steps in solutions/README.md.
  • An email-capable account to receive approval requests. Two accounts (or two designated participants) are ideal so approvals land in a different mailbox.

Tip: One account works too. Assign both approvals to yourself and respond to every request from your own mailbox, the Approvals app in Microsoft Teams, or the Power Automate Approvals center.

  • A modern browser such as Microsoft Edge or Google Chrome.

Lab instructions

Create the flow and configure the trigger

Creating a flow from the Power Automate portal opens the modern designer, vertical action cards, a (+) button between actions, a configuration pane on the side, and built-in Copilot assistance. This lab’s screenshots and layout descriptions follow the modern designer, and every expression is provided as copyable text, so nothing here requires Copilot.

Checkpoint: Your trigger shows Modified, Orders, User, and the filter expression.

Trigger configured with change type Modified, table Orders, scope User, and the order status filter
Figure: The completed trigger configuration.

The flow now runs whenever an order’s status is set to New. Any later change you save to an order that is still New runs the approval again, that is intended, so changes to a pending order are re-approved. A cloud flow needs a trigger and at least one action before it can be saved, so keep the designer open and continue to Step 2.

Read the order details

The Orders table has no total value column. Each order’s value lives in its related Order Details rows, one row per line item, each with a Unit Price and a Quantity. In this step, the flow retrieves the line items that belong to the order that triggered it.

Checkpoint: The flow saves without errors, and List Order Details shows the Order Details table and the filter expression.

Calculate the order value

Each line item’s value is Unit Price × Quantity, and the order’s total is the sum across all line items. In this step, the flow tallies that total into a variable.

Cloud flow expressions use Power Automate expression functions such as mul(), similar in spirit to Excel formulas.

Checkpoint: Calculate Order Value loops over List of items and contains Increment Order Value with the mul() expression. After the loop runs, Order Value holds the full value of the order.

The completed Calculate Order Value loop containing the increment action
Figure: Tallying the order total across all line items.

Build the approval process

Orders above 1,000 USD require manager approval, and orders above 10,000 USD also require executive approval. A rejection at either tier must stop the flow, no further approvals, and no invoice.

The Manager Approval Required condition comparing Order Value to 1000
Figure: Checking whether manager approval is needed.

Checkpoint: Inside Manager Approval Required > True, you have in order: Manager Approval, Check Manager Outcome (with Terminate in False), and Executive Approval Required, whose True container holds Executive Approval and Check Executive Outcome (with Terminate in False).

Flow canvas showing the nested approval structure with outcome checks and terminate actions
Figure: The complete two-tier approval structure with rejection handling.

Power Automate approvals wait for a response for a maximum of 28 days.

Create the invoice

When the flow reaches the end without being cancelled, the order is approved (or small enough not to need approval), so the flow creates the invoice.

Checkpoint: Create Invoice sits at the top level after all conditions and writes Amount Due, Due Date, Invoice Date, and Order.

The complete Order Automation flow from the trigger through the approvals to Create Invoice
Figure: The end-to-end flow.

Orders of 1,000 USD or less skip both approval branches and arrive here directly, small orders are invoiced without any approval, by design.

Organize the flow into a solution

Solutions group your components so they can be managed, exported, and deployed together, the foundation of application lifecycle management on Power Platform. Your flow works without one, but bringing it into a solution is how real projects stay deployable.

The New solution pane with the display name and default publisher
Figure: Creating the solution.

The Add existing cloud flow picker with Order Automation selected
Figure: Adding the existing flow to the solution.

Checkpoint: Order Automation appears in the solution’s objects. Open the flow’s details page and confirm the connection is listed under Connection references.

The solution objects list showing the Order Automation cloud flow
Figure: The flow organized into a solution.

Now that the flow is in a solution, it is solution-aware: the designer shows separate Save draft and Publish buttons, and it keeps a version history in Dataverse. See Appendix A: Version control for cloud flows.

Publish and test

Checkpoint: The run completes successfully. To confirm the invoice, open your order in the Northwind Orders (Model-driven) app and use its Related tab to view the linked invoice directly, check the amount and dates match. Then open the flow’s run history from its details page, open the run, and inspect each action’s inputs and outputs, this is how you diagnose flows when something goes wrong.

The flow run with every action succeeded
Figure: The successful end-to-end run.

The new invoice row in the Invoice table, linked to the order with the correct amount and dates
Figure: The approved order produced an invoice.

Checkpoint: In the run history, the run ends at End Flow - Manager Rejected with status Cancelled. No executive email was sent, and no new invoice was created.

Run history showing the rejected order's run ending at the terminate action with status Cancelled
Figure: A rejection cancels the run before any invoice is created.

Congratulations, you built, organized, published, and tested a complete two-tier order approval automation, including its failure path.

Challenge: extend the flow

The requester never hears the outcome. Extend the flow so they do: in the True container of each outcome condition, and alongside each Terminate, add a Send an email (V2) action that tells the requester whether the order was approved or rejected, and include the approval’s Comments dynamic value so a rejection carries the approver’s reasoning. See add an email action for approvals for the documented pattern.

Appendix A: Version control for cloud flows

Once your flow lives in a solution (Step 6), Power Automate keeps a draft/published version history for it in Dataverse. This lets you evolve the flow safely and refer back to, or restore, an earlier published version. (This applies to solution-aware cloud flows in the modern designer only.)

Save draft vs Publish

Action What it does
Save draft Saves your changes to Dataverse without affecting runtime, you can save even with errors and keep working at your own pace. The flow shows a Draft state next to its title.
Publish Makes the current version take effect at runtime. The flow shows a Published state. Runs always use the last published version, so draft edits never change live behaviour until you publish.

The state indicator (Draft / Published) next to the flow title tells you whether the version you’re looking at is live or has unpublished changes.

Version history, reviewing and referring to versions

As you publish, a version history builds up in Dataverse. Open the flow in the designer and select Version history to open the panel. Versions are grouped by day and tagged with Latest version, Published, and Past published indicators, so you can tell which one is live and which were previously published.

  • Refer to a version: versions are distinguished by timestamp (each also has an internal GUID). Select a version to review it.
  • Compare versions: open two versions in succession, or in separate browser tabs, a side-by-side view isn’t available.
  • Restore a version: select a previous version > Restore > confirm. It becomes the latest draft, which you can then publish.
  • Co-owners see the full history from every user, not just their own changes.

Why versioning needs a solution: Drafts and version history are stored in Microsoft Dataverse, and only solution-aware cloud flows are defined in Dataverse, so only they can keep a Save draft / Publish split and a version history. A non-solution (“My flows”) flow isn’t backed by that Dataverse storage: it has a single definition you update with one Save, with no separate draft or version history. To get versioning for such a flow, add it into a solution (Step 6), that writes its definition into Dataverse so versions can be kept.

Good to know

  • Retention: draft records expire after 6 months; published records after 12 months.
  • Export: only the last published version is exported in a solution, drafts and history aren’t.
  • Testing: drafts can’t be tested directly, publish a change before testing it at runtime.
  • Notes/titles on individual versions aren’t supported yet.

Learn more: Drafts and versioning for solution-aware cloud flows · Explore the cloud flows designer

Appendix B: Ways to test the flow

This flow uses an automated Dataverse trigger, it runs when an order’s status is set to New and saved. You can exercise it two ways; both use the same input (saving a New order).

Just perform the scenario: create an order, add its line items, set Order Status to New, and Save. The published flow picks up the change on its own and runs in the background. This is how the flow behaves in real use.

Option 2, Manual test (live run view)

Use this when you want to watch the run happen as you save the order:

A manual test doesn’t bypass the trigger, this trigger needs a real Dataverse change, so you still create a New order to start it. Test > Manually just gives you the live run view while it happens. To inspect a run after the fact instead, open the flow’s run history from its details page.

Drafts can’t be tested, only a published version runs, so publish any change before testing it (see Appendix A).

Learn more: Explore the cloud flows designer, Test

Appendix C: Secret handling in cloud flows, mechanisms explained

Cloud flows deal with secrets in three ways: authenticating to services (the connections a flow uses), secrets or config the flow reads or passes at runtime, and masking sensitive values in run history. They are layered, not interchangeable, and Azure Key Vault is the secure foundation the strongest options build on. (These capabilities evolve quickly, always confirm against the latest product releases and the linked Microsoft Learn docs.)

At a glance

# Mechanism Used for Secure storage Rotation-friendly Shareable? Scope Best for
1 Connection / connection reference Authenticating the flow to a service (SharePoint, Outlook, SQL, Dataverse…) Token/secret held by the connection (OAuth / API key) High for OAuth (auto-refresh) Co-owners can use embedded connections but can’t edit another owner’s credentials; a shared connection works only in the flow it was created in; Send a copy shares none; connections aren’t in solutions (re-provided on import) Connection / connection reference (ALM) Standard service auth
2 Environment variables (Secret type) Config/secrets across dev/test/prod Value in Azure Key Vault; Dataverse holds a pointer High, rotate once in Key Vault Yes, travels in the solution (the reference); value stays in Key Vault Environment / solution (ALM) Secrets carried with a solution
3 Azure Key Vault connector (Get secret) Fetching a secret at runtime in the flow Value in Azure Key Vault, retrieved on demand High, rotate in Key Vault Shared via its connection (row 1 rules); the secret stays in Key Vault (RBAC) Flow run (secret in Key Vault) Reading a secret mid-flow
4 Secure inputs / Secure outputs (action setting) Masking secrets/PII in run history N/A, hides values in run history and logs N/A Travels with the flow definition (incl. Send a copy) Action Keeping secrets out of run history
5 Desktop-flow (machine) connection When a cloud flow runs a desktop flow (Run a flow built with Power Automate for desktop), signs in to the target machine Machine sign-in via a desktop-flow connection (Saved credential / Manual entry / Connect-with-sign-in) Depends on method, High with a Key Vault-/CyberArk-backed Saved credential Desktop-flow connection sharing is limited (service-principal users) Connection (machine) Cloud→desktop RPA hand-off
6 Azure Key Vault The foundation for rows 2 to 3 (and Saved credentials in row 5) Enterprise store (RBAC, audit, HSM option) ⭐ Highest, versioning + rotation policies Via Azure RBAC, grant identities/groups Tenant / subscription The secure backing store

How to read it

  • Three jobs: service auth (row 1), secrets the flow reads or passes (rows 2 to 3, 5), and not leaking them (row 4); row 6 is the vault behind the rest.
  • Connections don’t travel freely, a shared connection works only in the flow it was created in, and co-owners can’t change another owner’s credentials. That’s why Key Vault-backed secrets (rows 2, 3, 6) are the team-friendly path: you share a reference, and access is governed by Key Vault RBAC.
  • Run-only users (instant flows): choose whether they bring their own connection or reuse the flow’s.
  • Always turn on Secure inputs / Secure outputs (4) for any action that handles a raw secret.

🔗 The cloud to desktop bridge

Row 5 is where the two products meet: a desktop-flow (machine) connection isn’t only a desktop-flow concept, it’s also a cloud-flow connection, because a cloud flow authenticates to the target machine through it when it calls Run a flow built with Power Automate for desktop. For the full machine-credential model, Saved credential, Manual entry, and Connect-with-sign-in (passwordless), see the desktop-flow secret matrix: Module 6 · Appendix E: Credentials and secrets in desktop flows.

  • Service calls → connections / connection references (OAuth where possible; connection references for ALM).
  • Secrets the flow needs → store in Azure Key Vault, surface via a Secret environment variable or the Key Vault connector, never hard-code.
  • Everywhere a secret flows → enable Secure inputs / Secure outputs.
  • Cloud→desktop hand-off → use a Key Vault-/CyberArk-backed Saved credential on the desktop-flow connection (see the linked Module 6 appendix).
  • Foundation → a per-environment Azure Key Vault with least-privilege RBAC and rotation; promote references, never secrets.

Learn more: Explore the cloud flows designer (Secure inputs/outputs) · Environment variables for Azure Key Vault secrets · Use a connection reference in a solution · Share a cloud flow · Azure Key Vault overview

Appendix D: Tracking automation value & savings

Once your flow is live, you’ll want to show the value it delivers. Power Automate has this built in, start there. Only add a custom log when you need a metric the built-in feature can’t express.

Power Automate can calculate how much time and money a cloud flow saves, with no custom components. You attach a saving rule to the flow, and every successful run contributes to its savings.

Set it up:

See the results, this is your centralized view:

  • A Savings card appears on the flow’s details page.
  • Select See trend to open the Automation Center → Savings pane, which rolls up the trend for this flow and all other flows in the environment, the built-in, cross-flow ROI dashboard.

Good to know:

  • Only solution-aware cloud flows can have saving rules (so add the flow to a solution first, see Appendix A).
  • Money amounts are rounded (no decimals); an admin can disable the money rule environment-wide.
  • Not available in Dataverse for Teams environments.
  • Viewing/editing rules needs privileges on the Saving Rule and Flow Aggregation tables (the Environment Maker role has them).

Learn more: Savings in Power Automate · Explore the automation center

Part 2, Extend with a custom Dataverse log (only for what the built-in can't capture)

The built-in rule is a flat, per-successful-run baseline limited to time and money. Reach for a custom log only when you need something it can’t express:

  • Per-run, data-driven value, value that varies by what a run actually processed (e.g., this run imported an order worth 12,000 USD / 2 line items, not a fixed figure).
  • Metrics beyond time/money, records processed, errors/rework avoided, revenue handled, SLA adherence, custom categories.
  • One store across products and environments, cloud flows and desktop flows and Copilot Studio agents, or a cross-environment/tenant rollup.
  • Feeding an external system (finance/BI) in a custom shape.

If none of these apply, stop at Part 1, a custom log would just duplicate the built-in feature.

When they do apply, record the extra detail in a central Dataverse table, scalable, relational, RBAC-secured, and reportable in Power BI, with every solution writing to the same table:

1. Create an “Automation Value Log” table (in a shared solution) with columns such as:

Column Type Example
Automation / solution Text or Choice Order Automation
Process step Text Legacy order import
Run ID Text correlation ID from the run
Business value Currency 12000 (actual order value)
Records processed Whole number 2
Metric category Choice Revenue / Records / Error avoided
Source key Text order number + run ID (for idempotency)
Logged on Date/Time run timestamp
Environment Text dev / test / prod

2. Write to it from the flow, one action. After Create Invoice, add an Add a new row action (the same Dataverse action from Step 5) targeting Automation Value Log, and populate the data-driven values, for example, Business value = Order Value and Records processed = the line-item count. This captures what the built-in per-run baseline can’t.

3. Write from anywhere, any Power Platform surface. Because it’s a Dataverse table, anything that can write to Dataverse can log to it with the same columns: cloud flows (Add a new row), desktop flows (Add a new row to selected environment), Power Apps (Patch / a form), Copilot Studio agents, and even direct API/SDK callers. Point every automation and app at the same table, so custom value from all solutions and surfaces aggregates in one central place, no per-product silos.

4. Report and scale. Build a Power BI report or model-driven view over the table; add row-level security so teams see only their rows, and check the Source key before inserting to stay idempotent on re-runs.

Together: Part 1 gives the effortless, centralized time/money ROI; Part 2 adds business-specific, per-run value only where you need it, the two complement each other rather than compete.

Learn more: Create and edit Dataverse tables · Microsoft Dataverse connector reference

Continue to Module 2: RPA to extend this automation with Power Automate Desktop.

What is likely to go wrong

SymptomLikely causeWhat to try
You cannot find the sample app, tables or orders.The Northwind Traders solution is missing, or you are in the wrong environment.Check the environment picker, then import and seed the sample using the official solutions README.
A feature or preview button is missing.The environment region, early release setting, or a required role is not in place.Compare your environment with the official prerequisites for this lab, including early release and Copilot Studio Authors where the source lab requires them.
A connector or flow asks for a licence.The account is missing a required licence, such as Outlook for the supervised-agents lab, or a premium connector.Use a licensed test account in the sandbox, or follow the official trial steps if the source lab includes them. Do not run this in production to work around a licence gap.
A flow, workflow or agent run fails on the first test.A connection is not signed in, or sample data does not match the filter in the step.Open connections and sign in, then check the record values against the official filter or test data.
Generated wording or a chart looks different from a screenshot.Generative AI results vary, as the official workshop says.Judge the result against the intended outcome and continue if the task is complete.

Open the original Power CAT lab if a UI name has changed, and use what you see on screen rather than inventing a missing click.

Join the free monthly webinar. A 40-minute live taster on Microsoft Teams.

See where your organisation stands

Complete the short AI and automation scorecard. Your answers stay in your browser. Nothing is sent or stored, and there is no email sign-up.