- Get started
- Best practices
- Capabilities
- Skills
- CLI
- Examples
- Examples overview
- Recipe: build an agent
- Recipe: automate with RPA
- Recipe: enter data into a web app
- Recipe: extract data from a desktop app
- Recipe: refactor and test a workflow
- Recipe: a queue-based process with REFramework
- Recipe: build a Maestro Flow
- Recipe: coded app and API workflow
- Recipe: verify a release with Test Manager
- Recipe: extract data from documents with IXP
- Advanced
- Help
This recipe takes a workflow you already have, improves its structure and error handling, and adds a test case that proves it still works. It shows that a coding agent is useful well beyond the first build.
Prerequisites
- A coding agent set up for UiPath work, with an authenticated session (see Install and set up).
- An existing UiPath project with at least one workflow.
Refactor and test
-
Open your coding agent in the existing project folder.
-
Ask it to review first, without changing anything:
"Review
Process.xamlfor missing error handling, risky activity choices, and unclear structure. List the findings with severity. Do not fix anything." -
Review the findings and decide which to apply.
-
Ask the agent to apply those specific changes.
-
Ask the agent to add a test case that covers the main path:
"Add a Given-When-Then test case for the happy path of
Process.xaml, and register it in the project." -
Ask the agent to run the Workflow Analyzer and the test.
-
Resolve any problems it finds.
-
Review the diff and the test result before you accept the changes.
Result: a cleaner workflow with better error handling and a passing test that guards it.
The findings, the file layout, and the run commands vary by agent, project, and prompt. Confirm success from the test result and your own review of the diff, not from the agent's "done" message.