Variables are great. But a lot of people reach for them out of habit when they only need to store or build a value once and reference it later. Use a Compose instead.
WHAT IS COMPOSE
Compose is an action that takes any input, a value, an expression, or a combination of both, and outputs it for you to reference elsewhere in your flow. No initialising, no setting, no type to declare. You just put the value in and use it.
WHY COMPOSE OVER A VARIABLE
Variables have to be initialised at the top of your flow before you can use them. That is an Initialize Variable action, then a Set Variable action where you actually need it. Two actions. Compose is one action placed exactly where you need it.
Fewer actions means fewer API calls to the Power Automate runtime on every single run. For a value you only need to build once, a Variable is unnecessary overhead.
Compose also accepts anything. String, integer, object, expression. No type to declare and no type mismatch errors to debug later.
WHERE VARIABLES STILL WIN
If you need to update a value inside an Apply to Each loop, you need a Variable. Compose outputs are fixed once the action runs. You cannot overwrite a Compose mid-flow the way you can with a Set Variable action.
The rule of thumb is simple. If you are setting something once and referencing it later, use Compose. If you need to update a value as your flow progresses, use a Variable.
Have you been initialising Variables at the top of every flow? Drop a comment below.