You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TestState does not report variables assigned by the state under test
Is there an existing issue for this?
I have searched the existing issues
Summary
The Step Functions TestState API returns inspectionData.variables containing only the
variables supplied in the request's variables parameter. Variables the state under test
assigns via Assign are missing. AWS returns the post-state set — request variables merged
with everything the state assigned.
JSON string that contains the set of workflow variables after execution of the state. The
set will include variables assigned in the state and variables set up as test state input.
The returned string preserves the request payload's whitespace verbatim
({"fromInput": "kept"}), which suggests the request parameter is echoed back rather than the
post-state environment being serialized.
Affects both JSONata and JSONPath states.
Environment
LocalStack 2026.8.0:ad728e1ae (localstack/localstack-pro:latest), pro edition, licensed.
Also reproduced on 2026.7.0.dev21:0e6b6e128.
The same request with the value moved into Output returns it correctly
({"fromInput": "kept", "assignedHere": 42}), so the evaluation is fine — only the reporting of
assignments is not.
Scope: the assignment itself works
Only TestState's reporting is affected — a real execution propagates the assigned variable
correctly, so this is not a gap in Assign support:
#13215 reported request variables not being interpolated at all, fixed by #13827 ("Set
variables from API call parameter to test state execution environment"). That fixed the read
path — {% $fromInput %} now resolves. This report is the write-back path, which #13827 did not
cover. #13215 does note "variables is null in inspectionData" in passing, but its repro and
fix are both about reading request variables.
Impact
It fails silently rather than erroring, which makes it worse than an unsupported feature. A test
that exercises an Assign expression and asserts on inspectionData.variables reads its own
input back and passes — hiding both a broken expression and this gap.
We hit it with a JSONata expression stamping {$states.context.State.Name: $now()} into an
accumulating variable. The probe passed against real Step Functions and "passed" against
LocalStack while reporting one key where two were expected; it only surfaced because the
assertion happened to check the key count. Every JSONata feature involved — $now(), $states.context.State.Name, computed object keys, $merge — works correctly on LocalStack.
Expected
inspectionData.variables should contain the workflow variables after the state executes:
request-supplied variables merged with those the state assigns.
Workaround
Evaluate the expression through Output rather than Assign and read the response's output
field; that path is correct on LocalStack.
full disclosure: this report was written by/with Claude but I believe it's correct
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TestStatedoes not report variables assigned by the state under testIs there an existing issue for this?
Summary
The Step Functions
TestStateAPI returnsinspectionData.variablescontaining only thevariables supplied in the request's
variablesparameter. Variables the state under testassigns via
Assignare missing. AWS returns the post-state set — request variables mergedwith everything the state assigned.
Per the AWS API reference for
InspectionData.variables:The returned string preserves the request payload's whitespace verbatim
(
{"fromInput": "kept"}), which suggests the request parameter is echoed back rather than thepost-state environment being serialized.
Affects both JSONata and JSONPath states.
Environment
localstack/localstack-pro:latest), pro edition, licensed.Also reproduced on 2026.7.0.dev21:0e6b6e128.
Minimal reproduction
LocalStack — the assignment is absent:
Real AWS, same call:
Identical divergence with JSONPath, so it is not specific to the JSONata evaluator:
--definition '{"Type":"Pass","Assign":{"assignedHere":42},"End":true}'The same request with the value moved into
Outputreturns it correctly(
{"fromInput": "kept", "assignedHere": 42}), so the evaluation is fine — only the reporting ofassignments is not.
Scope: the assignment itself works
Only
TestState's reporting is affected — a real execution propagates the assigned variablecorrectly, so this is not a gap in
Assignsupport:Relation to existing issues
#13215 reported request
variablesnot being interpolated at all, fixed by #13827 ("Setvariables from API call parameter to test state execution environment"). That fixed the read
path —
{% $fromInput %}now resolves. This report is the write-back path, which #13827 did notcover. #13215 does note "
variablesis null ininspectionData" in passing, but its repro andfix are both about reading request variables.
Impact
It fails silently rather than erroring, which makes it worse than an unsupported feature. A test
that exercises an
Assignexpression and asserts oninspectionData.variablesreads its owninput back and passes — hiding both a broken expression and this gap.
We hit it with a JSONata expression stamping
{$states.context.State.Name: $now()}into anaccumulating variable. The probe passed against real Step Functions and "passed" against
LocalStack while reporting one key where two were expected; it only surfaced because the
assertion happened to check the key count. Every JSONata feature involved —
$now(),$states.context.State.Name, computed object keys,$merge— works correctly on LocalStack.Expected
inspectionData.variablesshould contain the workflow variables after the state executes:request-supplied variables merged with those the state assigns.
Workaround
Evaluate the expression through
Outputrather thanAssignand read the response'soutputfield; that path is correct on LocalStack.
full disclosure: this report was written by/with Claude but I believe it's correct
All reactions