Skip to content

fix(step-functions): serialize Task timeout as TimeoutSeconds, not Timeout - #6966

Open
jakubknejzlik wants to merge 1 commit into
anomalyco:devfrom
jakubknejzlik:fix/step-functions-task-timeout-field-name
Open

fix(step-functions): serialize Task timeout as TimeoutSeconds, not Timeout#6966
jakubknejzlik wants to merge 1 commit into
anomalyco:devfrom
jakubknejzlik:fix/step-functions-task-timeout-field-name

Conversation

@jakubknejzlik

Copy link
Copy Markdown

The Task state's toJSON() serializes the timeout arg under the ASL key Timeout, which is not a valid Amazon States Language field name in either JSONPath or JSONata query language mode. Per the AWS Step Functions Task state docs, the correct field is TimeoutSeconds (with TimeoutSecondsPath as the JSONPath-only dynamic variant).

Repro (before fix):

const task = sst.aws.StepFunctions.lambdaInvoke({
  name: "MyTask",
  function: { handler: "src/handler.main" },
  timeout: "10 seconds",
});
new sst.aws.StepFunctions("Repro", { definition: task });

sst deploy fails with:

ERROR (SCHEMA_VALIDATION_FAILED): Field 'Timeout' is not supported: provider=aws@7.20.0

Fix: rename the serialized key from Timeout to TimeoutSeconds.

Verified: deployed a state machine with a 3s Task timeout racing a 6s Lambda sleep. Before the fix, deploy fails as above. After the fix, deploy succeeds and the execution correctly fails with States.Timeout at runtime, confirmed via describe-execution.

…meout

The Task state's toJSON() serialized the timeout arg under the ASL key
Timeout, which is not a valid Amazon States Language field name in
either JSONPath or JSONata query language mode. Per the AWS Step
Functions Task state docs, the correct field is TimeoutSeconds (with
TimeoutSecondsPath as the JSONPath-only dynamic variant).

Any state machine using timeout on a Task (lambdaInvoke, sqsSendMessage,
etc.) currently fails to deploy with:

  ERROR (SCHEMA_VALIDATION_FAILED): Field 'Timeout' is not supported

Renaming the serialized key to TimeoutSeconds fixes the deploy and the
timeout behaves correctly at runtime (verified: a Task with a 3s
timeout racing a 6s Lambda sleep now deploys cleanly and fails with
States.Timeout as expected).
jakubknejzlik pushed a commit to jakubknejzlik/stepforge-brain that referenced this pull request Aug 11, 2026
jakubknejzlik pushed a commit to jakubknejzlik/stepforge-brain that referenced this pull request Aug 12, 2026
Promoted [MEM-11] correction of MEM-4's root cause (SST timeout
serialization bug, upstream PR anomalyco/sst#6966) into semantic
memory, closed out the campaign episodic record, cycled MEM-1
OBSOLETE->REMOVED, archived TODAY.md, and regenerated SUMMARY.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jakubknejzlik pushed a commit to jakubknejzlik/stepforge-brain that referenced this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant