0

There are 9 workflows we have created. each workflow is dependent on previous workflow. 002_ workflow is running by schedule trigger except 002 all are running with event based trigger. enter image description here

Problem statement: problem is there are several notebooks in workflows that are not running daily or maybe they can failed. but campaign_inseason notebbok is critical for me it should run everyday. So can i create another workflow and can i use If activity and in expression i can pass check if this campaign_inseason notebook have ran successfully or not, and if it's True then i will pass wait activity in False case i will pass the campaign_inseason notebook so that it can run. but problem is how can i check if this campaign_inseason notebook have ran successfully or not. enter image description here

1 Answers1

0

To get the status of activity inside child pipeline you can use Rest API.

Follow below Process:

  • On completion of your campaign_inseason notebook activity add web activity to get the status of child pipeline activity with Rest API and configure it like below.

Sample URL:

https://management.azure.com/subscriptions/@{pipeline().globalParameters.SubscriptionId}/resourceGroups/@{pipeline().globalParameters.ResourceGrpName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{activity('Execute Pipeline1').output.pipelineRunId}/queryActivityRuns?api-version=2018-06-01

In body pass the last updated before and last updated after parameter with filter of activity name to get status of particular activity.

Request body:

{
    "lastUpdatedAfter": "2023-05-25T17:50:00.1653329Z",
    "lastUpdatedBefore": "2023-05-26T17:50:00.1653329Z",
    "filters":[{"operand":"ActivityName","operator":"Equals","values":["Set variable1"]},],
}

My web activity settings

enter image description here

Output of web activity:

enter image description here

  • After this add If condition activity and check the status from web activity output with expression like below:
@if(equals(activity('Web1').output.value.Status,'Succeeded'),true,false)

enter image description here

And place the activities you want accordingly in True and False case.

You can also refer my answer from this SO thread

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11