Create Dynamic Workflows Programmatically via Webhooks & n8n API
Overview This workflow exposes an HTTP endpoint (webhook) that accepts a JSON definition of an n8n workflow, validates it, and—if everything is correct—dynamically creates that workflow in the n8n instance via its int...
Template notes
Overview
This workflow exposes an HTTP endpoint (webhook) that accepts a JSON definition of an n8n workflow, validates it, and—if everything is correct—dynamically creates that workflow in the n8n instance via its internal API. If any validation fails or the API call encounters an error, an explanatory message with details is returned.
Workflow Diagram
text Webhook │ ▼ Validate JSON ── fails validation ──► Validation Error │ └─ passes ─► Validation Successful? │ ├─ true ─► Create Workflow ──► API Successful? ──► Success Response │ │ │ └─ false ─► API Error └─ false ─► Validation Error
Step-by-Step Details
1. Webhook
Type: Webhook (POST) Path: /webhook/create-workflow Purpose: Expose a URL to receive a JSON definition of a workflow. Expected Input: JSON containing the main workflow fields (name, nodes, connections, settings).
2. Validate JSON