- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 02:09 AM
Hi Team,
In workflow, We have run script activity which takes around 10 minutes to execute therefore workflow throws an error as 'Transaction Cancelled : Max execution time exceeded'. Why this issue occurs and how to resolve it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 02:22 AM
Hi @SandeepKSingh
There is transaction Qouta limit set in instance. If any transaction exceeds this limit then it gets cancelled. Generally it is set between 2 to 5mins so if we want our scenario to work then we can increase this value.
However increasing this value is not best practice or may create perormance impact, so rather you can plan to run such heavy long running scripts in background. To do so, we can write such scripts in Script Actions ( Script Actions runs asynchronously in the background ) and call them via workflow run script activity. This way workflow will trigger script in background and move ahead with next activities.
Use the above script in Script action and call on WF.
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 02:40 AM
Hi @SandeepKSingh,
Just picking up your response and noting @Ravi Gaurav 's response.
Clearly the Script due to either the volume of tickets or the nature of the update is exceeding the given time limit. As pointed out, it is not best practice to extend this limit.
You have 2 options - run the update to the record asynchronous (Basically meaning that they run in the background and the current process is not help up waiting for them) or fine tune the script (if the volume of records is relatively small) to ensure you're only querying and updating the required tickets so the time limit is not exceeded.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 02:55 AM
Thanks Bingo it worked with script action..