Triggering Robocorp processes from Freshdesk
Walkthrough on creating an automation in Freshdesk that triggers a process in Robocorp.
Freshdesk's hugely popular customer service platform can be easily extended with the use of RPA robots. Robocorp's Control Room API allows triggering of the automated processes in various scenarios. This example demonstrates the required configuration in the Control Room and in Freshdesk to trigger a process based on various Freshdesk ticket actions. Example also includes a small robot that takes in the payload from Freshdesk, and demonstrates how to update priority and add notes to the ticket.
What you'll learn with this reference architecture
- Configuring Freshdesk automation to trigger a process execution in Robocorp
- Using python-freshdesk package to manipulate Freshdesk tickets in the robot
Set up the API key in Control Room
First create an API key in Control Room (unless you have one already made). It's found under API tab in your workspace. To trigger a process, you only need one checkbox selected as shown.
After that, the easiest way to find the rest of the details is by navigating to your process that should be triggered, and click
API Helper from the top right corner of the page. It will open a sidebar that shows you all the relevant details you'll need to set things up in Freshdesk. Choose "Start process with a single work item payload" from the first dropdown, and then make sure you have the correct process and API key chosen. Leave this page open, and continue with Freshdesk.
Configuring the automation in Freshdesk
If you don't have your Freshdesk instance, you can create a free demo here that is valid for 21 days.
To create automation rules, navigate to
Automations and hit "Create a rule".
First you'll choose how the triggering happens, having three options:
- Ticket creation
- When a new ticket is created in Freshdesk
- Time triggers
- Scheduled triggers e.g. once every day. Can be used for various maintenance tasks
- Ticket updates
- When details like priority or status of a ticket changes
Next create the necessary filters under which conditions the triggering will happen. As an example in the screenshot, we have chosen the triggering to happen only when the ticket is created with a status
Now it's time to set up the connection to Robocorp Control Room. Choose
Trigger webhook from the first dropdown. Then choose POST as the Request Type.
For the URL, jump back to the Control Room API Helper, and copy paste the full URL all the way to the last question mark, but without quotes. It will look something like this (with Workspace ID and Process ID replaced with real values):
Add custom headers and configure the Authorization string. You can copy paste it mostly from the API Helper, but notice that you'll need to add curly braces and quotes to make it valid JSON. An example of a correctly formed header is here (worry not, I have already deleted the API key used in the example):
Then choose JSON for Encoding, and Simple for Content type. Last, you can choose the ticket values you want the process to receive as inputs. The values chosen here will end up in your input work item and will look like this:
After saving you are all done!
Writing data back to Freshdesk
The robot example included will take the payload sent by Freshdesk automation and write data back to the ticket. In real life, you would naturally have more tasks in the robot code. For example you could perform NLP tasks to the ticket content using Google API, or fetch additional data from legacy systems using web or desktop automation.
In order to use the robot, you'll need to configure a Vault called
Freshdesk that contains two items:
apikey that is found under your Freshdesk profile and
domain that looks like
NOTE! Api key determines in who's name robot is manipulating the tickets. The best practise is to create a separate user for the robot.
Then add the robot to control room, create a process and use that process in your Freshdesk automation. Voila, Robocorp RPA and Freshdesk now talks two ways!