# Review an RPA workflow for errors, fragility, and best practices

A structured code review of a UiPath, Power Automate, or similar bot workflow, with issues ranked and explained before any changes.

- Topic: Software Development
- Framework: Few-Shot
- Level: Standard
- Tags: Analyze, Explain & Teach, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/review-an-rpa-workflow-for-errors-fragility-and-best-practices

## Prompt

```text
Review my RPA workflow and explain what to fix. Do not rewrite it until I confirm which changes I want.

**Platform:** [e.g. "UiPath (XAML)", "Power Automate Desktop", "Automation Anywhere"]
**What the process does:** [SHORT DESCRIPTION and the apps it touches]
**Workflow files:** [PASTE the XAML or exported workflow]
**Known problems:** [e.g. "fails when the page loads slowly", "hard to maintain" - or "none"]

Check for:
1. **Selectors and UI interaction** - brittle or full-path selectors, hard-coded indexes, missing wildcards or anchors, fixed delays instead of element-exists or wait activities.
2. **Error handling** - missing Try/Catch, business vs. system exceptions not separated, no retry scope, no screenshot or log on failure, bot left in a bad state.
3. **Structure** - giant single workflows, duplicated logic that should be reusable components, unclear argument directions, unused variables, variables with too wide a scope.
4. **Configuration** - hard-coded paths, URLs, credentials, or emails that belong in config files or orchestrator assets.
5. **Logging and auditability** - meaningful log messages at key steps.
6. **Performance** - unnecessary loops, reading the same file or screen repeatedly.
7. **Naming and readability** - activity, variable, and argument names.

Return a table: # | Location (file/activity) | Issue | Why it matters | Recommended fix | Severity (critical/major/minor). Then list the 3 changes that would most improve reliability, and wait for my go-ahead before producing modified code.
```

## What to fill in

- SHORT DESCRIPTION and the apps it touches
- PASTE the XAML or exported workflow

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
