getStatus
Retrieve workflow status by ID to monitor progress and manage content operations in Adobe Experience Manager.
Instructions
Get workflow status by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes |
Implementation Reference
- Core handler implementation for the getStatus tool. Fetches workflow status from AEM's /etc/workflow/instances/{workflowId}.json endpoint, processes status mapping, step parsing, progress calculation, and returns structured response.async getWorkflowStatus(workflowId: string): Promise<WorkflowStatusResponse> { return safeExecute<WorkflowStatusResponse>(async () => { if (!workflowId) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, 'Workflow ID is required', { workflowId } ); } try { // Get workflow instance details const response = await this.httpClient.get(`/etc/workflow/instances/${workflowId}.json`); const workflowData = response.data; // Parse workflow status and steps const status = this.mapWorkflowStatus(workflowData.state); const steps = this.parseWorkflowSteps(workflowData.history || []); const currentStep = this.getCurrentStep(steps); const progress = this.calculateProgress(steps); return createSuccessResponse({ workflowId, status, currentStep, progress, startedBy: workflowData.startedBy || 'admin', startedAt: workflowData.startedAt || new Date().toISOString(), completedAt: status === 'COMPLETED' ? workflowData.completedAt : undefined, steps }, 'getWorkflowStatus') as WorkflowStatusResponse; } catch (error: any) { if (error.response?.status === 404) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Workflow not found: ${workflowId}`, { workflowId } ); } throw handleAEMHttpError(error, 'getWorkflowStatus'); } }, 'getWorkflowStatus'); }
- src/mcp-server.ts:693-696 (handler)MCP server dispatching handler for getStatus tool invocation within CallToolRequestSchema handler.case 'getStatus': { const result = await aemConnector.getWorkflowStatus(args.workflowId); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/mcp-server.ts:241-248 (schema)Input schema definition for getStatus tool registration, requiring workflowId parameter.name: 'getStatus', description: 'Get workflow status by ID', inputSchema: { type: 'object', properties: { workflowId: { type: 'string' } }, required: ['workflowId'], }, },
- TypeScript interface defining the output structure of the getStatus tool response.export interface WorkflowStatusResponse { success: boolean; operation: string; timestamp: string; data: { workflowId: string; status: 'RUNNING' | 'COMPLETED' | 'SUSPENDED' | 'ABORTED' | 'FAILED'; currentStep: string; progress: number; startedBy: string; startedAt: string; completedAt?: string; steps: Array<{ name: string; status: 'PENDING' | 'ACTIVE' | 'COMPLETED' | 'FAILED'; startedAt?: string; completedAt?: string; assignee?: string; comment?: string; }>; }; }
- src/mcp-server.ts:578-580 (registration)Registration of tool list handler that exposes getStatus among other tools via MCP ListToolsRequestSchema.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });