Integrate the Function with Zoho CRM
Let's now integrate this function with Zoho CRM by creating a workflow rule with a webhook associated to it.
To integrate the function with Zoho CRM:
- Navigate to Setup and then Workflow Rules under the Automation section.
- Click Create Rule in the Workflow Rules page.
- Select the Leads module and enter the rule name and description in the pop-up box as displayed below. Click Next.
- Select Create and click Next.
- Select All Leads and click Next.
- Click Instant Actions and select Webhooks.
- Enter the details as displayed below in the pop-up box.
You can obtain the Function URL from the Catalyst console or from the CLI as discussed in the previous step. You must append this at the end of the Function URL as shown in the picture: "?feature_name=CRM&mail_count_threshold=5".
Select the HTTP method as GET. Click Save and Associate.
The workflow rule will now be saved and webhook will be associated with it. We have defined the threshold as '5'. Therefore, if more than 5 leads are created in the Leads module, the email alert will be sent automatically.
The microservice is now functional and will work without any errors.