The Lambda task feeds data in the workflow payload into a predefined AWS Lambda function, triggers the function, and fetches the data in the result when the function completes. A Lambda function is a piece of AWS Lambda code that processes the data in the payload and returns the results to the workflow.
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.
Before you add a Lambda task, ensure that:
- You have access to the Lambda task in Workflow.
- You have built a Lambda function. 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.
To learn about implementation details and use cases of AWS Lambda, see the AWS Lambda introduction.
- You have uploaded your Lambda function to Workflow.
To learn about how to upload your Lambda function, see Upload a Lambda function to a workflow.
You need to select a function to run from the list of uploaded Lambda functions for your organization. All functions that you have uploaded
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.
Upload a Lambda function to Workflow
- Ensure you have access to the Lambda task. Otherwise, you cannot upload a Lambda task.
- On the home page of Workflow, click the Settings tab.
- In the Custom Code Executable section, click New.
- 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.
- Optionally configure the environmental settings.
- Click Create to upload your function. Uploaded Lambda functions can be used by all users in the same organization.