Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Optimizing the performance of flows in Power Automate is essential for creating efficient, reliable workflows that execute quickly and with minimal errors. Follow these best practices to streamline automation processes and achieve better outcomes.
Choose the right actions to interact with apps and services
When looking for actions to automate your app or service, consider the following priorities, listed from most to least preferable:
Cloud connector actions. Learn more about Cloud connectors as Power Automate for desktop actions.
Application or file-specific Power Automate for desktop actions. For example, for Excel, PDF, and file/folder.
Actions from the UI automation and Browser automation groups of actions.
Image recognition actions like Move mouse to image and Extract text with OCR, Mouse and keyboard actions like Send keys and Send mouse click, and Clipboard actions. Learn more about automating with mouse, keyboard, and OCR actions.
As an alternative to OCR actions for extracting data, consider the AI Builder cloud connector action Recognize text in an image or a PDF document, which is available for cloud flows. Learn more about using the text recognition prebuilt model in Power Automate.
For more advanced scenarios, consider Scripting actions, like Run VBScript or Run Python script, and HTTP actions such as Invoke web service.
Apply error handling
Identify potential points of failure within your flow and handle them with the in-product error handling functionality.
Handle errors for individual actions through their On error parameters.
Handle errors for groups of actions with the On block error action.
Retrieve the latest occurred error and use it in later actions with the Get last error action.
Use the Stop flow action to stop the flow gracefully.
Log custom messages with the Log message action or any other action that can write text to an external location.
Learn more about configuring error handling functionality.
Use "Wait for" actions and timeouts
Using wait actions and timeouts can help improve flow performance and reliability.
Use Wait for … actions and set a timeout. (Avoid using the generic Wait action.)
Configure the Flow timeout property to specify the maximum allowed time that the flow is allowed to run.
Adjust the timeout settings for distinct desktop and web automation scenarios. Learn more about Timeout configuration for UI and browser automation.
Remove unused components
Keep only the necessary flow components by deleting any disabled actions and removing unused UI elements and images. This practice decreases the size of the flow and reduces saving and loading times.
Avoid unnecessary loops
Avoid looping through large datasets, such as Excel files with thousands of records.
Use the Data table actions or Database actions for data table-related operations.
Use PowerFx functions. Learn more about Power Fx in desktop flows.
Use Scripting actions, like Run VBScript or Run Python script.
Follow best practices for cloud flows by learning more about working only with relevant data and avoiding anti-patterns.