Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Alert - Workflow Complete

Avatar

Avatar
Validate 1
Level 1
montezh2001
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
montezh2001
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
montezh2001
Level 1

10-07-2021

All, 

 

I have a situation that requires me to create an alert when a workflow completes successfully. The workflow runs daily and contains 13 deliveries (based on segmentation in the workflow); not all will send. I tried putting all the delivery transitions into and And-Join and then straight to an Alert Activity, but realized that if no records are found during segmentation for a delivery, then I have them going straight to an END activity. 

 

Is there a way to send an email that when the workflow is complete for the day, I can send an email to Assignee's letting them know the workflow ran successfully for the day? Or, do I have to set up an alert for each Delivery (Success) and End (No Records Available)?

 

I would like it to work similar to how the Error alert works - meaning when a workflow fails, a group I assigned is notified. 

 

Please advise. 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

80 likes

Total Posts

277 posts

Correct Reply

87 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

80 likes

Total Posts

277 posts

Correct Reply

87 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile
Darren_Bowers
MVP

11-07-2021

Hi @montezh2001 - there are quite a few options here and everyone has their favourite.

The solution below is when I have a lot of things in a workflow all wanting to go to a final activity but they all have to finish first. You just use a simple counter that gets incremented whenever the Stop activity is reached. In each Stop, you evaluate if the correct number of "things" has happened (in your case 13). If you get to that number then fire off a signal into the same workflow and run your alert or whatever final thing you want to do. Activities can run whenever they want, but the Alert will only fire when the correct number of things has happened. I like this approach because you don't have to try an make all transitions feed into a single activity (which can get ugly when you have lots of them).

The example below has two activities. The Alert should fire when the first query is either true or false and also when the second query is either true or false. It doesn't care which way the test goes as long as one leg fires on each query.

1. Set up the counter flag into the Start activity Advanced tab :

 

instance.vars.counterFlag = 0;​
// Put in how many deliveries you have here
vars.totalThingsToDo = 2;

 

2. The code in each Stop activity is:

 

//increment the counter flag
instance.vars.counterFlag += 1;
//test to see if all activities have been completed
if (instance.vars.counterFlag == vars.totalThingsToDo) {
  xtk.workflow.PostEvent("myWorkflowName", "signal", "", <variables />, false);
}​

 

You can just copy and paste the Stop activity once you have set it up

Darren_Bowers_0-1626047282806.png

Cheers

Darren

 

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
montezh2001
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
montezh2001
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
montezh2001
Level 1

11-07-2021

@Darren_Bowers Thank you for this; this works and it phenomenal.