Skip to content

[Bug]: invoke() returns None due to incorrect key name in ChainedInvokeDetails deserialization #237

@alessandrobologna

Description

@alessandrobologna

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

  1. Create a durable function that uses context.invoke() to call another Lambda function
  2. The target Lambda function returns a response (e.g., {"status": "success"})
  3. The result of context.invoke() is None instead 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"):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions