How to set a Workflow Execution Timeout in Go
Create an instance of StartWorkflowOptions
from the go.temporal.io/sdk/client
package, set the WorkflowExecutionTimeout
field, and pass the instance to the ExecuteWorkflow
call.
- Type:
time.Duration
- Default: Unlimited
workflowOptions := client.StartWorkflowOptions{
// ...
WorkflowExecutionTimeout: time.Hours * 24 * 365 * 10,
// ...
}
workflowRun, err := c.ExecuteWorkflow(context.Background(), workflowOptions, YourWorkflowDefinition)
if err != nil {
// ...
}