preview_n8n_import
Analyze n8n workflow JSON to preview import results, identify unsupported nodes, and generate readiness summary before actual import.
Instructions
Preview a deterministic n8n import from JSON. Returns:
normalized import hash and IR
mapped step graph
unsupported nodes + remediation
warnings/risks
draft workflow build contract and compiler readiness summary
This is a read-only preview and does not create any workflow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n8nJson | No | n8n workflow JSON object or string export | |
| options | No | Optional import options (e.g. maxNodes, allowPartial) | |
| workflow | No | Optional workflow metadata overrides for preview contract |
Implementation Reference
- src/tools/workflows.ts:388-408 (registration)Registration of the 'preview_n8n_import' tool in the MCP server.
server.tool( 'preview_n8n_import', `Preview a deterministic n8n import from JSON. Returns: - normalized import hash and IR - mapped step graph - unsupported nodes + remediation - warnings/risks - draft workflow build contract and compiler readiness summary This is a read-only preview and does not create any workflow.`, { n8nJson: z.any().describe('n8n workflow JSON object or string export'), options: z.record(z.string(), z.any()).optional().describe('Optional import options (e.g. maxNodes, allowPartial)'), workflow: z.object({ name: z.string().optional(), goal: z.string().optional(), description: z.string().optional(), pathname: z.string().optional(), }).optional().describe('Optional workflow metadata overrides for preview contract'), }, async ({ n8nJson, options, workflow }, extra) => { - src/tools/workflows.ts:408-415 (handler)The handler for the 'preview_n8n_import' tool, which delegates to the client's previewN8nImport method.
async ({ n8nJson, options, workflow }, extra) => { const client = clientFactory(extra); const result = await client.previewN8nImport(n8nJson, options, workflow); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], - src/client.ts:375-384 (handler)The actual implementation of the 'previewN8nImport' method that executes the API request.
async previewN8nImport( n8nJson: string | Record<string, any>, options?: Record<string, any>, workflow?: { name?: string; goal?: string; description?: string; pathname?: string } ) { return this.request('/workflows/import/n8n/preview', { method: 'POST', body: JSON.stringify({ n8nJson, options, workflow }), }); }