Share via

ADF - How to get Activity to run when only 1 path completes?

David Donovan 21 Reputation points
Jan 27, 2021, 2:10 AM

I want to send out an error email if one of my activities in my pipeline fails. Ideally, I didn't want to have to make duplicate web activities, 1 for each possible activity that could fail. And I realized that depending on which activity failed, I probably wouldn't even know the name of which activity failed ahead of time (not sure if there's a way to determine the last run activity). So I attempted to put my output error message into a variable and then use whatever output is stored in that variable in my web activity for sending out the email's body text in the web actvity.

Little did I realize my web activity wasn't getting hit because it was waiting on all the set variable activities to complete. My question is there any way to do this without making duplicate web activities?

60772-adf-no-email.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,323 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Nandan Hegde 34,351 Reputation points MVP
    Jan 27, 2021, 3:18 AM

    hey @David Donovan ,
    you can achieve this by updating the flow status to 'On Completion' rather than 'success'.

    60738-status.png

    For that select the flow arrow and right click on it and then select: Completion

    But Completion expects it to atleast travel via that path and since your's is a case of either or:
    meaning it would either travel via 1st path or 2nd path ; so there are 2 steps :

    1) either create a duplicate web activity and use each one for the success or failure flow
    2) have your main logic in 1 pipeline
    Then create another pipeline :
    P1 >> Web activity

    2 people found this answer helpful.

  2. Tautvydas Perminas 6 Reputation points
    Dec 29, 2022, 9:16 AM

    You can connect multiple outcomes from same activity and it works as OR. so you can drag SKIPPED and COMPLETION to your final activity and it will execute in all situations, Here's an example:

    274801-image.png

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.