Skip to content

Commit 6120448

Browse files
Merge pull request #302412 from ecfan/run-after
[UUF] Update UX for "run after" and "retry policy" per customer feedback
2 parents 64d8e06 + b7262cb commit 6120448

8 files changed

+78
-31
lines changed

articles/logic-apps/error-exception-handling.md

Lines changed: 78 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Handle errors and exceptions in workflows
3-
description: How to handle errors and exceptions that happen in automated tasks and workflows created by using Azure Logic Apps.
3+
description: Learn about options to handle errors and exceptions in workflows created with Azure Logic Apps.
44
services: logic-apps
55
ms.suite: integration
66
ms.reviewer: estfan, laveeshb, azla
77
ms.topic: how-to
88
ms.custom: engagement-fy23
9-
ms.date: 01/26/2025
9+
ms.date: 07/08/2025
1010
---
1111

1212
# Handle errors and exceptions in Azure Logic Apps
@@ -19,7 +19,7 @@ The way that any integration architecture appropriately handles downtime or issu
1919

2020
## Retry policies
2121

22-
For the most basic exception and error handling, you can use the *retry policy* when supported on a trigger or action, such as the [HTTP action](logic-apps-workflow-actions-triggers.md#http-trigger). If the trigger or action's original request times out or fails, resulting in a 408, 429, or 5xx response, the retry policy specifies that the trigger or action resend the request per policy settings.
22+
For the most basic exception and error handling, you can use the *retry policy* if this capability exists on a trigger or action, such as the [HTTP action](logic-apps-workflow-actions-triggers.md#http-trigger). If the trigger or action's original request times out or fails, resulting in a 408, 429, or 5xx response, the retry policy specifies that the trigger or action resend the request per policy settings.
2323

2424
<a name="retry-policy-limits"></a>
2525

@@ -40,23 +40,35 @@ Connector operations that support retry policies use the **Default** policy unle
4040

4141
### Change retry policy type in the designer
4242

43-
1. In the [Azure portal](https://portal.azure.com), open your logic app workflow in the designer.
43+
1. In the [Azure portal](https://portal.azure.com), open your logic app resource.
4444

45-
1. Based on whether you're working on a Consumption or Standard workflow, open the trigger or action's **Settings**.
45+
1. On the resource sidebar, follow these steps to open the workflow designer, based on your logic app:
4646

47-
* **Consumption**: On the action shape, open the ellipses menu (**...**), and select **Settings**.
47+
- **Consumption**: Under **Development Tools**, select the designer to open your workflow.
4848

49-
* **Standard**: On the designer, select the action. On the details pane, select **Settings**.
49+
- **Standard**
50+
51+
1. Under **Workflows**, select **Workflows**.
52+
53+
1. From the **Workflows** page, select your workflow.
54+
55+
1. Under **Tools**, select the designer to open your workflow.
56+
57+
1. On the trigger or action where you want to change the retry policy type, follow these steps to open the settings:
58+
59+
1. On the designer, select the operation.
60+
61+
1. On the operation information pane, select **Settings**.
5062

51-
1. If the trigger or action supports retry policies, under **Retry Policy**, select the policy type that you want.
63+
1. Under **Networking**, under **Retry policy**, select the policy type that you want.
5264

5365
### Change retry policy type in the code view editor
5466

55-
1. If necessary, confirm whether the trigger or action supports retry policies by completing the earlier steps in the designer.
67+
1. Confirm whether the trigger or action supports retry policies by completing the earlier steps in the designer.
5668

5769
1. Open your logic app workflow in the code view editor.
5870

59-
1. In the trigger or action definition, add the `retryPolicy` JSON object to that trigger or action's `inputs` object. Otherwise, if no `retryPolicy` object exists, the trigger or action uses the `default` retry policy.
71+
1. In the trigger or action definition, add the `retryPolicy` JSON object to the trigger or action's `inputs` object. If no `retryPolicy` object exists, the trigger or action uses the `default` retry policy.
6072

6173
```json
6274
"inputs": {
@@ -170,13 +182,12 @@ For the exponential interval retry policy, the following table shows the general
170182
| 3 | max(2 * interval, <*minimum-interval*>) | min(4 * interval, <*maximum-interval*>) |
171183
| 4 | max(4 * interval, <*minimum-interval*>) | min(8 * interval, <*maximum-interval*>) |
172184
| .... | .... | .... |
173-
||||
174185

175186
<a name="control-run-after-behavior"></a>
176187

177188
## Manage the "run after" behavior
178189

179-
When you add actions in the workflow designer, you implicitly declare the order to use for running those actions. After an action finishes running, that action is marked with a status such as **Succeeded**, **Failed**, **Skipped**, or **TimedOut**. By default, an action that you add in the designer runs only after the predecessor completes with **Succeeded** status. In an action's underlying definition, the `runAfter` property specifies that the predecessor action that must first finish and the statuses permitted for that predecessor before the successor action can run.
190+
When you add actions in the workflow designer, you implicitly declare the order to use for running those actions. After an action finishes running, that action is marked with a status such as **Succeeded**, **Failed**, **Skipped**, or **TimedOut**. By default, an action that you add in the designer runs only after the predecessor completes with **Succeeded** status. In an action's underlying JSON definition, the `runAfter` property specifies that the predecessor action that must first finish and the statuses permitted for that predecessor before the successor action can run.
180191

181192
When an action throws an unhandled error or exception, the action is marked **Failed**, and any successor action is marked **Skipped**. If this behavior happens for an action that has parallel branches, the Azure Logic Apps engine follows the other branches to determine their completion statuses. For example, if a branch ends with a **Skipped** action, that branch's completion status is based on that skipped action's predecessor status. After the workflow run completes, the engine determines the entire run's status by evaluating all the branch statuses. If any branch ends in failure, the entire workflow run is marked **Failed**.
182193

@@ -189,48 +200,84 @@ For example, to run the Office 365 Outlook **Send an email** action after the Ex
189200
> [!NOTE]
190201
>
191202
> In the designer, the "run after" setting doesn't apply to the action that immediately
192-
> follows the trigger as the trigger must run successfully before the first action can run.
203+
> follows the trigger. The trigger must successfully run before the first action can run.
193204
194205
<a name="change-run-after-designer"></a>
195206

196207
### Change "run after" behavior in the designer
197208

198-
1. In the [Azure portal](https://portal.azure.com), open the logic app workflow in the designer.
209+
1. In the [Azure portal](https://portal.azure.com), open your logic app resource.
210+
211+
1. On the resource sidebar, follow these steps to open the workflow designer, based on your logic app:
212+
213+
- **Consumption**: Under **Development Tools**, select the designer to open your workflow.
214+
215+
- **Standard**
216+
217+
1. Under **Workflows**, select **Workflows**.
218+
219+
1. From the **Workflows** page, select your workflow.
199220

200-
1. On the designer, select the action shape. On the details pane, select **Settings**.
221+
1. Under **Tools**, select the designer to open your workflow.
201222

202-
The **Run After** section in the **Settings** pane shows the predecessor action for the currently selected action.
223+
1. On the trigger or action where you want to change the "run after" behavior, follow these steps to open the operation's settings:
203224

204-
:::image type="content" source="media/error-exception-handling/configure-run-after.png" alt-text="Screenshot shows workflow designer and current action details pane with selected Settings tab.":::
225+
1. On the designer, select the operation.
205226

227+
1. On the operation information pane, select **Settings**.
206228

207-
1. Expand the predecessor action to view all the possible predecessor statuses.
229+
The **Run after** section contains a **Select actions** list, which shows the available predecessor operations for the currently selected operation, for example:
208230

209-
By default, the "run after" status is set to **Is successful**. So, the predecessor action must successfully finish before the currently selected action can run.
231+
:::image type="content" source="media/error-exception-handling/predecessor-operations.png" alt-text="Screenshot shows list for Select actions with predecessor operations." lightbox="media/error-exception-handling/predecessor-operations.png":::
210232

211-
:::image type="content" source="media/error-exception-handling/change-run-after-status.png" alt-text="Screenshot shows current action and its default run after status set to Is successful.":::
233+
1. Under the **Select actions** list, expand the current predecessor operation, which is **HTTP** in this example:
212234

213-
1. To change the "run after" behavior to the statuses that you want, select those statuses. Make sure that you first select an option before you clear the default option. You have to always have at least one option selected.
235+
:::image type="content" source="media/error-exception-handling/current-predecessor.png" alt-text="Screenshot shows current predecessor operation." lightbox="media/error-exception-handling/current-predecessor.png":::
236+
237+
By default, the "run after" status is set to **Is successful**. This value means the predecessor operation must successfully finish before the current action can run.
238+
239+
:::image type="content" source="media/error-exception-handling/default-run-after-status.png" alt-text="Screenshot shows current run after status set to Is successful." lightbox="media/error-exception-handling/default-run-after-status.png":::
240+
241+
1. To change the "run after" behavior to the statuses that you want, select those statuses.
214242

215243
The following example selects **Has failed**.
216244

217-
:::image type="content" source="media/error-exception-handling/failed-run-after-status.png" alt-text="Screenshot shows current action with run after behavior set to Has failed.":::
245+
:::image type="content" source="media/error-exception-handling/failed-run-after-status.png" alt-text="Screenshot shows current run after behavior set to Has failed." lightbox="media/error-exception-handling/failed-run-after-status.png":::
246+
247+
1. To specify that the current operation runs only when the predecessor action completes with the **Has failed**, **Is skipped**, or **Has timed out** status, select these statuses, and then clear the default status, for example:
248+
249+
:::image type="content" source="media/error-exception-handling/run-after-multiple-statuses.png" alt-text="Screenshot shows current action and selected multiple run after statuses." lightbox="media/error-exception-handling/run-after-multiple-statuses.png":::
250+
251+
> [!NOTE]
252+
>
253+
> Before you clear the default status, make sure that you first select
254+
> another status. You must always have at least one status selected.
218255
219-
1. To specify that the current action runs when the predecessor action completes with **Failed**, **Skipped**, or **TimedOut** status, select these statuses.
256+
1. To require that multiple predecessor operations run and finish, each with their own "run after" statuses, follow these steps:
220257

221-
:::image type="content" source="media/error-exception-handling/run-after-multiple-statuses.png" alt-text="Screenshot shows current action and multiple selected run after statuses.":::
258+
1. Open the **Select actions** list, and select the predecessor operations that you want.
222259

223-
1. To require that more than one predecessor action runs, each with their own "run after" statuses, expand the **Select actions** list. Select the predecessor actions that you want, and specify their required "run after" statuses.
260+
1. Select the "run after" statuses for each operation.
224261

225-
:::image type="content" source="media/error-exception-handling/multiple-predecessor-actions.png" alt-text="Screenshot shows current action and available multiple predecessor actions.":::
262+
:::image type="content" source="media/error-exception-handling/multiple-predecessor-actions.png" alt-text="Screenshot shows current action and available multiple predecessor actions." lightbox="media/error-exception-handling/multiple-predecessor-actions.png":::
226263

227-
1. When you're ready, select **Done**.
264+
1. When you finish, close the operation information pane.
228265

229266
---
230267

231268
### Change "run after" behavior in the code view editor
232269

233-
1. In the [Azure portal](https://portal.azure.com), open your logic app workflow in the code view editor.
270+
1. On the resource sidebar, follow these steps to open the code view editor, based on your logic app:
271+
272+
- **Consumption**: Under **Development Tools**, select code view to open your workflow in the JSON editor.
273+
274+
- **Standard**
275+
276+
1. Under **Workflows**, select **Workflows**.
277+
278+
1. From the **Workflows** page, select your workflow.
279+
280+
1. Under **Tools**, select code view to open your workflow in the JSON editor.
234281

235282
1. In the action's JSON definition, edit the `runAfter` property, which has the following syntax:
236283

@@ -301,7 +348,7 @@ For limits on scopes, see [Limits and config](logic-apps-limits-and-config.md).
301348

302349
### Set up a scope with "run after" for exception handling
303350

304-
1. In the [Azure portal](https://portal.azure.com), open your logic app workflow in the designer.
351+
1. In the [Azure portal](https://portal.azure.com), open your logic app resource and workflow in the designer.
305352

306353
Your workflow must already have a trigger that starts the workflow.
307354

@@ -443,6 +490,6 @@ For example, [Azure Monitor](/azure/azure-monitor/overview) provides a streamlin
443490

444491
For more information, review [Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps](monitor-workflows-collect-diagnostic-data.md).
445492

446-
## Next steps
493+
## Related content
447494

448-
* [Learn more about Azure Logic Apps examples and scenarios](logic-apps-examples-and-scenarios.md)
495+
* [Azure Logic Apps examples and scenarios](logic-apps-examples-and-scenarios.md)
Binary file not shown.
27.7 KB
Loading
27.6 KB
Loading
-8.76 KB
Loading
-16 KB
Loading
30.3 KB
Loading
-8.3 KB
Loading

0 commit comments

Comments
 (0)