How to set up a Lambda function

This article is part of the Insightly Automation Guide

To get your Lambda function up and running in Insightly, you'll need to create the function, then set the trigger for it. There are two types of triggers:

  • A timed trigger which runs the function every hour or every day
  • workflow action, which triggers the function when certain criteria that you specify are met in Insightly

You may add up to 50 functions to your account.

Work with your technical staff or a developer to set up functions if you don't have programming knowledge.

To create a Lambda function:

  1. Either prepare your code for manual entry or create a Lambda function deployment package written in one of the supported languages (JavaScript, C#, Java, or Python).
  2. Go to System Settings > Lambda Functions.
    SysSet_to_Lambda.png
  3. Click New Function.
    Lambda_new.png
  4. Enter a name and a short description for the function.
    Lambda_name-desc.png
  5. Choose the Runtime language you've used to write your code.
    Lambda_language.png
  6. Enter the Handler Name.
    Lambda_chelsea1.png
  7. When you choose Node.js or Python, you can choose Edit Code Inline or Upload a .ZIP file. Java and C# only offer the upload option, so you'll skip the next step.
    Lambda_edit-upload1.png
  8. If you choose Edit Code Inline, write or copy your code in the field that appears further down the page.
    Lambda_Inline-code.png
    When your function references an Insightly object, structure the payload in the following way. Refer to our API documentation for all available fields and record types.
    {
    "entity": {
    "LEAD_ID": 45610,
    "SALUTATION": "Your Honor",
    "TITLE": "Judge",
    "FIRST_NAME": "Judy",
    "LAST_NAME": "Sheindlin",
    "ORGANIZATION_NAME": "The Court",
    "PHONE_NUMBER": "202-555-7845",
    "MOBILE_PHONE_NUMBER": "202-555-9552",
    "EMAIL_ADDRESS": "noholdsbarred@judgy.com",
    "WEBSITE_URL": "www.judgejudy.com",
    "OWNER_USER_ID": 1556,
    "DATE_CREATED_UTC": "2017-08-30T23:48:55.839Z",
    "DATE_UPDATED_UTC": "2017-08-30T23:48:55.839Z",
    "CONVERTED": true,
    "CONVERTED_DATE_UTC": "2017-08-30T23:48:55.839Z",
    }
    }
  9. If you choose Upload a .ZIP file, click Upload to select and upload your package file. The package must be less than 50MB in size.
    Lambda_upload.png
  10. Enter Environment Variables. Click Add New Variable to add more than one.
    A few notes on variables:
    • The total size of your set of variables cannot exceed 4 KB
    • Package all dependencies into your Lambda function code
    • Each one must start with letters [a-zA-Z]
    • Fields can only contain alphanumeric characters and underscores ([a-zA-Z0-9_]
    Lambda_environment.png
  11. Click Save Function.
    Lambda_save.png
  12. Your new function will now appear in the Lambda Functions list.
    Lambda_list.png
  13. Now that your function is active, you'll be able to select it from the Actions menu when creating a workflow.
    workflow_lambda.png 
  14. To add an hourly or daily timer, click the function's name.
    Lambda_saved.png
  15. Click Add Scheduled Trigger for Function.
    Lambda_trigger1.png
  16. Choose whether to run the function every hour or every day at a specific time and click Save Schedule.
    Lambda_time.png

When you view the function, you can see the workflows and schedules that trigger it. Functions will be set with a 30 second timeout. If a function fails to run 3 consecutive times, it will be automatically disabled.
Lamba_deets.png

Have more questions? Submit a request
Top