Skip to main content
Glama

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
NameRequiredDescriptionDefault
n8nJsonNon8n workflow JSON object or string export
optionsNoOptional import options (e.g. maxNodes, allowPartial)
workflowNoOptional workflow metadata overrides for preview contract

Implementation Reference

  • 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) => {
  • 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),
            }],
  • 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 }),
        });
    }

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/Agentled/mcp-server'

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