AWS Lambda

AWS Lambda Help & Support

What AWS Lambda Triggers and Actions are Supported?

Supported Triggers#

  • New Function - Triggers when a new function is added.

Supported Actions#

  • Run Code - Write Javascript code directly in your browser and execute it in a Lambda function that we provide the source for.
  • Invoke Function - Invokes a pre-built function asynchronously providing only data.

How to Get Started With AWS Lambda

Before you start - you need to create an IAM user that has limited permissions to Lambda only. You should follow these instructions remembering to substitute "Lambda" for "SES".

There are two ways to use AWS Lambda with Zapier:

Zapier provides data to your pre-built function.#

This is the simplest but more strict option via the Invoke Function action - you tell us which function you want us to invoke and we'll provide the data to invoke it. You will write your code in the Amazon console or whatever medium you prefer.

Zapier provides data AND code to a special "sugar" function you add on our behalf.#

This is a more flexible option that allows you to write code in your browser during Zap setup via the Run Code action - though you will need to upload a special "sugar" function that takes both data and the code you wrote during Zap setup. The special "sugar" function simply evals the code as a convenience.

Zapier Provides Data to Your Pre-Built Function

This is the Invoke Function action. This presumes you have a pre-built function that you just want Zapier to invoke with some special arguments or data we provide from a trigger. Return data is ignored.

Invoking a Lambda function from Zapier is simple. First select your region, and choose the function to invoke:

Then, provide the arguments that you want to be provided to your function when it is invoked - you'll access it as the event object you may recognize from the AWS Lambda documentation.

To add more arguments, use the + button. A function you would upload to AWS Lambda to consume this event might look something like:

exports.handler = function(event, context) {
  // you have access to the event object:
  // event == {name: "FancyFile.pdf", size: 165435}
  context.succeed();
};

Note - if you are using Java or some other runtime - you may need to deserialize the payload/event as it could be passed in as a JSON bytestring. This is done for you automatically in the Node.js runtime.

Zapier Provides Data and You Code in the Browser

This is the Run Code action. It lets you write code in your browser during Zap setup but run the code in your AWS Lambda on behalf of Zapier:

In order for Zapier to "Run Code" dynamically provided in your zap you will need to create a special "sugar" function for us to piggyback. Go to your Lambda Console to get started on this and Create a Lambda Function:

Copy the code from this gist and paste it into your function - be sure to name the function zapier_eval! This bit of code will let us provide code that is run safely within your very own Lambda environment.

You can set the function's role, memory and timeout to whatever settings you deem appropriate.

Now you can use the "Run Code" action in Zapier and provide code on the fly. You only need to set up this function once - we'll always use it in the future.

You are welcome to customize the zapier_eval function - some people like to create their own *.zip with custom npm dependencies so you can require and utilize other functionality. You are welcome to use the code from this gist as the foundation.

Common Problems with AWS Lambda

We don't have any common problems documented yet, but feel free to contact us so we can help you personally!

Need More Help? - Our support team is happy to help -- send us a message

AWS Lambda is a compute service that runs your code in response to events and automatically manages the compute resources for you, making it easy to build applications that respond quickly to new information.

Learn More

Getting Started with Zapier