Skip to main content
100%

Lambda triggers other lambdas

✓ Published0🌍 Public
Aandresmijares
Last edited Apr 3, 2018
Created on Apr 3, 2018

This example shows how one AWS Lambda function orchestrates two other Lambda functions to compose a departure response. The `get-departure.js` handler receives query parameters for an `id` and `date`, then invokes `get-flight` and `get-forecast` functions concurrently using the AWS SDK’s `Lambda.invoke` API with `InvocationType: "RequestResponse"`. It uses Bluebird’s `Promise.all` to await both payloads, parses each JSON response, and returns a combined `departure` object containing the forecast and flight data. The code demonstrates a saga-style pattern for coordinating dependent serverless calls.

AI-generated description

Similar vizzes