How can I increase the timeout for a custom powershell activity?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 12:50 PM
I have a workflow that installs software on Windows using powershell custom activities. I split it into several activities, one to check if the software is already installed, one to copy the files needed to the computer, and one to install the software. When it installs Office, it fails during the install portion because it times out after 610 seconds.
Most programs install fine within that timeout period. Is there a way I can increase the timeout period from within the activity or a run script so that I am not changing the timeout for all scripts that run on the MID Server, but just when I am installing programs that take a long time like Office.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 01:23 PM
Another thing I found out, is that if the MID server is overloaded, you may get timeouts for even short running activities. This does not solve the issue, but it is a valuable thing to realize when you get unexpected timeouts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 05:52 AM
Hi Mark
To be honest, we've had a few issues with Orchestration and Domain separation. So I'm getting a little familiar with the Orchestration and Probe script include classes and building custom Activity Definitions. Anyway, Stacey's post got me curious, and following her trail of thought I was able to get this working. We use Core activities, not the Custom ones. These are the steps I followed. I generated a custom PowerShell Probe, generated a custom Activity Definition that extends the "Run Powershell" one and added a max timeout activity variable. Then amended the activity definition's script so it knows what type of variable this is and what to do with it, and passes it as a parameter to the Probe. So when building a workflow, the user can drag this knew activity onto the canvas, and assign an integer value in seconds which will override the default timeout of 600 (or 610 as the ServiceNow behaviour adds an extra 10 seconds). So far this has been successful but it is still in UAT.
Rhiannone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2019 12:17 PM
Hi ,
Can you let us know how to add the max timeout activity to a custom powershell activity.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 08:45 AM
Hi rhiannone,
Can you please let me know what you modified in the script in custom activity to achieve above requirement?