Files
Agent-n8n/n8n-n8n-1.109.2/packages/cli/src/controllers/orchestration.controller.ts
2025-09-08 04:48:28 +08:00

25 lines
742 B
TypeScript
Executable File

import { Post, RestController, GlobalScope } from '@n8n/decorators';
import { License } from '@/license';
import { WorkerStatusService } from '@/scaling/worker-status.service.ee';
@RestController('/orchestration')
export class OrchestrationController {
constructor(
private readonly licenseService: License,
private readonly workerStatusService: WorkerStatusService,
) {}
/**
* This endpoint does not return anything, it just triggers the message to
* the workers to respond on Redis with their status.
*/
@GlobalScope('orchestration:read')
@Post('/worker/status')
async getWorkersStatusAll() {
if (!this.licenseService.isWorkerViewLicensed()) return;
return await this.workerStatusService.requestWorkerStatus();
}
}