How to make Flow execute multiple Scheduled Jobs in correct order?

Aki18
Tera Contributor

I created a custom Flow. The Flow calls custom Action that calls the Scheduled Job (A) to execute, using "

SncTriggerSynchronizer.executeNow()" method.

What I would like the Flow to do next is to call another Action to execute another Scheduled Job (B).

The important thing is to consider the sequence. Only after the first Scheduled Job (A) is completed, the next one (B) needs to work.

Please let me know how to achieve this.

*I tried to make the Flow check the "sys_trigger" record, but looks like its state is always "ready", so I think the Flow can't recognize the Scheduled job's completion.

 

Best Regards,

Aki

1 ACCEPTED SOLUTION

Hello @Aki18 

 

That's the purpose of whole your requirement right ? If the scheduled job A is failing and you are not finding any logs, why would you proceed with scheduled job B. 

 

look at the below picture - 

1000020927.jpg

 

This job was created by me and it's running per flow designer and it creates record only when completed. FILTER I TOLD WAS TO SORT IT Z TO A AND CREATED AT OR AFTER. 

 

You won't be getting more records like that. 

 

1000020928.jpg

 

See how I added filter and I am not getting records. So just add the created filter in such a way that it brings only one record. I am sure there wouldn't be 10 other flows running this job so you won't be confused in multiple records. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY.

 

View solution in original post

16 REPLIES 16

Hello @Aki18 

 

That's the purpose of whole your requirement right ? If the scheduled job A is failing and you are not finding any logs, why would you proceed with scheduled job B. 

 

look at the below picture - 

1000020927.jpg

 

This job was created by me and it's running per flow designer and it creates record only when completed. FILTER I TOLD WAS TO SORT IT Z TO A AND CREATED AT OR AFTER. 

 

You won't be getting more records like that. 

 

1000020928.jpg

 

See how I added filter and I am not getting records. So just add the created filter in such a way that it brings only one record. I am sure there wouldn't be 10 other flows running this job so you won't be confused in multiple records. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY.

 

Aki18
Tera Contributor

Hi @Shivalika ,

Sorry to reply late. So, to check if the "syslog_transaction" record which is created by current Flow Action execution exists, we need add query condition in the Flow, correct?
What I can see in your screenshot example is "Created > 2 min ago", so your solution is like to add the similar condition in the Flow logic as below, correct?

 

Aki18_0-1742984906310.png

 

Hello @Aki18 

 

Yes !! That's what I have been telling since day 1 of your question post 😅

 

You can modify the created filter based on duration you feel the job runs. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Aki18
Tera Contributor

@Shivalika ,

Okay, now I understand what you mean, thank you!
I had been sticking to finding the way to identify exact log record that is corresponding to the Job, not filtering the records using time window.

Hello @Aki18 

 

Greatt !!  It works 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY