n8n_import_workflow
Import n8n workflows from JSON data to automate processes. Add workflows to your n8n instance by providing complete JSON definitions.
Instructions
Import a workflow from JSON.
Args:
workflowJson (object): Complete workflow JSON object with:
name (string): Workflow name
nodes (array): Workflow nodes
connections (object): Node connections
settings (object, optional): Workflow settings
Returns: The imported workflow with its new ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowJson | Yes | Complete workflow JSON object to import |
Implementation Reference
- src/tools/audit-utils.ts:224-258 (handler)The 'n8n_import_workflow' tool is registered and implemented in src/tools/audit-utils.ts. It takes a workflow JSON object as input and makes a POST request to the n8n API to import the workflow.
server.registerTool( 'n8n_import_workflow', { title: 'Import Workflow JSON', description: `Import a workflow from JSON. Args: - workflowJson (object): Complete workflow JSON object with: - name (string): Workflow name - nodes (array): Workflow nodes - connections (object): Node connections - settings (object, optional): Workflow settings Returns: The imported workflow with its new ID.`, inputSchema: z.object({ workflowJson: z.record(z.unknown()) .describe('Complete workflow JSON object to import') }).strict(), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } }, async (params: { workflowJson: Record<string, unknown> }) => { const workflow = await post<Record<string, unknown>>('/workflows', params.workflowJson); return { content: [{ type: 'text', text: `✅ Workflow imported!\n\n- ID: ${workflow.id}\n- Name: ${workflow.name}` }], structuredContent: workflow }; } );