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
+7-14Lines changed: 7 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,11 +187,13 @@ For the exponential interval retry policy, the following table shows the general
187
187
188
188
## Manage the "run after" behavior
189
189
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**.
190
+
When you add actions in the workflow designer, you implicitly declare the sequence for running those actions. After an action finishes running, that action is marked with a status such as **Succeeded**, **Failed**, **Skipped**, or **TimedOut**. In other words, the predecessor action must first finish with any of the permitted statuses before the successor action can run.
191
191
192
-
By default, an action that you add in the designer only *runs after*the preceding action completes with **Succeeded** status. This "run after" behavior precisely specifies the run order for actions in a workflow. Basically, the predecessor action must first finish with any of the permitted statuses before the successor action can run.
192
+
By default, an action that you add in the designer runs only if the preceding action completes with **Succeeded** status. This *run after* behavior precisely specifies the run order for actions in a workflow.
193
193
194
-
You can change the default "run after" behavior for an action by [editing the action's **Run after** setting](#change-run-after-designer). In an action's underlying JSON definition, the `runAfter` property specifies one or more predecessor actions that must first finish with the specific permitted statuses before the successor action can run. The `runAfter` property is a JSON object that provides flexibility by letting you specify all the predecessor actions that must finish before the successor action runs. This object also defines an array of acceptable statuses.
194
+
In the designer, you can change the default "run after" behavior for an action by [editing the action's **Run after** setting](#change-run-after-designer). This setting is available only on subsequent actions that follow the first action in a workflow. The first action in a workflow always runs after the trigger sucessfully runs. So, the **Run after** setting isn't available and doesn't apply to the first action.
195
+
196
+
In an action's underlying JSON definition, the **Run after** setting is the same as the `runAfter` property. This property specifies one or more predecessor actions that must first finish with the specific permitted statuses before the successor action can run. The `runAfter` property is a JSON object that provides flexibility by letting you specify all the predecessor actions that must finish before the successor action runs. This object also defines an array of acceptable statuses.
195
197
196
198
For example, to have an action run after action A succeeds and also after action B succeeds or fails when you're working on an action's JSON definition, set up the following `runAfter` property:
197
199
@@ -205,11 +207,7 @@ For example, to have an action run after action A succeeds and also after action
205
207
}
206
208
```
207
209
208
-
> [!NOTE]
209
-
>
210
-
> The **Run after** setting is available only on actions that follow the first action in a workflow.
211
-
> The first action in a workflow must always run after the trigger, so the **Run after** setting
212
-
> doesn't apply and isn't available for the first action.
210
+
### "Run after" behavior for error handling
213
211
214
212
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**.
215
213
@@ -219,11 +217,6 @@ To make sure that an action can still run despite its predecessor's status, you
219
217
220
218
For example, to run the Office 365 Outlook **Send an email** action after the Excel Online **Add a row into a table** predecessor action is marked **Failed**, rather than **Succeeded**, change the "run after" behavior using either the designer or code view editor.
221
219
222
-
> [!NOTE]
223
-
>
224
-
> In the designer, the "run after" setting doesn't apply to the action that immediately
225
-
> follows the trigger. The trigger must successfully run before the first action can run.
226
-
227
220
<aname="change-run-after-designer"></a>
228
221
229
222
### Change "run after" behavior in the designer
@@ -236,7 +229,7 @@ For example, to run the Office 365 Outlook **Send an email** action after the Ex
236
229
237
230
-**Standard**
238
231
239
-
1.Under**Workflows**, select **Workflows**.
232
+
1.On the resource sidebar, under**Workflows**, select **Workflows**.
240
233
241
234
1. From the **Workflows** page, select your workflow.
To run actions only after another group of actions succeed or fail,
16
-
group those actions inside a *scope*. This structure is useful when
17
-
you want to organize actions as a logical group,
18
-
evaluate that group's status, and perform actions
19
-
that are based on the scope's status.
20
-
After all the actions in a scope finish running,
21
-
the scope also gets its own status. For example,
22
-
you can use scopes when you want to implement
23
-
[exception and error handling](../logic-apps/logic-apps-exception-handling.md#scopes).
15
+
To run a group of actions only after another group of actions succeed or fail, you can nest the dependent actions inside a *scope*. This structure is useful when you want to organize actions as a logical group, evaluate that group's status, and perform actions that are based on the scope's status. After all the actions in a scope finish running, the scope also gets its own status. For example, you can use scopes when you want to implement [exception and error handling](../logic-apps/logic-apps-exception-handling.md#scopes).
24
16
25
17
To check a scope's status, you can use the same criteria
26
18
that you use to determine a logic apps' run status,
@@ -43,17 +35,13 @@ If all the scoped actions succeed, the logic app sends a "Scope succeeded" messa
43
35
44
36
## Prerequisites
45
37
46
-
To follow the example in this article, you need these items:
38
+
* An Azure account and subscription. If you don't have a subscription, [sign up for a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?WT.mc_id=A261C142F).
47
39
48
-
* An Azure subscription. If you don't have a subscription,
49
-
[sign up for a free Azure account](https://azure.microsoft.com/free/).
40
+
* An email account from any email provider supported by Azure Logic Apps.
50
41
51
-
* An email account from any email provider supported by Logic Apps.
52
-
This example uses Outlook.com. If you use a different provider,
53
-
the general flow stays the same, but your UI appears different.
42
+
This example uses Outlook.com. If you use a different provider, the general flow stays the same, but your UI appears different.
54
43
55
-
* A Bing Maps key. To get this key, see
56
-
<ahref="/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key"target="_blank">Get a Bing Maps key</a>.
44
+
* A Bing Maps key. To get this key, see [Get a Bing Maps key](//bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key).
57
45
58
46
* Basic knowledge about [logic apps](../logic-apps/logic-apps-overview.md)
59
47
@@ -282,19 +270,36 @@ Your finished logic app now looks like this example:
282
270
283
271

284
272
285
-
## Test your work
273
+
## Test your workflow
286
274
287
-
On the designer toolbar, select **Run** > **Run**. If all the scoped actions succeed,
288
-
you get a "Scope succeeded" message. If any scoped actions don't succeed,
289
-
you get a "Scope failed" message.
275
+
On the designer toolbar, select **Run** > **Run**. If all the scoped actions succeed, you get a **Scope succeeded** message. If any scoped actions don't succeed, you get a **Scope failed** message.
290
276
291
277
<a name="scopes-json"></a>
292
278
293
279
## JSON definition
294
280
295
-
If you're working in code view, you can define a scope structure
296
-
in your logic app's JSON definition instead. For example,
297
-
here is the JSON definition for trigger and actions in the previous logic app:
281
+
If you're working in code view, you can define a scope in your workflow's JSON definition instead. The following sample shows the definition for a basic scope:
282
+
283
+
```json
284
+
{
285
+
"actions": {
286
+
"Scope": {
287
+
"type": "Scope",
288
+
"actions": {
289
+
"Http": {
290
+
"inputs": {
291
+
"method": "GET",
292
+
"uri": "https://www.bing.com"
293
+
},
294
+
"runAfter": {},
295
+
"type": "Http"
296
+
}
297
+
}
298
+
}
299
+
}
300
+
}
301
+
302
+
The following example shows the JSON definition for the trigger and actions in the preceding workflow:
298
303
299
304
``` json
300
305
"triggers": {
@@ -305,10 +310,7 @@ here is the JSON definition for trigger and actions in the previous logic app:
305
310
"interval": 1
306
311
}
307
312
}
308
-
}
309
-
```
310
-
311
-
```json
313
+
},
312
314
"actions": {
313
315
"If_scope_failed": {
314
316
"type": "If",
@@ -446,7 +448,7 @@ here is the JSON definition for trigger and actions in the previous logic app:
446
448
},
447
449
```
448
450
449
-
## Next steps
451
+
## Related content
450
452
451
453
*[Run steps based on a condition (condition action)](../logic-apps/logic-apps-control-flow-conditional-statement.md)
452
454
*[Run steps based on different values (switch action)](../logic-apps/logic-apps-control-flow-switch-statement.md)
Copy file name to clipboardExpand all lines: articles/logic-apps/update-workflow-definition-language-schema.md
+1-19Lines changed: 1 addition & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,14 @@ The [latest Workflow Definition Language schema version June-01-2016](https://sc
16
16
17
17
*[Scopes](#scopes) let you group or nest actions as a collection of actions.
18
18
*[Conditions and loops](#conditions-loops) are first-class actions.
19
-
* More precise ordering for running actions with the `runAfter` property, replacing `dependsOn`
20
19
21
20
To upgrade older workflow definitions to the current schema, see [Upgrade your schema](#upgrade-your-schema).
22
21
23
22
<aname="scopes"></a>
24
23
25
24
## Scopes
26
25
27
-
This schema includes scopes, which let you group actions together, or nest actions inside each other. For example, a condition can contain another condition. Learn more about [scope syntax](./logic-apps-control-flow-loops.md),
28
-
or review this basic scope example:
26
+
This schema includes scopes, which let you group actions together, or nest actions inside each other. For example, a condition can contain another condition. Learn more about [scope syntax](logic-apps-control-flow-run-steps-group-scopes.md), or review this basic scope example:
29
27
30
28
```json
31
29
{
@@ -77,22 +75,6 @@ In previous schema versions, conditions and loops were parameters associated wit
77
75
}
78
76
```
79
77
80
-
<aname="run-after"></a>
81
-
82
-
## 'runAfter' property
83
-
84
-
The `runAfter` property replaces `dependsOn`, providing more precision when you specify the run order for actions based on the status of previous actions. The `dependsOn` property indicated whether "the action ran and was successful", based on whether the previous action succeeded, failed, or as skipped - not the number of times you wanted to run the action. The `runAfter` property provides flexibility as an object that specifies all the action names after which the object runs. This property also defines an array of statuses that are acceptable as triggers. For example, if you want an action to run after action A succeeds and also after action B succeeds or fails, set up this `runAfter` property:
0 commit comments