Serverless architecture, also known as "Function-as-a-service"(Faas), provides a platform for developers to write functions to integrate the CRM and any third-party application. These codes, written in Deluge, can be triggered from any other third party services or it can be triggered directly from any web or mobile app. Most applications require a server that lets them host their applications, parsing, sharing and computing data.
However, having to set up a server just for the sake of providing a simple solution to their customers will not bode well for some. Furthermore, running a server also includes HTTP issues and scalability issues. As such, you can use Zoho CRM's serverless environment to run your application in sync with CRM without the need to put up a server.
If I had to give an example, setting a server is like setting up a restaurant and making people come over. But serverless architecture is like door-step delivery.
Here's how Serverless Architecture work
Let us assume that there is Zylker Inc. which is an online store that sells different products. They, however, are not the manufacturers, hence they need to procure the products from vendors and deliver it to the customers.
Here's how the usual process goes. The customer adds items to the cart, confirms the order, makes the payment and waits for the product to get delivered. Now speaking in the CRM's terminology, when the customer makes the payment, the sales guy gets the payment details and creates a deal record marking the deal stage as won. Then, the process involving Warehouse processing and Delivery gets started.
For the payment details and shipment details, there are different applications that handle the process. You can use the data from those applications and update the CRM through the use of webhooks.
With Middleware softwares:
And now with Serverless Functions:
Getting Started with the process:
1. Writing the Function:
Now that you're sure of what you need to do, you can write your business logic within functions. The code for the above logic would be something like this:
As you can see above, you define what the function needs to do when it is executed. As such, whenever the function is triggered from Zylker's application, the corresponding data in CRM is updated. But even so, there's a tiny problem. We do not know the format of the incoming data to CRM.
The types of input can be:
- Parameters
- Stream(Body)
- File
- Headers
Functions can parse most of the input types and process the information regardless. However, there needs to be some pre-defined lines of code that are to be given within the functions to facilitate this process. For instance, the function can get the entire Request Object and turn them into readable arguments, which can be used at your disposal. No matter what type the input is, you can use them to insert, update or make any other changes to your CRM as per your requirement. Not only can you get the entire request object, you can also set up what response the function, or in a way, the CRM, has to give out to the end user.
2. Authentication:
You need to properly authenticate your application with Zoho. There are 2 methods to do that.
OAuth is a bit complex but the most widely used method that most applications adopt, whereas API Key is much more simple, but certain security inadequacies made it such that there are only some applications that use this method. Nevertheless, you can decide by yourself which one fits you best, based on the 3-party application.
3. Registering with Webhook
Now that you've created the function and made the function available as an API call. You need to register, or provide the URL to the other 3rd party application. This step is done so that the 3rd party application can be programmed to send a webhook based on certain conditions.
In this case, a webhook may be triggered when the shipment status is moved from "Packaged" to "Out-for-Delivery". When the webhook is triggered, the URL given within the webhook triggers the function within CRM. And based on the data received from the webhook, the shipment status of the customer within CRM can be changed accordingly.
Is it New to Zoho CRM?
I'm sure most of you are aware of "Functions", the one that lets you add additional functionality to your CRM. Those who are using “Functions” to write their own business logic to connect to third party apps, other Zoho services, web hooks, etc., have been using this serverless computing in a way.
Functions are designed to help people solve the issue of running servers, creating their business logic or integrating custom applications. Hence, it can be set to trigger based on events from within CRM or from external sources, without a server.