You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/logic-apps/error-exception-handling.md
+78-31Lines changed: 78 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
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.
4
4
services: logic-apps
5
5
ms.suite: integration
6
6
ms.reviewer: estfan, laveeshb, azla
7
7
ms.topic: how-to
8
8
ms.custom: engagement-fy23
9
-
ms.date: 01/26/2025
9
+
ms.date: 07/08/2025
10
10
---
11
11
12
12
# Handle errors and exceptions in Azure Logic Apps
@@ -19,7 +19,7 @@ The way that any integration architecture appropriately handles downtime or issu
19
19
20
20
## Retry policies
21
21
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.
23
23
24
24
<aname="retry-policy-limits"></a>
25
25
@@ -40,23 +40,35 @@ Connector operations that support retry policies use the **Default** policy unle
40
40
41
41
### Change retry policy type in the designer
42
42
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.
44
44
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:
46
46
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.
48
48
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**.
50
62
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.
52
64
53
65
### Change retry policy type in the code view editor
54
66
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.
56
68
57
69
1. Open your logic app workflow in the code view editor.
58
70
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.
60
72
61
73
```json
62
74
"inputs": {
@@ -170,13 +182,12 @@ For the exponential interval retry policy, the following table shows the general
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.
180
191
181
192
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**.
182
193
@@ -189,48 +200,84 @@ For example, to run the Office 365 Outlook **Send an email** action after the Ex
189
200
> [!NOTE]
190
201
>
191
202
> 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.
193
204
194
205
<aname="change-run-after-designer"></a>
195
206
196
207
### Change "run after" behavior in the designer
197
208
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.
199
220
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.
201
222
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:
203
224
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.
205
226
227
+
1. On the operation information pane, select **Settings**.
206
228
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:
208
230
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":::
210
232
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:
212
234
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.
214
242
215
243
The following example selects **Has failed**.
216
244
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.
218
255
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:
220
257
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.
222
259
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.
224
261
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":::
226
263
227
-
1. When you're ready, select **Done**.
264
+
1. When you finish, close the operation information pane.
228
265
229
266
---
230
267
231
268
### Change "run after" behavior in the code view editor
232
269
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.
234
281
235
282
1. In the action's JSON definition, edit the `runAfter` property, which has the following syntax:
236
283
@@ -301,7 +348,7 @@ For limits on scopes, see [Limits and config](logic-apps-limits-and-config.md).
301
348
302
349
### Set up a scope with "run after" for exception handling
303
350
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.
305
352
306
353
Your workflow must already have a trigger that starts the workflow.
307
354
@@ -443,6 +490,6 @@ For example, [Azure Monitor](/azure/azure-monitor/overview) provides a streamlin
443
490
444
491
For more information, review [Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps](monitor-workflows-collect-diagnostic-data.md).
445
492
446
-
## Next steps
493
+
## Related content
447
494
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)
0 commit comments