Set-KFScriptRunTimeout

Syntax

Set-KFScriptRunTimeout
  -AdditionalScriptTimeout <additional-script-timeout-in-seconds>
Set-KFScriptRunTimeout
  -TotalScriptTimeout <total-script-timeout-in-seconds>

Support

>= kenaflow 2.0.18

Description

Workflow scripts are executed inside PowerShell. As in every programming language it is possible in PowerShell to create loops. It is not possible for kenaflow to check the "code quality" of a workflow script. If you (accidentally) create an endless loop kenaflow would not be able to stop the script. Therefore it has an security feature that forces scripts to stop if they run too long.

The initial setting for maximum script runtime is set in Global Configuration setting defaultScriptRunTimeout or in the workflow configuration missing.

If a workflow knows that it needs more time the execution timeout can be set inside the workflow script during execution.

There are two options:

  • Add some time to the current timeout.
  • Set the total execution timeout.

The total or remaining timeout can be read with cmdlet Get-KFScriptRunTimeout

Parameter

-AdditionalScriptTimeout <additional-script-timeout-in-seconds>

Add the <additional-script-timeout-in-seconds> specified amount of seconds to the total script run timeout.

-TotalScriptTimeout <total-script-timeout-in-seconds>

Set the total script timeout in seconds.

Examples

if( (Get-KFInDebug) ) {
   Set-KFMaxExecutionTimeout -Maximum
   Set-KFScriptRunTimeout -TotalScriptTimeout 86400
}