Returning error to force timed-out status

Hi. We have some custom logic in our workflows that implements a time-out, with cleanup of resources, using a timer and futures. We’d like to return an error from the workflow function such that the workflow is given a “timed-out” status by temporal, but we can’t find an error type that does this. Is it possible?

Don’t believe this is currently possible. WorkflowExecutionTimedOut status is set by server if workflow run/execution timeout fire. Even if you threw/returned TimeoutFailure/TimeoutError from workflow code the workflow status would be WorkflowExecutionFailed.

You could define custom search attribute (advanced visibility) that denotes your business level status and upsert it to value that you can later on use to query completed execs, for example:

tctl wf list -q "ExecutionStatus='Failed' AND MyCustomStatus='TimedOutByLogic'"

Thanks Tihomir.