-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Expected Behavior
When using context.invoke() to call a Lambda function that returns a response, the result should be properly deserialized and returned to the caller.
Actual Behavior
The invoke() function always returns None even when the invoked Lambda function returns a valid response. The result is lost during deserialization.
Steps to Reproduce
- Create a durable function that uses
context.invoke()to call another Lambda function - The target Lambda function returns a response (e.g.,
{"status": "success"}) - The result of
context.invoke()isNoneinstead of the expected response
Root Cause
I suspect that this is the issue:
In src/aws_durable_execution_sdk_python/lambda_service.py, the Operation.from_dict() method at line 752 uses the wrong key name to deserialize ChainedInvokeDetails:
# Current (incorrect) - uses snake_case
if chained_invoke_details := data.get("chained_invoke_details"):
# Should be (correct) - uses PascalCase to match the API response
if chained_invoke_details := data.get("ChainedInvokeDetails"):All other detail fields use PascalCase correctly:
data.get("StepDetails")✓data.get("WaitDetails")✓data.get("CallbackDetails")✓data.get("chained_invoke_details")✗ (should be"ChainedInvokeDetails")
The to_dict() method correctly uses "ChainedInvokeDetails" (PascalCase) at line 826, confirming this is a bug in deserialization only.
The JavaScript SDK does not have this issue as it uses the Operation type directly from @aws-sdk/client-lambda.
SDK Version
0.1.0 (current main branch)
Python Version
3.12
Is this a regression?
No
Additional Context
The fix is a one-line change in lambda_service.py:752:
- if chained_invoke_details := data.get("chained_invoke_details"):
+ if chained_invoke_details := data.get("ChainedInvokeDetails"):