The http source receives inputs from AWS Lambda.

The lambda source implements the AWS Lambda Runtime API. It provides a source that will receive events from Lambda and use them to invoke functions.

A runner can be created as a custom layer in AWS Lambda. Functions can then provide their own runtime. The runner may either be called bootstrap or be placed beside a script called bootstrap that starts the runner. The following is a small reusable bootstrap script.


fnrunner Key



The following table describes the keys on the configuration object for the lambda source.

jsonDeserializeEventBooleantrueIndicates whether the request event should be deserialized from JSON


Inputs generated by the lambda source are objects with the following keys.

LambdaRuntimeAwsRequestIdStringThe unique request ID from the Lambda runtime
LambdaRuntimeDeadlineMsIntegerThe number of milliseconds until the Lambda execution deadline
LambdaRuntimeTraceIdStringThe X-Ray tracing header value
eventStringThe Lambda event


The lambda source expects successful outputs to be either a String or an Object that can be serialized to JSON. The source will post the result using the Lambda Runtime API.

If the fn returns an error, it will be posted as an error to the Lambda Runtime API.


The following example shows a simple system that receives events from AWS Lambda and invokes a Node.js function with the event.

source: fnrun.source/lambda
  - fnrun.middleware/key: event
  fnrun.fn/cli: node ./fn.js

Edit this page on GitHub