suspendWorkflow
Pause a running workflow instance in Adobe Experience Manager to temporarily halt automated processes for maintenance or issue resolution.
Instructions
Suspend a workflow instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | ||
| reason | No |
Implementation Reference
- Core handler implementation that performs HTTP POST to AEM's /etc/workflow/instances/{workflowId} endpoint with action 'suspend' to suspend the workflow.async suspendWorkflow(workflowId: string, reason?: string): Promise<{ success: boolean; operation: string; timestamp: string; data: { workflowId: string; reason?: string; status: string; suspendedAt: string; }; }> { return safeExecute(async () => { if (!workflowId) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, 'Workflow ID is required', { workflowId } ); } // Suspend the workflow const suspendData = { action: 'suspend', reason: reason || 'Suspended via AEM MCP Server' }; const response = await this.httpClient.post( `/etc/workflow/instances/${workflowId}`, suspendData, { headers: { 'Content-Type': 'application/json' } } ); return createSuccessResponse({ workflowId, reason: suspendData.reason, status: 'SUSPENDED', suspendedAt: new Date().toISOString() }, 'suspendWorkflow'); }, 'suspendWorkflow'); }
- src/mcp-server.ts:778-782 (handler)MCP server CallToolRequestSchema handler that extracts parameters from MCP request and delegates to AEMConnector.suspendWorkflowcase 'suspendWorkflow': { const { workflowId, reason } = args as { workflowId: string; reason?: string }; const result = await aemConnector.suspendWorkflow(workflowId, reason); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/mcp-server.ts:487-498 (schema)Input schema definition for the suspendWorkflow tool used in MCP listTools response{ name: 'suspendWorkflow', description: 'Suspend a workflow instance', inputSchema: { type: 'object', properties: { workflowId: { type: 'string' }, reason: { type: 'string' } }, required: ['workflowId'], }, },
- src/mcp-handler.ts:93-94 (handler)Custom MCPRequestHandler switch case that handles suspendWorkflow requests and calls AEMConnectorcase 'suspendWorkflow': return await this.aemConnector.suspendWorkflow(params.workflowId, params.reason);
- src/aem-connector-new.ts:260-262 (helper)AEMConnector wrapper method that delegates suspendWorkflow call to WorkflowOperations moduleasync suspendWorkflow(workflowId: string, reason?: string) { return this.workflowOps.suspendWorkflow(workflowId, reason); }