Skip to content

aws_stepfunctions_tasks: payloadResponseOnly cannot be used with TaskInput.fromJsonPathAt #34260

Open
@cscanlin

Description

@cscanlin

Describe the bug

@jakubknejzlik Described the issue perfectly here in a now closed issue:
#22390 (comment)
(Copied for visibility)

CDK code:

new LambdaInvoke(scope, id, {
    lambdaFunction: ...,
    payload: TaskInput.fromJsonPathAt("$.input"),
    payloadResponseOnly: true,
})

produces following definition:

"state": {
     ...
      "Type": "Task",
      "Resource": "arn:aws:lambda:{region}:{account}:function:{function_name}",
      "Parameters": "$.input" // this is the problem
}

When payloadResponseOnly: false it produces following definition:

"state": {
     ...
      "Type": "Task",
      "Resource": "arn:aws:states:::lambda:invoke",
      "Parameters": {
        "FunctionName": "arn:aws:lambda:{region}:{account}:function:{function_name}",
        "Payload.$": "$.input"
      }
}

When I use TaskInput.fromObject like so:

new LambdaInvoke(scope, id, {
    lambdaFunction: ...,
    payload: TaskInput.fromObject({
      input: JsonPath.stringAt("$.input"),
    }),
    payloadResponseOnly: true,
})

The definition is ok:

"state": {
     ...
      "Type": "Task",
      "Resource": "arn:aws:lambda:{region}:{account}:function:{function_name}",
      "Parameters": {
        "input.$": "$.input"
      }
}

And another closed issue:
#23996

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

See above

Current Behavior

See above

Reproduction Steps

See above

Possible Solution

See above

Additional Information/Context

No response

CDK CLI Version

2.1012.0

Framework Version

No response

Node.js Version

22.15.0

OS

MacOS

Language

Python

Language Version

3.10

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions