Skip to main content

Custom timeout for steps and flows

For each step can be defined a timeout. If the execution takes longer than the time limit, the execution of the step will be interrupted.

If defined, the custom timeout will be used instead of the instance timeout for the step (for self-hosted, defined by the environment variable TIMEOUT). The step's timeout cannot be greater than the instance maximum set by the TIMEOUT environment variable.

A timeout on a step running a script counts only the time that script's job runs. To bound a whole run, use a flow timeout.

Flow timeout​

A flow can also carry a timeout, in seconds, for the whole run, counted from when it starts running. Time spent sleeping or waiting at an approval counts against it. Set it in the flow settings, under Runtime > Execution policy > Timeout. Unlike a step's timeout, a flow timeout is not bounded by the instance TIMEOUT.

When the timeout is reached, Windmill cancels the running steps, runs the flow's error handler if it has one, and ends the run as cancelled by timeout, even if the error handler returns recover: true. A pending approval is abandoned, even with continue on disapproval/timeout set. The run can end up to about ten seconds after the deadline.

Subflows​

The timeout also applies when the flow runs as a subflow step, and a timeout set on the calling step replaces it. A subflow that times out fails that step.