Official CLI to create new community nodes for n8n
npm install @atom8n/create-nodeA powerful scaffolding tool to quickly create custom n8n community nodes with best practices built-in.
Create a new n8n node in seconds:
``bash`
npm create @n8n/node@latest # or pnpm/yarn/...
Follow the interactive prompts to configure your node, or specify options directly:
`bash`
npm create @n8n/node my-awesome-node --template declarative/custom
`bash`
npm create @n8n/node [NAME] [OPTIONS]
| Flag | Description |
|------|-------------|
| -f, --force | Overwrite destination folder if it already exists |--skip-install
| | Skip automatic dependency installation |--template
| | Specify which template to use |
- declarative/custom - Start with a minimal declarative node structure
- declarative/github-issues - GitHub Issues integration example
- programmatic/example - Full programmatic node with advanced features
The CLI will guide you through setting up your node:
``
$ npm create @n8n/node
ā @n8n/create-node
ā
ā What is your node called?
ā my-awesome-api-node
ā
ā What kind of node are you building?
ā HTTP API
ā
ā What template do you want to use?
ā Start from scratch
ā
ā What's the base URL of the API?
ā https://api.example.com/v1
ā
ā What type of authentication does your API use?
ā API Key
ā
ā Files copied ā
ā
ā Dependencies installed ā
ā
ā Next Steps āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā®
ā ā
ā cd ./my-awesome-api-node && npm run dev ā
ā ā
ā š Documentation: https://docs.n8n.io/integrations/creating-nodes/ ā
ā š¬ Community: https://community.n8n.io ā
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāÆ
ā
ā Created ./my-awesome-api-node āØ
`bash`
cd ./my-awesome-api-node
`bash`
npm run dev
This command:
- Starts n8n in development mode on http://localhost:5678~/.n8n-node-cli/.n8n/custom
- Enables hot reload for your node changes
- Automatically includes your node in the n8n instance
- Links your node to for development
- Watches for file changes and rebuilds automatically
- Open n8n at http://localhost:5678
- Create a new workflow
- Find your node in the node panel
- Test parameters and functionality in real-time
Your generated project comes with these convenient npm scripts:
bash
npm run dev
Runs: n8n-node dev
`$3
`bash
npm run build
Runs: n8n-node build
`$3
`bash
npm run lint
Runs: n8n-node lint
npm run lint:fix
Runs: n8n-node lint --fix
`$3
`bash
npm run release
Runs: n8n-node release
`š¦ Build & Deploy
$3
`bash
npm run build
`Generates:
- Compiled TypeScript code
- Bundled node package
- Optimized assets and icons
- Ready-to-publish package
$3
`bash
npm run lint
`Validates:
- Code style and formatting
- n8n node conventions
- Common integration issues
- Cloud publication readiness
$3
`bash
npx n8n-node cloud-support
`Manage n8n Cloud publication eligibility. In strict mode, your node must use the default ESLint config and pass all community node rules to be eligible for n8n Cloud publication.
Fix issues automatically:
`bash
npm run lint:fix
`$3
`bash
npm run release
`Runs release-it to handle the complete release process:
- Ensures working directory is clean
- Verifies you're on the main git branch
- Increments your package version
- Runs build and lint checks
- Updates changelog
- Creates git tag with version bump
- Creates GitHub release with changelog
- Publishes to npm
š Project Structure
Your generated project includes:
`
my-awesome-api-node/
āāā src/
ā āāā nodes/
ā ā āāā MyAwesomeApi/
ā ā āāā MyAwesomeApi.node.ts # Main node logic
ā ā āāā MyAwesomeApi.node.json # Node metadata
ā āāā credentials/
ā āāā MyAwesomeApiAuth.credentials.ts
āāā package.json
āāā tsconfig.json
āāā README.md
`The CLI expects your project to follow this structure for proper building and development.
āļø Configuration
The CLI reads configuration from your
package.json:`json
{
"name": "n8n-nodes-my-awesome-node",
"n8n": {
"n8nNodesApiVersion": 1,
"nodes": [
"dist/nodes/MyAwesomeApi/MyAwesomeApi.node.js"
],
"credentials": [
"dist/credentials/MyAwesomeApiAuth.credentials.js"
]
}
}
`šØ Node Types
Choose the right template for your use case:
| Template | Best For | Features |
|----------|----------|----------|
| Declarative | REST APIs, simple integrations | JSON-based configuration, automatic UI generation |
| Programmatic | Complex logic, custom operations | Full TypeScript control, advanced error handling |
š Troubleshooting
$3
Node not appearing in n8n:
`bash
Clear n8n node cli cache and restart
rm -rf ~/.n8n-node-cli/.n8n/custom
npm run dev
`TypeScript errors:
`bash
Reinstall dependencies
rm -rf node_modules npm-lock.yaml
npm install
`Build failures:
`bash
Check for linting issues first
npm run lint --fix
npm run build
`Development server issues:
`bash
Clear cache and restart development server
rm -rf ~/.n8n-node-cli/.n8n/custom
npm run dev
`š§ Advanced Usage
$3
If you prefer to use your own n8n installation:
`bash
npm run dev --external-n8n
`$3
Specify a custom location for n8n user data:
`bash
npm run dev --custom-user-folder /path/to/custom/folder
``- Node Development Guide - Complete documentation
- API Reference - Technical specifications
- Community Forum - Get help and share your nodes
- Node Examples - Official node implementations
- @n8n/node-cli - The underlying CLI tool
Found a bug or want to contribute? Check out the n8n repository and join our community!
---
Happy node building! š