Introduction

Power Automate offers many useful actions, but Terminate is one of the most helpful for controlling flow execution. It allows us to stop a flow when a specific condition is met, prevent unnecessary actions, and simplify debugging. In this article, we will explore how to use Terminate with a practical example of preventing duplicate invoice records in SharePoint.

When working with Power Automate, we often use actions such as Get Items, Create Item, Update Item, Send an Email, and Start an Approval.

But there is one small action that can make flow development and troubleshooting much easier: Terminate.

The Terminate action is not just used to stop a flow. It can also help us debug flows, prevent unnecessary operations, and control how a flow execution ends.

What Is the Terminate Action?

The Terminate action allows you to stop the execution of a cloud flow at a specific point.

When Power Automate reaches this action, it immediately stops processing the remaining actions in that flow.

You can configure three different statuses:

  • Succeeded: Ends the flow successfully.

  • Failed: Ends the flow with a failure status.

  • Cancelled: Ends the flow with a cancelled status.

Choosing the correct status is important because it helps identify whether the flow completed successfully or stopped due to an issue.

1. Using Terminate for Debugging

Suppose you are developing a flow that retrieves invoice records from a SharePoint list and processes them based on the environment.

Your flow contains the following actions:

  1. Trigger – When an item is created.

  2. Get Items – Retrieve existing invoice records.

  3. Condition – Check whether the record already exists.

  4. Create Item – Create a new record.

  5. Update Item – Update the existing record.

  6. Send Email – Notify the responsible user.

While developing the flow, you want to verify whether the Get Items action returns the correct records.

Instead of executing the entire flow, add a Terminate action immediately after Get Items.

Set the status to Succeeded.

Now, when you run the flow:

  • Get Items retrieves the records.

  • Terminate stops the flow.

  • The remaining actions are not executed.

You can open the flow run history and inspect the Get Items output.

This helps you validate your query without creating or updating unnecessary SharePoint records.

2. Using Terminate to Prevent Duplicate Records

Consider an invoice processing flow where you want to prevent duplicate invoice records.

Before creating a new record, use Get Items to check whether the invoice number already exists.

Add a Condition to check the result:

Condition:

length(body('Get_items')?['value']) is greater than 0

If the condition is true, the invoice already exists.

Add a Terminate action in the Yes branch and configure its status as Succeeded.

If the condition is false, continue with Create Item.

This prevents duplicate records from being created.

3. Using Terminate When Required Data Is Missing

Sometimes a flow receives incomplete information.

For example, an invoice approval flow requires:

  • Invoice Number

  • Vendor Name

  • Invoice Amount

If the invoice number is missing, there is no reason to continue processing the approval.

Add a Condition to check whether the Invoice Number is empty.

If it is empty, use Terminate with the Failed status and provide a meaningful error message, such as:

Invoice Number is missing. Flow processing stopped.

Otherwise, continue with the remaining actions.

This makes your flow easier to troubleshoot and prevents processing invalid records.

4. How to Add the Terminate Action

Follow these simple steps:

  1. Open your Power Automate flow.

  2. Select + New step.

  3. Search for Terminate.

  4. Select the Terminate action under Control.

  5. Choose the required Status.

  6. Add a Message if you want to explain why the flow is stopping.

  7. Save and test your flow.

Important: Use Succeeded when you intentionally stop processing without treating it as an error. Use Failed when the flow should be reported as unsuccessful.

Practical Example: Prevent Duplicate Invoice Records Using Terminate Action

Suppose you are developing an Invoice Approval application using Power Apps, SharePoint, and Power Automate.

When a user submits an invoice, the flow should check whether the invoice number already exists in the SharePoint list.

Scenario: If the invoice already exists, stop the flow. Otherwise, create a new invoice record.

Flow implementation

  1. Trigger – When an item is created

    Start the flow when a new invoice is submitted.

  2. Get Items – SharePoint

    Retrieve records matching the submitted invoice number.

    Code
    InvoiceNumber eq 'INV-1001'
  3. Condition – Check duplicate invoice

    Code
    length(body('Get_items')?['value'])

    Check whether the result is greater than 0.

  4. If Yes – Terminate

    Succeeded

    Stop processing because the invoice already exists.

  5. If No – Create Item

    Create a new invoice record in SharePoint.

  6. Send Email

    Notify the user that the invoice was submitted successfully.

Expected result

Scenario

Flow result

Invoice already exists

Terminate – Succeeded

Invoice does not exist

Create invoice and send email

Example message

For the Terminate action, configure:

  • Status: Succeeded

  • Message: Duplicate invoice found. Flow processing stopped.

Key benefit: The flow avoids creating duplicate invoice records and executing unnecessary actions.

Note: The Terminate action should be placed inside the Yes branch of the Condition. The No branch should continue with invoice creation.

Conclusion

The Terminate action may look like a simple action in Power Automate, but it is very useful for both debugging and controlling flow execution.

Whether you are validating Get Items results, preventing duplicate records, handling missing information, or stopping unnecessary processing, Terminate can help make your flows cleaner and easier to maintain.

Sometimes, the best way to make a flow more efficient is simply knowing when to stop it!