Power Automate Compose Action: What It Does and When to Use It
The Compose action in Power Automate holds one value or expression output for reuse. What it does, how it differs from variables, and when to use it.
In this article · 10 sections
The Compose action does one thing: it takes an input (a value or an expression), evaluates it, and produces a single output you can reference later in the flow. That is what lets you calculate a value once and reuse it, simplify a tangled expression, or inspect exactly what your data looks like mid-flow. This guide covers what Compose does, how it differs from variables, a worked example, and when to reach for it.
Updated June 2026 against Microsoft’s data operations guide.
What the Compose action does
Compose is one of Power Automate’s Data Operation actions, the family that also includes Filter array, Select, Join, Parse JSON, and Create HTML or CSV table. Compose’s job is the simplest of the group: take whatever you put in its Inputs field, evaluate it, and hold the result as that step’s output.
That input can be:
- a plain value (a string, a number, an array, a JSON object),
- a piece of dynamic content from an earlier step, or
- an expression such as
concat(triggerBody()?['First'], ' ', triggerBody()?['Last']).
Once a Compose action has run, you reference its result anywhere downstream by picking it from the dynamic content list, or with the expression outputs('Compose') (using whatever you named the action). The value is fixed the moment the action runs; Compose does not change it again.
Compose versus variables
Both seem to store data, so they get mixed up. The real difference is whether the value changes.
| Compose | Variable | |
|---|---|---|
| Set up | None; you just add the action | Requires an Initialize variable action first |
| Can it change? | No, the value is fixed when the action runs | Yes, update it with Set variable or Increment variable |
| Placement | Anywhere in the flow | Initialize variable sits at the flow’s top scope, not inside a loop or condition |
| Best for | A value or expression you compute once and reuse | A running total, a flag, or anything you update as the flow loops |
The rule of thumb: use Compose for a value that does not change, and a variable for one that does. There is no “Set Compose” action, so a Compose cannot accumulate a value across loop iterations; for a running total inside a loop, initialize a variable and use Increment variable or Set variable. If you find yourself wanting to update a Compose output, that is the signal you actually wanted a variable; if you are duplicating the same long expression in several places, that is the signal you wanted a Compose.
A worked example
Say a flow receives an array and you need it joined into one comma-separated string for an email. You can hold the array in Compose, then feed its output to a Join action.
- Add a Compose action and, in Inputs, enter (or reference) the array, for example
[0,1,2,3,4,5,6,7,8,9]. - Rename the action to something memorable (click the title and type, for example,
Compose digits), so later references read clearly. - Add a Join action. In its From field, select the Compose output, referenced as
outputs('Compose_digits')(spaces in the action name become underscores in the expression), and set Join with to a comma.
The Join action now turns the stored array into the string 0,1,2,3,4,5,6,7,8,9. The value only had to be defined once, in the Compose step, and any later action can read it.
Compose for debugging
Because Compose just evaluates and holds whatever you give it, it is the fastest way to see what an expression or a piece of dynamic content actually produces:
- Drop a Compose action at the point you are unsure about.
- Put the value or expression in its Inputs and run the flow.
- Open the run history, click the Compose step, and read its exact output.
It is the print statement of Power Automate: a low-risk way to inspect data without changing how the flow behaves. One caveat: whatever you put in a Compose is stored in plaintext in the run history, so do not use it to inspect passwords, tokens, or other secrets.
Best practices
- Name every Compose action.
Compose 7tells you nothing six steps later;Compose full namedoes. The name is also whatoutputs()references. - Use it to simplify, not to multiply. One Compose that holds a reused expression makes a flow clearer. A dozen Compose actions chained together makes it harder to follow than the expression would have been. If a variable or a single expression does the job, use that instead.
- Mind the data type. Compose holds whatever type you give it. If a later action expects a number and the Compose output is a string, convert it deliberately with
int()orfloat(). - Plan for failure. A Compose referencing an earlier action’s output fails if that action did not run or returned an unexpected shape. Add error handling (configure run-after, or a parallel branch) where that matters.
Frequently asked questions
Can you update a Compose action’s value later in the flow?
No. A Compose output is set when the action runs and cannot be changed afterward. If you need a value that updates as the flow runs, initialize a variable and use Set variable or Increment variable instead.
How do I reference a Compose action’s output?
Select it from the dynamic content list when configuring a later action, or use the expression outputs('<Compose action name>'), for example outputs('Compose_digits'). Spaces in the action name become underscores in the expression.
Is Compose the same as a variable?
No. Both hold data, but a variable must be initialized and can be updated throughout the flow, while a Compose value is fixed once and needs no initialization. Use Compose for static values and variables for ones that change.
Is Compose a data operation?
Yes. Compose is one of the Data Operation actions in Power Automate, alongside Filter array, Select, Join, Parse JSON, and the Create HTML and CSV table actions.
To go from wiring up single actions to designing complete, maintainable flows, our Power Automate training covers data operations, expressions, and error handling in depth.
Stay in the loop
Get new posts delivered to your inbox. No spam, unsubscribe anytime.
Related articles
Free Power Automate Training: Where to Actually Start in 2026
Genuinely free Power Automate training: official Microsoft Learn paths, free hands-on practice, free guides, plus an honest note on where free stops.
Power Automate for Outlook: Triggers, Actions, and Patterns (2026)
Power Automate for Outlook: the email and calendar triggers and actions that matter, copy-ready flow patterns, and the limits that quietly break inbox flows.
Power Automate for Teams: Triggers, Actions, and Patterns (2026)
Power Automate for Microsoft Teams: posting messages and approval cards, the triggers that start a flow, copy-ready patterns, and the limits to plan around.