n8n-workflow-sdk

Builds, validates, and converts n8n workflows programmatically using the @n8n/workflow-sdk TypeScript library.

14|2|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/geckse/n8n-dev-skills --skill n8n-workflow-sdk-geckse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-workflow-sdk
Source: https://github.com/geckse/n8n-dev-skills/tree/main/plugins/n8n-workflow-sdk/skills/n8n-workflow-sdk
Command: npx skills add https://github.com/geckse/n8n-dev-skills --skill n8n-workflow-sdk-geckse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @n8n/workflow-sdk, typescript, tsx, @types/node, and includes scripts (resource) and references (resource) components.

What problem does it solve? Writing n8n workflow JSON by hand is verbose and error-prone, and AI models often invent node types or versions that break at runtime. This Skill provides the official @n8n/workflow-sdk knowledge plus cached node registries so workflows are built with real node types, correct versions, and validated structure. ## Core Features & Use Cases - Programmatic Workflow Construction: Create workflows with a fluent TypeScript API using workflow(), node(), trigger(), and control-flow builders for IF/Else, Switch, Merge, and Split in Batches. - JSON Round-Tripping: Convert existing n8n workflow JSON to readable code with generateWorkflowCode(), modify it, and parse it back with parseWorkflowCode() without data loss. - Validation and Testing: Catch 23+ error conditions with validateWorkflow() and generate pin/test data from output declarations before deploying to n8n. - AI Agent Workflows: Build LangChain-based agents with languageModel(), tool(), memory(), and fromAi() subnode factories. - Use Case: A user asks for a workflow that receives a webhook, posts to Slack, and logs to Google Sheets. The Skill looks up the exact node types and versions from the cached registry, builds the workflow in code, validates it, and exports n8n-ready JSON. ## Quick Start Ask the agent to create an n8n workflow with the SDK, for example: build a workflow with a webhook trigger that fetches data from an API and transforms it with a Set node, then validate it and export the JSON.

Frequently Asked Questions about n8n-workflow-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an n8n workflow programmatically with TypeScript?

Install @n8n/workflow-sdk and use the fluent builder API: create nodes with node() and trigger(), chain them with .add() and .to(), then export with .toJSON(). Always call validateWorkflow() before exporting to catch structural errors.

How to convert n8n workflow JSON to code and back?

Use generateWorkflowCode(json) to turn workflow JSON into readable TypeScript SDK code, and parseWorkflowCode(code) to convert code back to JSON. Use parseWorkflowCodeToBuilder() instead when you want to validate before exporting.

How do I find the correct n8n node type and version?

Never guess node types. Search the cached references/node-registry-official.json for official nodes or node-registry-community.json for community nodes, then grep node-registry-properties.jsonl for parameter definitions. Run scripts/refresh-node-registry.sh if the cache is stale.

Can I build AI agent workflows with the n8n workflow SDK?

Yes. Use languageModel(), tool(), memory(), and other subnode factories, attach them via the agent node's subnodes config, and use fromAi() for AI-driven tool parameters. Note that fromAi() only works inside tool nodes.

Why does my generated n8n workflow fail validation?

Common causes include missing triggers, disconnected nodes, hardcoded credentials, fromAi() used outside tool nodes, or wrong node versions. validateWorkflow() returns error codes like MISSING_TRIGGER and DISCONNECTED_NODE with messages explaining each fix.

What are the limitations of the n8n workflow SDK skill?

It only covers building and manipulating workflows as code. It does not deploy workflows to n8n instances, manage server configuration or credentials, build custom community nodes, or interact with the n8n UI or REST API.