Example workflow: report Excel-driven runs
A complete UiPath workflow that reads an Excel file, processes each row, and reports the run to RPA Watch.
This walkthrough builds a small but realistic process that you can drop into any project. It reads a list of records from an .xlsx workbook, classifies each row as success or failed based on a column the source system already provides, attaches the daily log file, and sends one consolidated report to RPA Watch.
By the end you'll see a single run appear on your dashboard with per-record details and downloadable attachments.

Before you start
Make sure you have:
- The RPAWatch.UiPath.Activities package installed https://www.nuget.org/packages/RPAWatch.UiPath.Activities
- A workbook with at least the columns used below — adapt the column names to match yours:
| National ID | First Name | Last Name | Flow Status | Log | Error |
|---|---|---|---|---|---|
| 11111111111 | Ada | Lovelace | Completed | OK | |
| 22222222222 | Alan | Turing | Error | Account locked | |
| 33333333333 | Grace | Hopper | Completed | OK |
- A Flow ID (a GUID) copied from the Flows page in RPA Watch.
- A Robot ID (numeric) copied from the Robots page.
- An API Key generated under Account Settings → API Keys. It looks like rpakey_eda9e46a8fdc22d427426c89c534758b71a1a179.
The example uses C# expressions, which is the default for projects created in Studio 2026.
1. Declare the workflow variables
In the Variables panel, add:
| Name | Type | Scope | Default |
|---|---|---|---|
startedAt | System.DateTime | Main sequence | *(empty)* |
excelDataTable | System.Data.DataTable | Main sequence | *(empty)* |
detailsTable | System.Data.DataTable | Main sequence | *(empty)* |
index | Int32 | Main sequence | *(empty)* — bound to For Each Row.CurrentIndex |
respStatus | Int32 | Main sequence | *(empty)* |
resp | String | Main sequence | *(empty)* |
isSuccess | Boolean | Main sequence | *(empty)* |
You can also expose the API URL, API key, flow ID, and robot ID as Arguments in_RPAWatchApiUrl, in_RPAWatchApiKey, in_FlowId, in_RobotId) so the same workflow can be promoted from Dev to Prod without changes.
2. Capture the start time
The very first activity should be an Assign that records the moment the workflow started — Send Report uses it to calculate duration_seconds.
- To → startedAt
- Value → DateTime.Now
3. Read the input workbook
Add an Excel → Read Range Workbook activity:
| Property | Value |
|---|---|
| Workbook Path | @"C:\Users\<you>\Downloads\English_Dummy_RPA_Data.xlsx" |
| Sheet Name | "All" |
| Range | "" *(blank — reads the whole sheet)* |
| Add Headers | True |
| DataTable | excelDataTable |
If you assign this later (e.g. after the Excel read), the reported duration will be artificially short.
4. Initialize the details table
Add a Create Details Table activity (under the RPA Watch category):
- Details Table → detailsTable
The output is an empty DataTable with the six columns RPA Watch expects: sequence_no, record_id, record_name, status, result, error_message. See [Create Details Table](create-details-table) for the full schema.
5. Loop over the rows and log each one
Add a For Each Row in Data Table activity:
- DataTable → excelDataTable
- CurrentRow → currentDataRow (default)
- In the Properties panel, set CurrentIndex → index
Inside the loop body, drop a single Add Detail Row with these C# expressions:
| Property | Expression |
|---|---|
| Details Table | detailsTable |
| Sequence No | index |
| Record ID | currentDataRow["National ID"].ToString() |
| Record Name | currentDataRow["First Name"].ToString() + " " + currentDataRow["Last Name"].ToString() |
| Status | currentDataRow["Flow Status"].ToString() == "Completed" ? "success" : "failed" |
| Result | currentDataRow["Log"].ToString() |
| Error Message | currentDataRow["Error"].ToString() |
The ternary on Status is the key trick: it maps the source system's domain status to the two values RPA Watch understands success, failed). See [Add Detail Row](add-detail-row.md) for more patterns.
6. Send the consolidated report
After the loop, drop a Send Report activity:
| Property | Value |
|---|---|
| API Base URL | |
| API Key | in_RPAWatchApiKey |
| Flow ID | in_FlowId *(e.g. *"6f0a2c39-3d5e-4ca1-81fb-88368xxxx"*)* |
| Robot ID | in_RobotId *(e.g. *"8xxxx"*)* |
| Started At | startedAt |
| Target | "RPA Watch" |
| Source | "Excel" |
| Result Summary | $"{detailsTable.Select(\"status = 'success'\").Length} of {detailsTable.Rows.Count} records processed" |
| Status | *(leave empty — auto-calculated from *detailsTable*)* |
| Details | detailsTable |
| File Paths | new string[] { @"C:\Robomotion\Reports\Rapor_27-04-2026_16-02-03.xlsx" } |
| Response Status Code | respStatus |
| Response Body | resp |
| Is Success | isSuccess |
Because detailsTable contains rows with both success and failed, the run will be reported as partial_success automatically — no override needed. If the file paths in File Paths exist, they're uploaded as attachments using the original filenames.
Log the outcome (optional but recommended)
Drop a Log Message after Send Report with Level = Info and Message = $"RPA Watch returned {respStatus}". If a run ever fails to publish, this is the first place you'll look.
What you should see in RPA Watch
Within a few seconds, navigate to Processes → <your flow> in RPA Watch:
- A new run appears with status Partial success
- The duration matches the time between startedAt and the Send Report call
- The Details tab lists all three records, with row 2 highlighted as failed and the Error column populated
- The Attachments section shows Rapor_27-04-2026_16-02-03.xlsx for download
Common pitfalls
| Symptom | Fix |
|---|---|
Run is reported as success even though some rows failed | The Status expression isn't producing failed for the bad rows. Quick check: write currentDataRow["Flow Status"].ToString() to Log Message — values must compare equal to your literal "Completed", "Error", …) including casing and trailing whitespace. |
| Duration is a fraction of a second | The startedAt Assign is downstream of the Excel read. Move it to the top of the sequence. |
401 Unauthorized in Response Body | API key is missing, revoked, or scoped to a different account. Regenerate from Account Settings → API Keys. |
| Attachments don't appear on the dashboard | Each path in File Paths must exist on disk when Send Report runs. Missing paths are skipped silently. |