Repository navigation
Description
StartSyncExecution refuses a STANDARD state machine with InvalidDefinition, a code its page does not publish, where AWS names StateMachineTypeNotSupported.
Surfaced while implementing #912. The ARN resolution in startSyncExecution is fixed there; the two InvalidDefinition answers are not, because the code is wrong for a different reason and the fix has its own acceptance criteria.
What AWS publishes
API_StartSyncExecution lists nine errors, in full:
| Code | Status |
|---|---|
InvalidArn |
400 |
InvalidExecutionInput |
400 |
InvalidName |
400 |
KmsAccessDeniedException |
400 |
KmsInvalidStateException |
400 |
KmsThrottlingException |
400 |
StateMachineDeleting |
400 |
StateMachineDoesNotExist |
400 |
StateMachineTypeNotSupported |
400 |
InvalidDefinition is not among them, and neither is ValidationException. StateMachineTypeNotSupported — "State machine type is not supported." — is the code for the case substrate is answering, and the page states the restriction outright:
StartSyncExecutionis not available forSTANDARDworkflows.
What substrate answers today
startSyncExecution (emulator/stepfunctions_plugin.go) answers InvalidDefinition/400 twice:
- When
sm.Type != "EXPRESS", with the message "StartSyncExecution is only supported for EXPRESS workflows" — the right refusal under the wrong code. A consumer branching on the code sees a claim about the ASL document, which is not what is wrong. - When the stored ASL fails to parse.
InvalidDefinitionis a real Step Functions code — it is published atAPI_CreateStateMachineandAPI_UpdateStateMachine, where a definition arrives in the request — but not here, where the definition is substrate's own stored copy and the caller supplied nothing to be wrong about.CreateStateMachineaccepted that definition, so this path is reachable only for a definition substrate itself stored and cannot read back.
The second is the more interesting half: it is an internal inconsistency being reported as a caller error.
Acceptance criteria
-
StartSyncExecutionagainst aSTANDARDstate machine answersStateMachineTypeNotSupported/400 with AWS's message, "State machine type is not supported." - Decide what the unparseable-stored-definition path answers, and record it in
docs/services.mdas substrate's reading.InvalidDefinitionis not published here; the candidates are AWS'sValidationException(also not published on this page), a 500 (CommonErrorspublishes none for Step Functions beyondServiceQuotaExceededException/402 and the throttling codes), or demonstrating the path is unreachable becauseCreateStateMachineandUpdateStateMachineboth validate on the way in — in which case it is afmt.Errorf, not anAWSError. - Check whether
CreateStateMachineandUpdateStateMachinedo in fact refuse an unparseable definition today. If either accepts one, that is the defect to fix and this path becomes unreachable. - Audit the other three
startExecution-family paths for the same substitution:startExecutionsetsexec.ErrorDetails = "InvalidDefinition: " + erron a parse failure and reports the executionFAILED, which is a different shape — an execution-level failure rather than a request-level refusal — and may well be right. Record which it is. -
API_StartSyncExecutionis Express-only and served on async-prefixed endpoint host at AWS. Whether substrate models that host is out of scope here, but note indocs/services.mdwhether it does; the host was not obtained while researching Eleven Step Functions operations resolve a resource by the ARN's last segment plus the caller's own account and Region #912. - Behavioural tests over the wire through
emulator.StartTestServer, every ARN taken from aCreateStateMachineresponse per cfn: the aws:cloudformation:* stamp covers EC2 only, so the rest of a stack is unstamped #765: aSTANDARDstate machine answersStateMachineTypeNotSupported, anEXPRESSone succeeds, and the code is asserted on the raw response body rather than through a decoded struct. -
CHANGELOG.mdunder## [Unreleased].
Provenance
API_StartSyncExecution's error list and its "not available for STANDARD workflows" sentence, read in full while researching #912. Every Step Functions error on all eleven pages fetched is HTTP 400.
Activity
fix(stepfunctions): an ARN addresses the resource it names (#912) (#997)
scttfrdmn commentedon Sep 18, 2026
Premise corrections before the PR opens
The error list, the status codes and the "not available for
STANDARDworkflows" sentence all verify exactly as the body states, andStateMachineTypeNotSupported's message is verbatim "State machine type is not supported." Four things need correcting or settling first.1. The "demonstrate it is unreachable" option is not available. Acceptance criterion 3 asks whether
CreateStateMachineandUpdateStateMachinerefuse an unparseable definition today. Neither parsesdefinitionat all.createStateMachinedecodes five members and checks only thatnameis non-empty;updateStateMachineassignssm.Definition = input.Definitionwhenever the member is non-empty. So the unparseable-stored-ASL path instartSyncExecutionis live, not hypothetical, and that is the underlying defect the issue predicted.2. There is a second, concrete producer of an unreadable stored definition, reached through CloudFormation.
deployStepFunctionsStateMachine(cfn_resources_v20.go:25) does:DefinitionStringis a CloudFormation string property. Marshalling a Gostringto JSON quotes and escapes it, so a template carrying"DefinitionString": "{}"stores the definition"\"{}\""— a JSON string literal, whichjson.UnmarshalintoStateMachineDefinitionrejects with "cannot unmarshal string into Go value of type".cfn_intrinsics_test.go:628is exactly that template, so every deploy of aAWS::StepFunctions::StateMachinewith aDefinitionStringin the repo today stores a definition substrate cannot read back. This is fixed in the same PR, because it is the live route to the path the issue is about.3. AWS publishes nothing about the
sync-endpoint host on this page. Acceptance criterion 5 asksdocs/services.mdto note whether substrate models it. The page's Request Syntax, Request Parameters, Response Syntax, Errors and both Notes say nothing about an endpoint host at all — thesync-prefix comes from the endpoints reference, not from here. Sodocs/services.mdwill record that substrate does not model it and that this page is not a source for it, rather than asserting a host shape.4. The page's own Note decides criterion 4, and it cuts against the current
startExecutionshape.API_StartSyncExecutionsays:An unreadable definition is an issue with the state machine's code, which AWS puts on the error-code side of that line rather than the 200-with-
errorside. But none of the nine published codes fits it, and that is the point: AWS has no code for it because AWS would never have accepted the definition. So the resolution is the one criterion 3 names — validate on the way in, which makes both parse paths unreachable — and the residual becomes an internal inconsistency rather than a caller error.Consequently
startExecution'sexec.ErrorDetails = "InvalidDefinition: " + erralso stops being reachable. It is left as an execution-level failure rather than promoted to a request refusal, since that is the shape AWS's Note describes for a running execution, but the name changes:InvalidDefinitionis an API error code and has no business appearing as an ASL execution error name.States.Runtimeis the published ASL name for a failure that cannot be processed.Scope, and what is filed separately
This PR validates that a stored definition is parseable JSON describing an object — precisely the property whose absence produces the defect. It does not validate ASL structure.
{}remains acceptable here although AWS would refuse it, because "a state machine MUST have a string field namedStartAt" and "…an object field namedStates" is Amazon States Language conformance, which is a larger job with its own citation trail.docs/services.mdstates that boundary rather than implying full validation.Filed separately, all found in the handlers this PR touches:
StartSyncExecution's success body omits nine published members, including theerror/causepair — which is whereExecutionState.ErrorDetailsbelongs, and the reason it currently has nowhere to go.createStateMachineanswersStateMachineAlreadyExistsat 409 where the page publishes 400, and answersInvalidParameterExceptionfor a missingname— a codeAPI_CreateStateMachinedoes not publish. It also never checksroleArn, which isRequired: Yes.StartAt,States, andStartAtnaming a member ofStates).DefinitionStringis not resolved through the intrinsic context, unlike every sibling property in the same function, so anFn::Subin a definition reaches the stored record unresolved.fix(#996): StartSyncExecution refuses a workflow type, and a definiti…
fix(#1073): a definition that reads back and cannot run is refused (#…
fix(#1074): the state machine definition resolves through the intrins…