Regarding set intervals in flow designers automation

ack
Tera Contributor

HI All,

 anyone please help on this automation. 

I am doing one orchestration on SNOW using Python developed script.  we placed script in MID server and calling using flow designer.  this script will do the application JOBs forcefully start and placed the output log in MID server particular path with ticket number. then we will patch that logs in pasted in work notes. 

 

Now Barriers is - script complete time is totally defends on nature on the app job. sometimes may take seconds , minutes or days as well. so we have define intervals that first check after 3 minutes , 2nd check after 8 minutes then after every 10 minutes until JOB up. 

 

example - if job takes 10 hours, so we need to update ticket first 3 minutes , 2nd 8th minute , next every 10 minutes.

 

now my question - how to define the this intervals in flow designer. if job completed with in 2 minutes then first interval i have to update the work notes , past the logs and close that. 

 

if it takes 9 minutes, after 3  minutes i have to update notes saying " trying to make job UP"  skipp the loop in next 2nd interval i need to update the entire logs and close. 

 

if it takes 1 hours , same after 3 mnts work notes update skipp the loop , then after 8 mnts work notes and skipp the loop  then followed every 10 mnts work notes  need to be update until job up and once up paste the log and close. 

 

thanks in advance.

 

6 REPLIES 6

Viraj Hudlikar
Giga Sage

Hello @ack 

It's something complex but if you look with pseudo code it might be helpful:

# Pseudo-code for the custom script action to check job status
define check_job_status():
    job_status = get_job_status()  # Function to get the current job status from your application or your source where you checking
    if job_status == "complete":
        update_work_notes("Job completed. Logs: ...")
        close_ticket()
        return True
    else:
        update_work_notes("Still trying to make job UP")
        return False

# Flow Designer steps
1. Trigger: Job initiated
2. Wait: 3 minutes
3. Script Action: check_job_status()
4. If job complete: update_work_notes() and close_ticket()
5. Wait: 5 minutes (total 8 minutes)
6. Script Action: check_job_status()
7. If job complete: update_work_notes() and close_ticket()
8. Loop: Every 10 minutes
   - Wait: 10 minutes
   - Script Action: check_job_status()
   - If job complete: update_work_notes() and close_ticket()

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

@Viraj Hudlikar ,

 

Thank for the quick response. 

 

I am checking status and defined first two interval but I was stuck to define 3rd interval in flow. I am not sure how to check every 10 minutes until staus UP and I have update worknyes every 10 minute sin 3rd loop.

 

Please help me to define flow logic.

Hello @ack 

I just created a sample flow logic to help with understanding just use it as per your requirements.

 

VirajHudlikar_0-1737719045741.png

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

@Viraj Hudlikar ,

 

and one more thing, 

 

if 1st interval job completed then how to stop run next 2 intervals ?