Towards Microsoft Flow
Flow is one of the best tools from Microsoft to automate tasks, it opens up a new way to escape from a heap of repetitive tasks by automating them to make your work and life easier. This documentation will feature the best practices while creating and managing your Microsoft Flow processes.
How to Activate a workflow
You can either create a workflow from scratch or with the help of available templates. There should be at least one step for the workflow to be activated. A workflow cannot be edited when it is activated. Before running the flow should be saved and activated. Also, the first triggering action can perform the run automatically.
Whether it is activated or deactivated, only the workflow owner will be able to edit the flow unless permission is given to administrators in certain cases. Otherwise, if someone else can modify flows created by users and reroute it to some other tasks without them being aware of the change.
1. Avoid Infinite Loops
It is the sworn responsibility of creators to keep track of items that can end up in a loop, that can badly affect the performance of the server as well as wastage of resources.
To cite an example, let us consider a workflow to update an item in a list and without intention, you created another action to update the list when an item is added, it enters an infinite loop by triggering the workflow again and again.
Such actions should be avoided by efficient use of triggers, actions, and conditions. The flow should be meaningful and perform an efficient logic to create successful solutions.
2. Utilize Child Workflows
Sometimes same logic has to be applied in branches or different workflows, at this point use that logic as a child workflows instead of replicating it manually each time. The advantage is you can easily maintain changes from the child workflow rather than examining different workflows that apply similar logic.
3. Make use of Workflow Templates
Somehow workflows are very even if they are small or large. The idea behind workflow id to ease your job. There are several tiny, small and large workflow templates that can be used directly for creating the desired workflow.
The cool feature of templates is it can be modified to create another workflow by adding or removing components. The newly created workflow can also be copied and shared among the team.
4. Delete completed workflow jobs automatically
To save disk space it is always recommended to delete the completed workflows which are working in the background. In general settings under workflow job retention, there is a checkbox to enable Automatically delete completed workflow jobs option.
5. Enable logs for workflow jobs that bump into errors
In the case of synchronous workflows, it is a brilliant idea to select the option Keep logs for workflow jobs that encountered errors in the workflow’s general definition.
This will help to analyze the failures in workflow execution and can be used for troubleshooting purposes.
These logs can later be deleted anytime to save space.
6. Make notes to keep track of Changes
Keep a note to update the changes made on different flows. The notes tab will be later helpful to understand what you did earlier. This practice will help others to understand what are you trying to implement using that flow structure.
7. Reduce the no. of workflows that update the same entity
Linking more than one flow to the same entity can cause resource locking issues.
Imagine two flows waiting to update a resource entity with two different values.
In such cases, multiple instances of workflows waiting to update the same resource can create lockdowns such as SQL error, long wait or crashing.
8. Flow on-demand process
By enabling this option will allow users to run flow using Run Workflow command. If the flow is not needed it won’t be working, otherwise we can trigger flow using the above command.
Make sure that you follow all the above criteria while creating your flows for production or personal purposes. These best practices will give you better results and it saves your time.