SkillsApr 5, 2026·3 min read

n8n-as-code — AI Agent Superpowers for n8n

Give your AI agent n8n superpowers with 537 node schemas, 7,700+ templates, and TypeScript workflow definitions. Works with Claude Code, Cursor, VS Code, and OpenClaw. MIT license.

TL;DR
n8n-as-code gives AI agents access to 537 n8n node schemas and 7,700+ templates for building automation workflows.
§01

What it is

n8n-as-code is a plugin that gives AI coding agents access to n8n's entire workflow automation ecosystem. It provides 537 node schemas (one for each n8n integration), 7,700+ workflow templates, and TypeScript definitions for building n8n workflows programmatically. The plugin works with Claude Code, Cursor, VS Code, and other AI coding tools.

n8n-as-code is designed for developers who use n8n for automation and want their AI agent to build, modify, and debug n8n workflows without switching to the n8n GUI.

§02

How it saves time or tokens

Building n8n workflows in the GUI requires clicking through nodes, configuring fields, and connecting triggers manually. n8n-as-code lets your AI agent generate complete workflow definitions in TypeScript or JSON from natural language descriptions. The agent has access to all 537 node schemas, so it knows the exact fields, options, and connections each node supports. A workflow that takes 30 minutes to build in the GUI can be generated in seconds.

§03

How to use

  1. Install for Claude Code:
/plugin marketplace add EtienneLescot/n8n-as-code
/plugin install n8n-as-code@n8nac-marketplace
  1. For VS Code or Cursor, install 'n8n-as-code' from the VS Code Marketplace.
  1. Ask your AI agent to build a workflow:
Create an n8n workflow that:
1. Triggers on a webhook POST to /new-lead
2. Sends a Slack notification to #sales
3. Creates a HubSpot contact
4. Sends a welcome email via SendGrid
§04

Example

A generated n8n workflow definition:

import { IWorkflowDefinition } from 'n8n-as-code';

const workflow: IWorkflowDefinition = {
  name: 'New Lead Pipeline',
  nodes: [
    {
      type: 'n8n-nodes-base.webhook',
      parameters: { path: 'new-lead', httpMethod: 'POST' },
      position: [250, 300],
    },
    {
      type: 'n8n-nodes-base.slack',
      parameters: {
        channel: '#sales',
        text: 'New lead: {{$json.name}} ({{$json.email}})',
      },
      position: [450, 200],
    },
    {
      type: 'n8n-nodes-base.hubspot',
      parameters: {
        operation: 'create',
        email: '={{$json.email}}',
        firstName: '={{$json.name}}',
      },
      position: [450, 400],
    },
  ],
  connections: { /* ... */ },
};
§05

Related on TokRepo

§06

Common pitfalls

  • Not having n8n credentials configured for the nodes you use. The generated workflow definition is correct, but it needs credentials set up in your n8n instance for each service (Slack, HubSpot, etc.).
  • Generating workflows without testing them. Always import the generated workflow into n8n and test with sample data before connecting to production services.
  • Using outdated node schemas. Update the n8n-as-code plugin regularly to get the latest node definitions that match your n8n version.

Frequently Asked Questions

Does n8n-as-code require a running n8n instance?+

For generating workflow definitions, no. The plugin provides schemas locally. For deploying and running workflows, you need an n8n instance. Import the generated workflow via n8n's API or GUI.

How many n8n integrations are covered?+

n8n-as-code includes schemas for all 537 n8n node types, covering integrations with services like Slack, GitHub, Google Sheets, HubSpot, Stripe, and hundreds more.

Can I modify existing workflows with n8n-as-code?+

Yes. Export your existing workflow from n8n as JSON, have your AI agent read and modify it, then import the updated workflow back into n8n.

Does n8n-as-code work with self-hosted n8n?+

Yes. The generated workflow definitions are compatible with any n8n instance, whether self-hosted or using n8n Cloud. The plugin generates standard n8n workflow JSON.

Which AI coding tools does n8n-as-code support?+

n8n-as-code works with Claude Code (via plugin marketplace), Cursor and VS Code (via VS Code Marketplace), and any AI coding tool that can read TypeScript type definitions.

Citations (3)
🙏

Source & Thanks

Created by Etienne Lescot. Licensed under MIT.

n8n-as-code — ⭐ 630+

Thank you to Etienne Lescot for building the definitive bridge between AI agents and n8n automation.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets