feat(stateMachines): add configureTaskTimeouts to mirror Lambda timeouts#768
Merged
feat(stateMachines): add configureTaskTimeouts to mirror Lambda timeouts#768
Conversation
Adds an opt-in `configureTaskTimeouts: true` flag on a state machine that auto-injects `TimeoutSeconds` into Task states invoking project Lambdas. Bridges the gap that Lambda timeouts don't surface as `States.Timeout`. - Pure planner returns Decision[] (inject | warn-overlong); thin applier mutates the definition and emits warnings via injected log callback - Resolves both legacy direct invoke (Resource: Fn::GetAtt) and service integration (arn:aws:states:::lambda:invoke[.sync|.waitForTaskToken]) - Recurses into Parallel branches and Map ItemProcessor/Iterator - Preserves user-set TimeoutSeconds/TimeoutSecondsPath; warns only when user TimeoutSeconds is strictly greater than the Lambda timeout - Fallback chain: function.timeout -> provider.timeout -> 6 (Serverless Framework default) - Integration fixture asserts CF template contains expected timeouts Closes #239 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #239
Summary
configureTaskTimeouts: trueflag auto-injectsTimeoutSecondsinto Task states that invoke a project Lambda, bridging the gap that Lambda timeouts surface asStates.TaskFailedrather thanStates.Timeout.Decision[](inject|warn-overlong); thin applier mutates the definition and emits warnings via injected log callback — keeps decision and effect decomplected.Resource: Fn::GetAtt) and service integration (arn:aws:states:::lambda:invoke[.sync|.waitForTaskToken]); recurses into Parallel branches and Map ItemProcessor/Iterator.TimeoutSeconds/TimeoutSecondsPath; warns only when userTimeoutSecondsis strictly greater than the Lambda timeout.function.timeout→provider.timeout→6(Serverless Framework default).Test plan
configureTaskTimeouts.test.js— 19 tests)compileStateMachines.test.js— 3 new tests)fixtures/configure-task-timeouts/verify.test.js— 5 tests)configureTaskTimeouts: true🤖 Generated with Claude Code