Logic: Lambda

Knowledge Center > Workflow > Workflow Tasks > Logic: Lambda

Logic: Lambda

The Lambda task feeds data from the preceding task into a predefined Lambda function, triggers the function, and fetches the data in the result when the function completes. 

The Lambda task is in Limited Availability. If you wish to enable this task, submit a request at Zuora Global Support.

The Lambda task provides endless possibilities of what you can achieve and greatly extends the use scenarios of Workflow. For example, you can automate product price adjustments based on regional labor cost inflation by parsing data from source websites with the Beautiful Soup library in Python.

All Lambda functions should include complete error handling logic so that errors can be captured in Workflow API calls. This is important for troubleshooting.

Task Settings

You need to select a function to run from the list of uploaded Lambda functions for your organization. If you have not built your code, you can start with the Lambda starter package that is provided in the custom code upload window. To learn about where to download the starter package, see step 4 in Upload a Lambda function in a workflow.

workflow_task_lambda_functions.png

You can test your Lambda code by performing a test run with the data in the payload. To test your code, select the Testing tab and click Test Run. The data in the response will be shown in the right section.

workflow_task_lambda_testing.png

Upload a Lambda function in Workflow

  1. Ensure you have access to the Lambda task. Otherwise, you cannot upload a Lambda task.
  2. On the home page of Workflow, click the Settings tab. 
    workflow_lambda_functions.png
  3. In the Custom Code Executable section, click New.
  4. Configure the basic settings for your code and upload the code.
    • Function Name - A name to identify the function. Letters and underscore are accepted. Space is not accepted.
    • Handler - The handler is a function in your code that AWS Lambda can invoke when the service executes your code. Refer to AWS Lambda Documentation to learn more about handler syntax structures for different languages.
    • Runtime - The runtime for the programming language that you use. 
    • Code Upload - A Lambda starter package is provided in the window to help you get started. You need to implement at least one function that comes with the starter package and can import as many functions as you want. workflow_lambda_upload.png
  5. Optionally configure the environmental settings. 
  6. Click Create to upload your function. Uploaded Lambda functions can be used by all users in the same organization.
Last modified

Tags

Classifications

(not set)