Skip to main content
Glama

import_n8n_workflow

Convert n8n workflow JSON into Agentled workflows by importing and creating draft versions for review before activation.

Instructions

Create a new Agentled workflow from an n8n JSON import.

Behavior:

  • runs deterministic import preview

  • creates workflow in preflight draft mode

  • stores imported contract for review/approval

  • does NOT auto-apply scaffold

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
n8nJsonNon8n workflow JSON object or string export
workflowNoOptional metadata overrides for the created workflow
optionsNoOptional import options
localeNoLocale for workflow creation (default en)

Implementation Reference

  • The registration and MCP handler for the 'import_n8n_workflow' tool. It delegates to the client's importN8nWorkflow method.
        server.tool(
            'import_n8n_workflow',
            `Create a new Agentled workflow from an n8n JSON import.
    
    Behavior:
    - runs deterministic import preview
    - creates workflow in preflight draft mode
    - stores imported contract for review/approval
    - does NOT auto-apply scaffold`,
            {
                n8nJson: z.any().describe('n8n workflow JSON object or string export'),
                workflow: z.object({
                    name: z.string().optional(),
                    goal: z.string().optional(),
                    description: z.string().optional(),
                    pathname: z.string().optional(),
                }).optional().describe('Optional metadata overrides for the created workflow'),
                options: z.record(z.string(), z.any()).optional().describe('Optional import options'),
                locale: z.string().optional().describe('Locale for workflow creation (default en)'),
            },
            async ({ n8nJson, workflow, options, locale }, extra) => {
                const client = clientFactory(extra);
                const result = await client.importN8nWorkflow(n8nJson, workflow, options, locale);
                return {
                    content: [{
                        type: 'text' as const,
                        text: JSON.stringify(result, null, 2),
                    }],
                };
            }
        );
  • The underlying implementation that performs the actual network request to the Agentled API to import an n8n workflow.
    async importN8nWorkflow(
        n8nJson: string | Record<string, any>,
        workflow?: { name?: string; goal?: string; description?: string; pathname?: string },
        options?: Record<string, any>,
        locale?: string
    ) {
        return this.request('/workflows/import/n8n/create', {
            method: 'POST',
            body: JSON.stringify({ n8nJson, workflow, options, locale }),
        });
    }

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