n8n-nodes-nextlead
v0.1.6
Published
n8n nodes for NextLead CRM integration
Readme
n8n-nodes-nextlead
Community node for n8n that integrates NextLead CRM.
- npm: n8n-nodes-nextlead
- GitHub: CREACH-Agency/nextlead-n8n
Features
| Resource | Operations | |---|---| | Contact | Create, Update, Delete, Find, Add Note | | Structure | Create, Update, Delete, List | | Sale | Create, Update, Delete | | Action | Create, Update, Delete | | Group | Create, Update, Delete, List | | List | Create, Update, Delete | | Identify | Identify visitor | | Trigger | Poll for new/updated contacts and events |
Architecture
nodes/NextLead/
├── NextLead.node.ts # Main node — resource router
├── NextLeadTrigger.node.ts # Polling trigger node
├── core/
│ ├── BaseNextLeadNode.ts # Abstract base class shared by both nodes
│ ├── NextLeadApiService.ts # HTTP client wrapping the NextLead REST API
│ ├── NextLeadErrorHandler.ts
│ ├── ResourceManager.ts # Dispatches operations to the right resource
│ ├── interfaces/
│ │ └── IResourceStrategy.ts # Strategy interface for each resource
│ └── types/
│ ├── NextLeadTypes.ts # ResourceType / OperationType enums
│ ├── shared/ApiTypes.ts
│ └── api/ # Typed API response shapes
├── resources/
│ ├── ContactResource.ts # Implements IResourceStrategy for contacts
│ ├── StructureResource.ts
│ ├── SaleResource.ts
│ ├── ActionResource.ts
│ ├── GroupResource.ts
│ ├── ListResource.ts
│ ├── IdentifyResource.ts
│ └── <resource>/
│ └── <Resource>Fields.ts # n8n field definitions per resource
└── utils/
├── NodeExecuteUtils.ts
├── OperationHandlerUtils.ts
├── ResponseUtils.ts
└── FieldDefinitionUtils.ts
credentials/
└── NextLeadApi.credentials.ts # API key + domain credential
dist/ # Compiled output (git-ignored, generated by build)Key design decisions
- Strategy pattern: each resource (
ContactResource,SaleResource, …) implementsIResourceStrategy.ResourceManagerpicks the right one at runtime based on theresourceparameter. - BaseNextLeadNode: shared abstract class that wires credentials, error handling, and execution lifecycle for both the regular node and the trigger node.
- NextLeadApiService: thin wrapper around n8n's
helpers.requestWithAuthentication, so auth headers are injected automatically from the stored credential.
Local development
Prerequisites
- Node.js ≥ 20.15
- pnpm (
npm install -g pnpm) - A running n8n instance (local or Docker)
Install dependencies
pnpm installBuild
pnpm run buildCompiled files are output to dist/. The build runs tsc then copies SVG icons via Gulp.
Watch mode (rebuild on save)
pnpm run devLint
pnpm run lint # check
pnpm run lintfix # auto-fixFormat
pnpm run formatTest locally in n8n
Link the package into a local n8n install so changes are reflected immediately:
# In this repo
npm link
# In your n8n directory
npm link n8n-nodes-nextleadThen restart n8n. The NextLead nodes will appear in the node picker.
Publishing to npm
See PUBLICATION_GUIDE.md for the full step-by-step.
# 1. Bump version
npm version patch # 0.1.0 → 0.1.1 (bug fix)
npm version minor # 0.1.0 → 0.2.0 (new feature)
npm version major # 0.1.0 → 1.0.0 (breaking change)
# 2. Build and lint
pnpm run build
pnpm run lint
# 3. Preview what will be published
npm pack --dry-run
# 4. Publish
npm publish --access publicThe prepublishOnly script runs build + lint automatically before each publish.
Only the dist/ folder is shipped (configured via "files" in package.json).
n8n community node requirements
- Package name must start with
n8n-nodes- keywordsmust include"n8n-community-node-package"- License must be MIT
- No heavy external dependencies
After publishing, submit the node to the n8n community by opening an issue on github.com/n8n-io/n8n or posting on community.n8n.io.
Setup for end users
- In n8n, go to Settings > Community Nodes and install
n8n-nodes-nextlead. - Create a NextLead API credential:
- API Key: found in NextLead under Settings > Automation > API Key
- Domain: your NextLead instance URL
- Add a NextLead node to your workflow and select a resource + operation.
Resources
License
MIT — see LICENSE.md
