Send emails batch wise and give break 1 hour.

prudhviraj1
Tera Guru

Send emails batch wise, send 500 mails then give 1 hour break then send another 500 users. I have tried with fix script gs.sleep it was impacting the system performance. The output of all emails i have stored in Array. I am tried with flow designer by using for each condition the output I am getting 234 mails only. I have checked the related system property the count upto 16000+.

Please suggest how to send without using system performance. 

@Ankur Bawiskar  sir please suggest 

22 REPLIES 22

Hi @Ankur Bawiskar sir, I have taken the output variable type is Aray.String. and mapped this output from script action output (batches).

input variable type is Array.string and mapped input to input variable(users_list). And added this script action into the flow designer and given the input of all delegate users sys_id's.

 

If anything I need to be change please suggest.

@prudhviraj1 

should work ideally

did you add logs and verify in your script step?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar , might be for each is not working as expected. Please suggest 

@prudhviraj1 

for each requires array of objects and your output has it

so ideally it should work

did you try adding log in script?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar sir, if we are getting out put of batches wise, and it is stored in for each item, then what are next steps I have to taken to send mails batch wise. For sending Each batch delay with 5 minutes. 
with in the for each Added action 'send mail' then it was send to all the batches. Please Suggest send batch mails with delay of 5 minutes