Workflow activity executing multiple times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:38 PM
Hello All,
This is regarding the workflow which I have been working on:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:45 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021 12:13 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021 09:38 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:48 PM
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.