(ref: WorkflowRunReference)
| 188 | } |
| 189 | |
| 190 | async cancelWorkflow(ref: WorkflowRunReference): Promise<void> { |
| 191 | const handle = await this.getWorkflowHandle(ref); |
| 192 | this.logger.warn(`Terminating workflow ${handle.workflowId} (runId=${ref.runId ?? 'latest'})`); |
| 193 | // Use terminate() for immediate stop - shows as TERMINATED status |
| 194 | // cancel() requires workflow cooperation and may show as FAILED if not handled |
| 195 | await handle.terminate('User requested stop'); |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * Send a signal to a running workflow |
no test coverage detected