validate_workflow
Validate workflow pipeline definitions to detect errors like missing connections, required fields, unreachable steps, and invalid configurations before execution.
Instructions
Validate a workflow's pipeline definition. Returns structured errors per step. Use this after creating or updating a workflow to check for:
Missing step connections (broken next.stepId references)
Missing required fields (app action without inputs, AI step without prompt)
Unreachable steps (not connected to the trigger chain)
Invalid app/action IDs (not in the app registry)
Missing trigger or milestone steps
List field misconfigurations (missing itemFields, defaultValue format mismatches)
Config page field validation (missing name/type on input page fields)
Each error/warning may include a "suggestedFix" with a concrete remediation.
You can also pass a pipeline object to validate a draft before saving. Returns: { valid: boolean, errors: [...], warnings: [...], stepCount: number }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The workflow ID to validate | |
| pipeline | No | Optional draft pipeline to validate before saving (merged with stored pipeline) |
Implementation Reference
- src/tools/workflows.ts:147-177 (handler)Registration and handler for validate_workflow tool.
server.tool( 'validate_workflow', `Validate a workflow's pipeline definition. Returns structured errors per step. Use this after creating or updating a workflow to check for: - Missing step connections (broken next.stepId references) - Missing required fields (app action without inputs, AI step without prompt) - Unreachable steps (not connected to the trigger chain) - Invalid app/action IDs (not in the app registry) - Missing trigger or milestone steps - List field misconfigurations (missing itemFields, defaultValue format mismatches) - Config page field validation (missing name/type on input page fields) Each error/warning may include a "suggestedFix" with a concrete remediation. You can also pass a pipeline object to validate a draft before saving. Returns: { valid: boolean, errors: [...], warnings: [...], stepCount: number }`, { workflowId: z.string().describe('The workflow ID to validate'), pipeline: z.record(z.string(), z.any()).optional().describe('Optional draft pipeline to validate before saving (merged with stored pipeline)'), }, async ({ workflowId, pipeline }, extra) => { const client = clientFactory(extra); const result = await client.validateWorkflow(workflowId, pipeline); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; } ); - src/client.ts:122-127 (helper)The API client method that performs the network request for workflow validation.
async validateWorkflow(id: string, pipeline?: Record<string, any>) { return this.request(`/workflows/${id}/validate`, { method: 'POST', body: JSON.stringify({ pipeline }), }); }