Skip to content

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.

Citizen Development Academy Updated 4 min read
Power Automate Compose Action: What It Does 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.

ComposeVariable
Set upNone; you just add the actionRequires an Initialize variable action first
Can it change?No, the value is fixed when the action runsYes, update it with Set variable or Increment variable
PlacementAnywhere in the flowInitialize variable sits at the flow’s top scope, not inside a loop or condition
Best forA value or expression you compute once and reuseA 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.

  1. Add a Compose action and, in Inputs, enter (or reference) the array, for example [0,1,2,3,4,5,6,7,8,9].
  2. Rename the action to something memorable (click the title and type, for example, Compose digits), so later references read clearly.
  3. 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:

  1. Drop a Compose action at the point you are unsure about.
  2. Put the value or expression in its Inputs and run the flow.
  3. 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 7 tells you nothing six steps later; Compose full name does. The name is also what outputs() 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() or float().
  • 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