Skip to main content
Glama

getStatus

Retrieve the status of a specific workflow by ID using the REST API on the AEM MCP Server. Simplify monitoring and management of workflows within Adobe Experience Manager.

Instructions

Get workflow status by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowIdYes

Implementation Reference

  • Registration of the 'getStatus' tool in the MCP tools list, including name, description, and input schema requiring workflowId
    name: 'getStatus', description: 'Get workflow status by ID', inputSchema: { type: 'object', properties: { workflowId: { type: 'string' } }, required: ['workflowId'], }, },
  • MCP server handler for 'getStatus' tool call: extracts workflowId from args and delegates to AEMConnector.getWorkflowStatus, returns JSON response
    case 'getStatus': { const result = await aemConnector.getWorkflowStatus(args.workflowId); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Core implementation of getWorkflowStatus: fetches workflow instance from AEM via HTTP GET to /etc/workflow/instances/{workflowId}.json, parses status, steps, progress using helpers, handles errors including 404 not found
    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'); }
  • Input schema definition for getStatus tool: object with required string workflowId
    inputSchema: { type: 'object', properties: { workflowId: { type: 'string' } }, required: ['workflowId'], }, },
  • Helper function calculateProgress used in getWorkflowStatus to compute workflow progress percentage from steps status
    private calculateProgress(steps: any[]): number { if (steps.length === 0) return 0; const completedSteps = steps.filter(step => step.status === 'COMPLETED').length; return Math.round((completedSteps / steps.length) * 100); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/indrasishbanerjee/aem-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server