How to return data from a Step Function Lambda chain linked to a REST API using AWS CDK #28291
Unanswered
rafaelrcamargo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a serverless application using AWS CDK that involves a Step Functions state machine integrated with a REST API using AWS API Gateway. The state machine consists of two Lambda functions (
exampleFn
andexampleFn2
) connected in a chain. I'm encountering an issue where I'm able to pass data from the first function to the second within the Step Function, but I'm struggling to correctly return the data fromexampleFn2
as the API response.Here's a simplified version of my CDK code:
In the second Lambda function (
exampleFn2
), I aim to structure the response similar to this:The issue I'm facing is that while the Step Function execution works and passes data between functions correctly, the response I receive from the REST API doesn't contain the data returned by
exampleFn2
as expected. Instead, it seems to return the input to the Step Function.Is there a specific configuration or modification needed within the CDK setup or integration definitions to ensure that the response from
exampleFn2
is correctly structured and returned by the API Gateway upon completion of the Step Function execution?Any insights or examples on how to properly set up the integration or handle Step Function output for API Gateway responses would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions