Work Queue Processor
Reads items from a queue source, processes each with per-item error isolation using BLOCK/ON BLOCK ERROR, and tracks status per record.
Problem this solves
One bad record kills the entire batch; need per-item error isolation.
Cross-references: Excel Reader to Datatable for loading queue items from Excel. Checkpoint & Resume for crash recovery across runs. Legacy App Data Entry Loop for the actual processing logic inside the BLOCK.
1Load Queue Items
Reads queue items from the source (Excel, CSV, or any DataTable). Sets up counters and results tracking.
Variables: varSourceFilePath (path to queue source), varCurrentMessage (logging), ExcelInstance (Excel session), varQueueItems (output — DataTable of queue items), varTotalItems (total count), varProcessedCount (counter), varSuccessCount (counter), varFailCount (counter), varResultsTable (outcome tracking)
2Process Queue with Per-Item Error Isolation
The core loop. Each item is processed inside a BLOCK with ON BLOCK ERROR so that failures are caught and logged without stopping the loop. The BLOCK catches ANY error from any action inside it — providing true per-item isolation.
Variables: varQueueItems (queue DataTable), TransactionItem (loop iterator), varProcessedCount (counter), varSuccessCount (counter), varFailCount (counter), varResultsTable (tracking), varCurrentMessage (logging), varTotalItems (total)
3Write Results Report
Exports the per-item results to CSV for audit.
Variables: varResultsTable (results DataTable), varResultsPath (output path), varCurrentMessage (logging)
Variable Reference Summary
| Variable | Type | Used In | Purpose |
| `varSourceFilePath` | Text | Pattern 1 | Path to queue source file |
| `varCurrentMessage` | Text | All patterns | Logging message for Subflow_Logging |
| `ExcelInstance` | Excel Instance | Pattern 1 | Excel session handle |
| `varQueueItems` | DataTable | Patterns 1, 2 | Queue items to process |
| `varTotalItems` | Numeric | Patterns 1, 2 | Total items in queue |
| `varProcessedCount` | Numeric | All patterns | Items processed counter |
| `varSuccessCount` | Numeric | All patterns | Successful items counter |
| `varFailCount` | Numeric | All patterns | Failed items counter |
| `varResultsTable` | DataTable | Patterns 1–3 | Per-item outcome tracking |
| `TransactionItem` | DataRow | Pattern 2 | Current queue item in loop |
| `varResultsPath` | Text | Pattern 3 | Output CSV path for results |
Notes
- BLOCK / ON BLOCK ERROR is the key. This is what provides per-item error isolation. Any error from ANY action inside the BLOCK jumps to ON BLOCK ERROR, logs the failure, and the LOOP continues to the next item. Without BLOCK, one error kills the entire loop.
LastError.message— Available inside ON BLOCK ERROR to capture the error message from whatever action failed. Use this for the results table error column.- Processing logic goes inside the BLOCK. Replace the placeholder WAIT with your actual processing — data entry, API calls, file operations, etc. Keep the success counter increment and results logging AFTER the processing logic but BEFORE the BLOCK END.
- BLOCK syntax (from reference Section 7):
BLOCK 'Name'/ON BLOCK ERROR/...error handling.../END/...normal actions.../END. The ON BLOCK ERROR section comes first, then the normal actions, then both close with END. - Safe stop check.
FlowControl.IfSafeStopat the top of the loop allows graceful termination between items. - Screenshot in error handler. The screenshot has its own
ON ERROR REPEATso a screenshot failure doesn't cascade. - Simple ON ERROR on action-level statements. No ON ERROR on SET or IF.
Dependencies
- Excel Reader to Datatable
- Checkpoint & Resume
- Legacy App Data Entry Loop