Hi all I have a scenario that is perfect for the Dec 2020 update to step functions: “Synchronous express workflows”. Express step functions can now block until complete, which means you can link them to the API Gateway and return a result to a web browser synchronously. The alternatives were messy.
I’m looking to do this with Serverless com — but it’s a pretty new feature. However, I think I can get away by breaking out into a CloudFormation template to specify the extra parameters. What I need to do is add API Gateway configuration along the lines of this:
I wish there was a complete reference of Serverless.com documentation. The docs have a bunch of examples but there’s nothing definitive that I can find.
Thanks – yes I saw that resource. Unfortunately I’m not sufficiently experienced to know how to translate AWS examples into Serverless com examples without a slow and error-prone test process.
I was stuck on this for awhile and couldn’t get an endpoint to use integration with StepFunctions… Instead I had to use Lambda to invoke a StepFunction state machine.
I managed to make it work with CloudFormation so I though I will share it with you.
You need to use step functions of type express and Http API gateway.
Step functions need to be express type, because they offer synchronous execution.
You need to create:
Step function, e.g. by using serverless-step-functions plugin
This is pretty late but just wanted to leave the message here just in case if anyone is looking for in the future. I was able to implement using the serverless configuration itself, without going to CloudFormation. Here it is:
Thanks for posting your reply. To your point, I just posted a question a few minutes ago before I found this thread on this very subject. I will give your solution a try.
When Response Parameter mapping is too limited to satisfy requirements, responses may be transformed in one of the states in your state machine prior to returning the response thru HTTP API.
For simple, predictable response transformations, I utilize the built-in JsonPath features with a Pass State in lieu of, or, in addition to a success state.
For more complex transformation, implement lambda customized to transform responses to whatever degree needed before returning to the HTTP API.