Best Practices & Expert Tips
These recommendations help you build robust, readable and maintainable scenarios in Aiviro Editor.
1. Start small, scale quickly
Create a micro-scenario — a few actions that launch an app and click one button. Master the basics, then add loops, conditions and Python blocks.
2. Test frequently
Select a branch in the Commands tree and run only that. Fixing an error in a five-action scenario takes minutes; finding the same error inside fifty actions can cost hours.
3. Wait for the screen, do not sleep
The single biggest cause of flaky automations is a fixed Sleep that was long enough on the day it was written. Use Wait For on something the next screen actually shows, and Wait Until Disappear for progress dialogs. Keep Sleep for the rare case where nothing observable changes.
4. Anchor searches to something stable
If a value changes every run, do not search for the value — search for the label next to it with a positional search. Prefer text-based objects over Image, which breaks on theme changes and DPI scaling.
5. Never put a credential in an action
Every password, token and webhook URL belongs in the Vault,
referenced as {{SECRET:KEY}}. A credential typed into a parameter is written into the
project file on the next save — and then into the Git history.
6. Think in variables
Store dynamic data — copied text, file paths, read values — in variables instead of
hard-coding it. Give them descriptive names: record_system_id, not variable_1.
7. Structure with sections
Group related actions into Section blocks (Login, Export CSV, Send report). Sections collapse, run in isolation, and make the Diagram view readable.
8. Comment the why
The action list already says what happens. Write down what it cannot: "this dialog only appears on the first login of the day", "the export takes ~40 s on month-end".
9. Disable, do not delete
Instead of deleting a risky action, set its Run Action to Disabled. It stays in the tree, greyed out, and can be re-enabled in one click.
10. Use environments instead of duplicating scenarios
Enabled (Test) and Enabled (Prod) let one scenario behave differently in the two environments, switched by the Environment toggle. Two copies of a scenario always drift apart; one scenario with two modes does not.
11. Handle failure explicitly
- Run on Failure on a reporting action, so a broken run is never silent.
- Run Always on cleanup such as Close All Windows, so the machine is left usable.
- Required success off for genuinely optional steps — but only those.
12. Keep loops finite
Repeat until can spin forever if the condition never flips. Bound it with a counter, a Stop the loop on an iteration limit, or a condition tied to something the screen shows.
13. Report what the run did
Add Message with a Section ID through the scenario plus one Send As Email at the end turns a black-box job into a report someone can read over coffee.
14. Share and version
Projects are stored as JSON — commit them to Git and branch like any code. Because secrets live in the Vault, the project file is safe to commit. File → Export as Python gives you a diff-friendly view for code review.
15. Get inspired
Explore the YouTube tutorial playlist and the sample projects — see References & Resources. Reuse existing patterns instead of reinventing them, and pull shared routines in with Import Scenario.
Following these practices keeps your automations clear, easier to debug and understandable to colleagues.