Various Ways to Disable/Skip/Comment out Flow Steps when Testing in Power Automate

Sometimes when we are debugging flows, we want some of the steps to be disabled/skipped and ignored by the Power Automate engine so that those actions are not triggered while we are still working on the other parts of the flow. But currently, there is no way in Power Automate to disable the steps for testing/debugging scenarios (yet) even though the Power Automate team has been working on making this feature available since mid of March last year.

What this post is not about.

This is not about how to add comments to the flow steps.

What this post is about.

This is about how to disable or exclude the steps in the flow action without deleting the step so that the steps can be re-enabled / re-used later. (which is equivalent to the programming term “comment out” the code for switching off a chunk of code temporarily)

Quote from Wiki:
A common developer practice is to comment out a code snippet, meaning to add comment syntax causing that block of code to become a comment, so that it will not be executed in the final program.

When would you need to use this feature?

I often need this feature when I am testing/debugging the flow and I do not want to trigger some of the steps yet (e.g. there is a "List records" action followed by "Delete a record" step for all records from the list). In this case, I would want to test the "List records" action first and make sure the output is as I expected and tweak the filter query properly before I let the flow run up to the Delete steps. Otherwise, the flow will delete the records and I would have to re-create the test data again.

Some other times, I want to update the existing flow by removing some of the steps, but I want to keep those steps in an inactive state until I have completely tested the whole flow to be working fine before I completely remove them.

Another scenario is when I need to test the last part of a long running flow and I want to disable the long running process, skip that middle part, mock the data and only test the last part repeatedly.

Here are the different ways you can disable/skip a flow step:

Using the Terminate Action

If the steps that you want to disable are at the end of the flow, you can configure your flow so it would not reach the last step  by adding the Terminate step with Succeeded status before it reaches the last steps. That is equivalent to "unreachable code after return statement" in the normal programming.

function f() {
  var x = 1 + 2;
  x = 3 + 4;

Using Configure run after

When the steps that you want to skip is in the middle of the flow, you can bundle all of those steps in a Scope control. After that, set the "Configure run after" of the Scope control to "is skipped" or "has timed out" and set the step afterwards as "is skipped" too. You can read more details at this blog post by Pieter Veenstra.

Using Condition control

You can also use the Condition control to skip the steps you don’t want to execute. All you have to do is add a Condition control with dummy condition (e.g. 1 = 1) then move the steps that you do not want to run into the negative branch of the flow and the flow will just skip those steps in every run.

Using Copy to my clipboard

This method is by temporarily deleting the steps from your flow but copying into the clipboard before the step is deleted. This allows you to add the steps back from the clipboard once you are completed with the debugging. However, with this method, there is a risk of losing the steps in the clipboard if the flow designer browser tab crashed or the browser is closed by accident.

If you also have some other tips or other ways that you do to disable/skip some of the flow steps, feel free to comment here or on my social media posts. I would love to know your approach.


Popular Posts

[Power Automate] How to Set Lookup Field Value in Common Data Service (current environment) Flow Connector

[Power Apps] Using Common Data Service's Lookup Data Type Field in Canvas App

Validating Document Upload in Business Process Flow by Setting Field Requirement Level Conditionally (Part 2 of 2)

Get the Lookup Display Name and Option Set Value Label in a Single Query Using a CDS (Current Environment) Connector FormattedValue Property

Move Attachment from File Field of CDS to SharePoint in Power Automate (Part 1 of 2)

Find out how to include a link to the record (Record URL) when sending an email from Dynamics 365/CDS using flow

[Power Automate] List Records - Use Expand Query to Retrieve Related Data in flow

Send Email from Dynamics 365/CDS with Attachment from Notes Using Flow

Getting the Lookup Attribute of the Parent Record in Power Apps Canvas App Development with Common Data Service (CDS)

How to Set Lookup Fields with Null Value from Dynamic Content in CDS (current environment) Connector