* Query a running workflow for state
(input: {
workflowId: string;
queryType: string;
args?: unknown[];
})
| 214 | * Query a running workflow for state |
| 215 | */ |
| 216 | async queryWorkflow<T = unknown>(input: { |
| 217 | workflowId: string; |
| 218 | queryType: string; |
| 219 | args?: unknown[]; |
| 220 | }): Promise<T> { |
| 221 | const handle = await this.getWorkflowHandle({ workflowId: input.workflowId }); |
| 222 | this.logger.debug(`Querying workflow ${input.workflowId} with query '${input.queryType}'`); |
| 223 | return handle.query(input.queryType, ...(input.args ?? [])); |
| 224 | } |
| 225 | |
| 226 | private async getWorkflowHandle(ref: WorkflowRunReference): Promise<WorkflowHandle<any>> { |
| 227 | const client = await this.getClient(); |
no test coverage detected