Callback for Workflow Run Timeout

Hi there,

I have an onboarding user workflow, and one of the steps is to wait for user verification by signal. I want to apply a workflow run timeout to the workflow, and I would like to perform some cleaning tasks on timeout.

workflowOptions := client.StartWorkflowOptions{
  WorkflowRunTimeout: time.Hours * 24 * 365 * 10
workflowRun, err := c.ExecuteWorkflow(context.Background(), workflowOptions, YourWorkflowDefinition)
if err != nil {
  // ...

Is there a way for me to provide a handler or callback function to the workflow run timeout? Thanks for your time and help.


WorkflowRunTimeout by definition is a timeout that terminates workflow without giving it any chance to perform the cleanup. Don’t use run or execution timeouts for business-level timeouts. Use a workflow timer to code any application specific cancellation and cleanup logic.

Thanks for the suggestion!