- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
3.6.10. Workflow Timeout
In this chapter, you’ll learn how to set a timeout for workflows and steps.
What is a Workflow Timeout?#
By default, a workflow doesn’t have a timeout. It continues execution until it’s finished or an error occurs.
You can configure a workflow’s timeout to indicate how long the workflow can execute. If a workflow's execution time passes the configured timeout, it is failed and an error is thrown.
Timeout Doesn't Stop Step Execution#
Configuring a timeout doesn't stop the execution of a step in progress. The timeout only affects the status of the workflow and its result.
Configure Workflow Timeout#
The createWorkflow
function can accept a configuration object instead of the workflow’s name.
In the configuration object, you pass a timeout
property, whose value is a number indicating the timeout in seconds.
For example:
This workflow's executions fail if they run longer than two seconds.
errors
property of the workflow’s execution, as explained in this chapter. The error’s name is TransactionTimeoutError
.Configure Step Timeout#
Alternatively, you can configure the timeout for a step rather than the entire workflow.
The step’s configuration object accepts a timeout
property, whose value is a number indicating the timeout in seconds.
For example:
This step's executions fail if they run longer than two seconds.
errors
property of the workflow’s execution, as explained in this chapter. The error’s name is TransactionStepTimeoutError
.