neitn>_
neitn is an AI-native CLI for modular n8n workflows.
Instead of editing one large exported n8n JSON file, neitn works with a project DSL:
flow.yamlnodes/*.yamledges/*.yamlcode/*.tscode/*.runtime.tscode/__tests__/*.test.ts
This keeps AI tasks smaller, diffs cleaner, and Code nodes testable.
Raw n8n workflow JSON is expensive for AI to edit well:
- too much context
- too easy to rewrite unrelated parts
- hard to patch safely
- hard to test Code nodes
neitn solves that by splitting workflow structure and code into small files, then compiling back to standard n8n workflow JSON.
npm install -g @neitn/cliThis installs the neitn CLI and an npm package that contains the bundled AI contract files.
To install the AI contract into a workflow project, use:
neitn agents:install . --ai codexInside a source checkout, the bundled source files live at:
.agents/skills/neitn/docs/neitn/
In a global npm install, they are shipped inside the installed package directory.
There is no separate neitn skills install step today.
npm install
npm run build
npm run link:globalneitn help
neitn --version
neitn init my-flow
neitn init my-flow --ai codex
neitn agents:install . --ai codex
neitn validate .
neitn apply .workflow/patches/some.patch.json
neitn doctor .
neitn migrate .
neitn build .
neitn compile .
neitn import workflow.json
neitn code:scaffold assemble_final_response --node
neitn code:test .
neitn code:build .neitn already supports:
- project bootstrap with
neitn init - AI contract install with
neitn agents:install - import from existing n8n workflow JSON
- modular DSL editing through files
applyandmigratefor patch packages- validate / doctor / compile / build
- Code node scaffold and split runtime/pure/test files
What neitn does not do by itself:
- it does not generate patches on its own
- it does not include an autonomous AI agent runtime
- it does not yet turn a free-form natural-language request into a patch by itself
Patch generation is expected to come from:
- an external AI agent using the bundled skill contract
- not from humans manually writing patch JSON as the normal workflow
neitn import workflow.jsonThis creates a modular project:
flow.yaml
nodes/
edges/
code/
dist/neitn init my-flow --ai codex
cd my-flow
neitn code:scaffold normalize_input --node
neitn validate .
neitn build .That gives you:
flow.yamlnodes/normalize_input.yamlcode/normalize_input.tscode/normalize_input.runtime.tscode/__tests__/normalize_input.test.ts
You then add or edit:
- more
nodes/*.yaml edges/*.yaml- pure code in
code/*.ts - runtime wrappers only when n8n I/O needs to change
At this stage, creating a new workflow is a file-first flow. neitn gives you the project structure, scaffolded Code nodes, validation, import, build, apply, and migrate. It does not yet include a built-in prompt-to-patch generator.
If you already have a project and want to prepare it for an AI agent later:
cd my-flow
neitn agents:install . --ai codexneitn validate .
neitn doctor .
neitn build .neitn compile .Output:
dist/<flow.id>.workflow.jsonNew Code nodes can be scaffolded:
neitn code:scaffold assemble_final_response --nodeThis generates:
code/assemble_final_response.ts
code/assemble_final_response.runtime.ts
code/__tests__/assemble_final_response.test.ts
nodes/assemble_final_response.yamlThe intended split is:
*.ts: pure business logic*.runtime.ts: thin n8n runtime wrapper__tests__/*.test.ts: unit tests for pure logic
Build injects the compiled runtime wrapper into final n8n JSON as parameters.jsCode.
Today there are two practical ways to create workflow pieces.
Use the CLI and edit the DSL directly:
neitn init my-flow
cd my-flow
neitn code:scaffold assemble_final_response --nodeThen:
- edit
nodes/*.yaml - edit
edges/*.yaml - edit
code/*.ts - run
neitn build .
This path is fully ready now.
If an external AI agent uses the bundled skill contract, it can emit patch JSON targeting the DSL.
Primary mode for a file-writing agent:
- create a new patch file in
.workflow/patches/ - choose a timestamped descriptive filename automatically
- write only valid Patch Schema v0 JSON into that file
Fallback mode for a text-only agent:
- return only the patch JSON content so it can be saved into
.workflow/patches/
Then you apply it with:
neitn apply .workflow/patches/your.patch.jsonor migrate a folder of patches with:
neitn migrate .This means:
- AI creates the patch
neitnapplies and validates itneitn build .compiles the final workflow JSON
So yes: patch-based AI editing is part of the model, but the current CLI does not itself generate those patches.
Humans normally should not hand-author patch JSON. For humans, the primary interface is the DSL files themselves.
If you keep patch files in .workflow/patches/, neitn can apply them as an ordered migration stream:
neitn migrate .
neitn validate .
neitn build .This is ready now for applying existing patch files. What is not built into neitn yet is automatic patch authoring from natural language.
neitn is built so an AI agent can make smaller, higher-quality changes.
Source of truth:
flow.yamlnodes/*.yamledges/*.yamlcode/*
Generated artifact:
dist/*.workflow.json
The intended editing pattern is:
- read only affected DSL files
- change the smallest possible set of files
- run
neitn validate . - run
neitn build .
The npm package contains the AI skills bundle.
In a repo checkout, the main entrypoint is:
.agents/skills/neitn/These files are intended for AI-assisted workflow editing, not for runtime execution.
They describe:
- DSL conventions
- patch/editing rules
- import/build behavior
- code node structure
- roadmap/spec decisions
If you install neitn from npm, the skills ship inside the package so another agent can reuse the same editing contract with lower token cost.
There is no separate extra install step for skills inside the npm package. The main practical options today are:
- use
neitn init <name> --ai codex - or run
neitn agents:install . --ai codexinside an existing project - or use the repo checkout directly
The main skill entrypoint is:
.agents/skills/neitn/SKILL.mdThe broader spec bundle lives under:
docs/neitn/This keeps the installable skill entrypoint small while preserving the full AI contract and roadmap docs.
In practice:
- the skill tells an AI agent how to work against the DSL
- the docs bundle gives the deeper contracts and roadmap context
- the CLI executes validate/apply/build/compile steps
For distribution, treat neitn as two layers:
- CLI
- compiler
- validator
- import/build pipeline
- bundled skills
- workflow editing conventions
- specs and contract docs
That combination is what makes the system useful for AI-native workflow development.
Included today:
- modular workflow DSL
- import from existing n8n workflow JSON
- validate / doctor / compile / build
- Code node scaffold
- Code node split runtime/pure/test files
- workflow round-trip fidelity improvements
Not the goal of v0:
- perfect automatic refactoring of arbitrary imported
jsCode - full n8n runtime simulation
- secret extraction or credential provisioning
neitn import workflow.json
neitn build .After that:
- edit
nodes/*.yaml - edit
code/*.ts - run tests with
neitn code:test . - rebuild with
neitn build .
If you have an external agent that understands the bundled skill:
- it reads
.agents/skills/neitn/SKILL.md - it edits DSL files directly or emits a patch package
- you run:
neitn apply .workflow/patches/2026-04-24-some-change.patch.json
neitn validate .
neitn build .If you keep patches as a migration stream:
neitn migrate .
neitn validate .
neitn build .That workflow is supported now.
The intended user-facing prompt can stay short:
Use the neitn skill for this project.
Add:
- a webhook node `lead_webhook`
- an HTTP Request node `send_lead`
- a connection from `lead_webhook` to `send_lead`
- set `flow.entry` to `lead_webhook`
Patch file location, filename convention, and patch shape are skill-level defaults.
One practical flow today looks like this:
- create the project:
neitn init my-flow --ai codex
cd my-flow
neitn code:scaffold normalize_input --node- let an external AI agent read:
.agents/skills/neitn/SKILL.md
docs/neitn/- the agent either:
- edits
flow.yaml,nodes/*.yaml,edges/*.yaml,code/*.tsdirectly - or writes a patch file into
.workflow/patches/
- then you run:
neitn validate .
neitn code:test .
neitn build .- if you are using patch files as history:
neitn migrate .
neitn build .This means the current model is already usable for small AI tasks, but patch generation itself still belongs to the external agent layer, not to the CLI.
- DSL internal edges use node ids
- final n8n JSON connections use node names
dist/*.workflow.jsonis generated output, not the editable source format
