Let’s take a simple example to use multiple workflows in a UiPath ReFramework with queue and assets:
Workflow 1
This workflow reads an Excel file and stores the data in a queue.
// Read the Excel file.
ExcelApplication excel = new ExcelApplication();
ExcelWorkbook workbook = excel.Workbooks.Open(“C:\Path\To\Excel\File.xlsx”);
ExcelWorksheet worksheet = workbook.Worksheets[0];
// Store the data in a queue.
Queue queue = new Queue(“MyQueue”);
foreach (DataRow row in worksheet.UsedRange.Rows)
{
queue.Add(row.ToString());
}
// Close the Excel file.
excel.Quit();
Workflow 2
This workflow processes the data in the queue.
// Get the next item from the queue.
Queue queue = new Queue(“MyQueue”);
string data = queue.Get();
// Process the data.
// …
// Remove the item from the queue.
queue.Remove();
Assets
The following assets are used in this example:
- Queue: MyQueue
- Excel file: C:\Path\To\Excel\File.xlsx
How to use the workflows
- Start Workflow 1.
- Once Workflow 1 has finished running, start Workflow 2.
- Workflow 2 will process the data in the queue until there are no more items in the queue.
Example of a complex ReFramework process
Here is an example of a more complex ReFramework process that uses multiple workflows:
Workflow 1
This workflow extracts data from a website and stores the data in a queue.
Workflow 2
This workflow cleans the data in the queue and stores the cleaned data in another queue.
Workflow 3
This workflow loads the cleaned data into a database.
Assets
The following assets are used in this example:
- Queue: WebsiteDataQueue
- Queue: CleanedDataQueue
- Database connection string
How to use the workflows
- Start Workflow 1.
- Once Workflow 1 has finished running, start Workflow 2.
- Once Workflow 2 has finished running, start Workflow 3.
Benefits of using multiple workflows
There are several benefits to using multiple workflows in a ReFramework process:
- Modularity: Multiple workflows make the process more modular and easier to maintain.
- Reusability: Multiple workflows can be reused across different processes.
- Scalability: Multiple workflows can be scaled horizontally to increase the throughput of the process.
Hope this helps
Let us know for further clarification
Cheers @avinash.wankhede