Set-KFMaxExecutionTimeout
Syntax
Set-KFMaxExecutionTimeout
-Maximum
Set-KFMaxExecutionTimeout
-TotalExecutionTimeSeconds <total-execution-timeout-in-seconds>
Support
>= kenaflow 2.0.18
Description
Workflows consist of one or more PowerShell scripts. These scripts are executed for each item that needs to be processed by the current workflow pass. This can take a long time if many elements are involved. As known, kenaflow processes workflows in parallel up to a certain amount. But after that sequentially. From e.g. 100 active workflows 5 are executed at the same time. But so that e.g. these 5 currently executed workflows do not prevent all other workflows for a very long time, e.g. because a lot of elements are processed, the maximum execution time per workflow is limited. In the standard: 10 minutes. After that, the workflow is terminated "nicely". The workflow knows itself that it has to come to the end. The next element will not be processed and must wait until the next workflow run. kenaflow will try to continue there.
The maximum execution time can be set in the global configuration: MaxExecutionTime
in Section "Runtime".
Each workflow can override this value in _wfconfig.ps1
: MaxExectuinTime
in General Workflow Settings.
This cmdlet can be used within the workflow script to adjust this time.
There are two options:
- Set the max execution time limit to a certain value with
-TotalExecutionTimeSeconds
or - set it to
-Maximum
(864000s)
Parameter
-Maximum
Set the total execution timeout to around 864000 seconds = 10 days.
-TotalExecutionTimeSeconds <total-execution-timeout-in-seconds>
Set the total execution timeout in seconds.
Examples
if( (Get-KFInDebug) ) {
Set-KFMaxExecutionTimeout -Maximum
Set-KFScriptRunTimeout -TotalScriptTimeout 86400
}