Timeout Policies
Timeout policies protect workflows from running indefinitely. A timeout defines the maximum amount of time a workflow or operation is allowed to execute before it is considered to have exceeded its execution limit. Timeouts improve system stability by preventing stalled or excessively long-running tasks from consuming resources indefinitely.What is a Timeout?
A timeout specifies the maximum execution duration. Conceptually:Why Use Timeouts?
Not every operation finishes successfully. Sometimes tasks become stuck because of:- unresponsive services
- infinite loops
- blocked network requests
- external API delays
- infrastructure failures
- unexpected system behavior
Execution Timeline
A timeout measures elapsed execution time.Timeout Policy
BindAI provides a timeout policy object. Example:- maximum execution time
- behavior after timeout
Successful Completion
If execution completes within the allowed duration:Timeout Triggered
If execution exceeds the configured limit:Failing the Workflow
A common configuration is to fail the workflow immediately.Continuing After Timeout
Some workflows may choose not to fail immediately. Conceptually:Timeout vs Retry
Timeouts and retries address different concerns.
Both policies are often used together.
Timeout vs Loop
Loops intentionally repeat execution. Timeouts prevent excessive execution time.Common Use Cases
Timeout policies are useful for:- external API calls
- AI model inference
- document processing
- long-running workflows
- scheduled jobs
- network communication
- background automation
Combining Policies
Production workflows often combine multiple reliability mechanisms. Example:Monitoring
Timeout events should be monitored in production systems. Useful information includes:- execution duration
- node identifier
- workflow identifier
- timeout threshold
- retry attempts
- error details
Best Practices
- Set realistic timeout values.
- Use shorter timeouts for external services.
- Combine timeouts with retry policies.
- Monitor timeout frequency.
- Avoid excessively large timeout limits.
- Design workflows so interrupted tasks can be restarted safely when appropriate.
