The CreatorCon Call for Content is officially open! Get started here.

Workflow activity executing multiple times

Nagendra7
Kilo Contributor

Hello All,

 

This is regarding the workflow which I have been working on:

find_real_file.png

 

The issue in the above flow is that it is executing properly the 1st time but after the creation of the event when it runs again it is creating the same event twice and when it is executing for the 3rd time it is creating 4 events (same event).

 

Can someone please let me know why this is happening?

Thanks in advance.

Regards,

Nagendra.

14 REPLIES 14

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

If your workflow activity is getting executed for the Create Event then it is created event in event log table

did you check the workflow context how many times the Create Event activity ran

Regards
Ankur

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

Hello Ankur,

 

Thanks for the reply.

The create event activity runs one time when it executes for the first time. When it executes the 2nd time, the create event runs twice and creates 2 events. 3rd time 4 events, and 5th time 16 events. Its like 1:2:4:16 likewise.

 

Regards,

Nagendra.

Hello Ankur,

 

The issue is with timer. Whenever we run the timer again (in a loop), whatever executes after that timer. it will multiply the execution.

The alternative which i thought was using a runscript with gs.sleep(). But using sleep is not a best practice.

Is there any way we can restart the timer when running again?

Please let me know if there is any other alternative.

Tried using rollback activity, but that doesn't work either.

 

Regards,

Nagendra.

Rushikesh Ravin
Giga Contributor

Hi Nagendra,

 

Please remove all transition which is connected from Create Task activity to Timer activity and join to end or appropriate activity.

Because you join them it's looping and create tasks multiple times.

 

Thank you.