Build a bot to upload documents to Document Automation
Build a bot to upload documents to a specific learning instance for processing and extraction.
- Ensure you have the name of the destination learning instance.
- If you have an adequate amount of Bot Runners connected. For
instructions on connecting a Bot Runner, see step 5 of Set up your Document Automation environment.Note: You need a dedicated Bot Runner for this bot and additional Bot Runners for the
downloadbots, depending on the average number of pages in the documents. Review the explanation below for more guidance on how many Bot Runners are needed.
- Decide on the scheduling interval for deploying this bot with a maximum interval of every thirty minutes.
- Determine the average number of pages in the documents awaiting upload.
This bot is necessary for end-to-end automation of the document extraction process. When deployed, the bot checks if there are enough Bot Runners to handle the documents, by comparing the number of files already uploaded against a calculated value. The calculation considers the number of Bot Runners, scheduling interval, and average number of pages in the documents.
Note: This step is important as it controls the number of documents being uploaded to ensure smooth processing and avoid overloading the Bot Runners, which might cause a time-out error.
To determine the number of Bot Runners needed, consider the following:
- One Bot Runner can process a single-page document in one minute.
- One Bot Runner can process a two-page documents in two minutes.
- Two Bot Runners can process two single-page documents in one minute.
Use this equation to determine how many Bot Runners are needed for your use case:
Number of Documents to Process * Average Number of Pages / Scheduling Interval = Number of Bot Runners
As an example, if you want to process 10,000 documents each month with an average of one page per document in 30 minute intervals, you need seven Bot Runners:
10,000 documents * 1 page per document / (720 hours in an average month * 2 times per hour) = 7 Bot Runners
To build the bot, follow these steps:
Navigate to Create a bot.
and click Ensure you do not place the bot in the Document Workspace folder.
Provide a name for the bot, such as
Create the following variables: Create a variable
Variable name Description Data type Value
Increments with each loop iteration to count the number of files uploaded for processing. Number 0
Number of Bot Runner devices connected to the Control Room Number Enter the number of connected Bot Runner devices
Scheduling interval in minutes Number Enter the interval for which you will schedule this bot to run when you deploy it (minimum 2 min,maximum 30 min)
Average number of pages per document Enter the approximate average number of pages in the documents
Holds file name and extension Dictionary --
File path to the folder containing documents awaiting upload to Document Automation String Enter the file path
File path to the folder containing the extracted data and invalid or failed documents String Enter the file path where you want the extraction output
Insert a Loop
action to iterate through all the documents in a specific file
- Double-click or drag the Loop action.
- Select the For each file in folder iterator.
SourcePathvariable into the Folder path field.
FilesInFoldervariable into the Assign file name and extension to this variable field.
Insert an If
action to compare the number of documents uploaded for processing
to the number of Bot Runner devices multiplied by a scheduling
interval and divided by the average number of pages.
Note: You must include this equation to limit the number of files uploaded for processing at one time to ensure that the Bot Runners are able to process the documents.
- Drag the If action into the Loop container.
- Select the Number condition.
File_Countvariable into the Source value field.
- Select the Less than operator.
Enter the following into the Target value field:
Insert If: Else and Loop: Break
actions to end the loop if the condition is not met:
- Drag the If: Else action beside the If action in the Loop container.
- Drag the Loop: Break action into the If: Else container.
Insert an error handling mechanism to log any possible errors:
- Drag the Error handler: Try action into the If container.
- Drag the Error handler: Catch action beside the Error handler: Try action.
- Drag a Delay action below the Error handler: Catch action.
- Set a delay of 10 seconds.
Configure actions to upload documents to the process associated
with a specific learning instance.
- Drag the AARI Web: Create a request action below the Error handler: Try action.
- Mark the Set LearningInstanceName option and provide the name of the learning instance where to send the documents.
Mark the Set InputFile option and enter
Mark the Set InputFileName option and enter
Mark the Set OutputFolder option and enter