The flow failed to access the value for {!variable} because it hasn't been set or assigned
A flow tried to read a variable that no element ever wrote to. Either an upstream Get Records returned nothing (so the result variable stayed null), or a path through the flow skipped the assignment that was supposed to populate it.
Also seen asThe flow failed to access the value for·hasn't been set or assigned·FLOW_ELEMENT_ERROR variable·flow variable not set
The literal cause is straightforward — a flow read a variable that was never assigned. The interesting part is why, and there are two fingerprints.
Fingerprint A: the empty Get Records
A "Get Records" element, by default, gives you a single record (or a collection, if you configured it that way). If the query matches zero rows, the result variable stays null. The next element that does {!Get_Account.Name} blows up because {!Get_Account} itself is null — there's no Name on null.
Fix: add a Decision element right after the Get, with an outcome "Did we find one?" that tests {!Get_Account} Is Null False. Route the null branch to a fault handler or a default.
Fingerprint B: a conditional path that skips the assignment
You have two branches:
- Branch 1: assigns
{!myFlag}to True - Branch 2: doesn't assign anything
Then both branches converge into a Decision that reads {!myFlag}. Branch 2 reaches the Decision with the variable still unset. Boom.
Fix: every branch that converges back must either assign the variable, or you must initialise the variable at the top of the flow with a default value. The platform doesn't auto-initialise.
How to debug it without guessing
- Open the flow in Flow Builder → Debug (top right).
- Pick the inputs that triggered the failure.
- Step through; the right-hand panel shows variable values as they're assigned.
- The element that the debug output stops at, or the variable that stays "Not set," is your culprit.
For record-triggered flows that aren't easy to invoke from Debug, the Flow Trigger Explorer (Setup → Process Automation Settings) can replay an interview from a real record's history.
A defensive habit
Default-initialise any variable you read in more than one path. Put an Assignment element at the very start of the flow that gives every variable a known value (false, 0, empty string, empty collection). It costs you one element and immunises you against this entire class of error.
