The guide below contains a set of best practices for defining the best structure for your automated workflows.
If you automate a complex business workflow in a single recording/Bot Task, it can be hard to maintain and update.
We recommend splitting complicated Business Processes in several smaller Bot Tasks, i.e. automate each Bot Task separately, and then combine in a single Business Process. This approach has a number of advantages.
The approach has a number of advantages.
- It is easier to change a small Bot Task in case the Business Process changes or new features allow to automate it more efficiently.
- It is easier to find errors and debug a small Bot Task.
- In case additional steps are added to the Business Process, you can automate them separately and add to the existing Business Process as Bot Tasks with no need to change the whole automation scenario.
- It allows to provide for different scenarios in the workflow with no need to use complicated conditions in the script.
The guide demonstrates how to split a complex workflow into Bot Tasks and automate it from scratch using a sample use-case based on RPA Express Automation Challenge 2: Business Card Crunch.
Use case description
The Bot receives a number of business cards. It has to extract required contact information from each card and upload this information to the contact list in Salesforce.
Step 1. Analyze your Business Process and divide it into separate Bot Tasks
Before automating your Business Process, try to divide the whole workflow into several smaller steps, or sub-processes. Think of which data and which applications are used at each step in the workflow.
We have several business cards that we store in S3 storage. The Bot needs to open each card and extract the required information. Then it has to create a .csv file with extracted information from each card and upload these .csv files to Salesforce to create new contacts.
This Business Process can be divided logically into three parts:
- Extracting contact data from the business cards
- Creating .csv files with extracted data
- Uploading the .csv files to Salesforce
Each of these steps will be automated as a separate Bot Task.
Step 2. Build a separate recording for each Bot Task
Create a separate recording for each step in your Business Process. Think what data will be used at each step and use appropriate variables to store it in each recording.
Data is transferred from one Bot Task to another within one Business Process in variables. Make sure that the variables used in your Business Process have the same names/types in all recordings.
Refer to the video below to create your recordings.
Based on the steps we have identified for this use case, we can create three separate recordings.
- The Bot opens a business card.
- The Bot extracts the needed information using OCR and saves it to recorder variables:
bc_phone– Phone number
- The Bot creates a .csv file and populates it with the information extracted from the business card.
- The Bot retrieves the information from the recorder variables used in the first recording.
Thus, we created the same variables in this recording to ensure data transfer between Bot Tasks.
- The Bot opens Salesforce and logs in.
The Bot uploads the .csv file with the contact information.
Step 3. Run your recordings with test data
When you run your Business Process in production, the Bot Tasks receive data during execution from the previous Bot Task or from the input data file.
For testing purposes, fill in recorder variables with test data and run them to make sure the recording does what it is supposed to do.
Step 4. Publish each recording to Control Tower
Publish each recording to Control Tower. Each of recordings is published as a Bot Task that you can later combine in one Business Process.
Step 5. Combine Bot Tasks into one Business Process
After all recordings have been published to Control Tower, combine them in a single Business Process following instructions in this guide.
Use the Validate option to make sure all the Bot Tasks use correct variables.
Updating Existing Business Process
One of the advantages of splitting the Business Process into smaller Bot Tasks is the fact that you can change the workflow and create different scenarios within one Business Process without rewriting the whole automation. Consider a scenario below.
Sometimes, our Business Process breaks because the Bot receives business cards of an unknown template and therefore cannot extract data using OCR.
In this case, a human is needed to extract this information from the business card manually, so the Bot gets the contact information and finalizes the process itself.
As a solution, we can simply add another workflow to the Business Process with no need to rewrite the recordings we already have.
In this case, we can:
- create a manual task to process a new business card
- create a rule that triggers a different workflow based on whether the card was processed by the Bot or not
- rearrange the elements in the existing Business Process:
- insert the rule after the 1st Bot Task
- connect the rule to the 2nd Bot Task and manual process
- connect the manual task to the 2nd Bot Task
The workflow performs as follows.
On completing the 1st Bot Task, the Bot analyzes whether the card was processed and acts accordingly.
- If the card was processed, the Bot executes the 2nd Bot Task.
- If the card wasn't processed, the work is transferred to the manual task, and then go on with the Business Process.
In the workflow above, we don't need to change a single action in the recordings.