How microboxlabs/n8n-nodes-pulsar works
Purpose and Entry Points
This package is an n8n community-node extension for connecting workflows to Apache Pulsar. It exposes a trigger for consuming topic messages and a publish node for producing messages. Package registration begins at index.js; node implementations reside under nodes/Pulsar/.
n8n Node Surface
The two workflow-facing components are:
• Pulsar consumer/trigger: nodes/Pulsar/PulsarTrigger.node.ts, with its n8n metadata in nodes/Pulsar/PulsarTrigger.node.json.
• Pulsar publisher/action node: nodes/Pulsar/PulsarPublish.node.ts, with metadata in nodes/Pulsar/PulsarPublish.node.json.
The JSON definitions provide node packaging/discovery metadata, while TypeScript files implement n8n lifecycle and execution behavior.
Trigger Consumption Flow
A deployed n8n workflow activates the Pulsar trigger, which establishes a client connection, subscribes to the configured Pulsar topic, and converts arriving messages into workflow input items. The trigger is the boundary between Pulsar’s asynchronous subscription model and n8n’s event-driven workflow execution. Its implementation is centered in nodes/Pulsar/PulsarTrigger.node.ts.
Publishing Flow
The publish node is the synchronous workflow-action boundary: it receives items from prior n8n nodes, maps configured message/topic inputs into Pulsar producer operations, and returns execution results to the workflow. Publishing behavior is implemented in nodes/Pulsar/PulsarPublish.node.ts; its discoverable node contract is nodes/Pulsar/PulsarPublish.node.json.
Credentials and Authentication Boundary
Pulsar connection settings are modeled as an n8n credential type in credentials/PulsarApi.credentials.ts. The credential boundary supplies the Pulsar service URL and selects supported authentication modes: none, token-based authentication, or OAuth2. Node code should consume resolved credentials rather than embed connection secrets in workflow parameters.
Runtime and External Infrastructure
The extension runs inside the Node.js-based n8n runtime and communicates with an external Apache Pulsar cluster, expected to be Pulsar 2.10+ and addressed through a Pulsar service URL. Source is TypeScript (tsconfig.json) with a JavaScript package entry point (index.js). Build/package automation is defined by gulpfile.js, and the distributable dependency contract is declared in package.json.
Delivery Boundary
The repository is distributed as an npm-installable n8n community node. CI is defined in .github/workflows/ci.yaml; repository-level package and compile settings are in package.json and tsconfig.json. The functional package boundary is intentionally narrow: n8n node registration, credential resolution, and Pulsar producer/consumer integration.
Main entry points: PulsarPublish.node.ts Pulsar publish · PulsarTrigger.node.ts Pulsar trigger · index.js Package registration · gulpfile.js Build automation
Components 12
Community Node Package
- npm community package · Installable extension boundary.
package.json - Package registration
index.js - n8n runtime · Loads nodes and executes workflows.
- Pulsar credentials · Resolves service URL and none, token, or OAuth2 authentication.
credentials/PulsarApi.credentials.ts
n8n Node Surface
- Trigger metadata · Discovery contract for the consumer trigger.
nodes/Pulsar/PulsarTrigger.node.json - Pulsar trigger · Subscribes and turns Pulsar messages into workflow items.
nodes/Pulsar/PulsarTrigger.node.ts - Publish metadata · Discovery contract for the publishing action.
nodes/Pulsar/PulsarPublish.node.json - Pulsar publish · Maps incoming workflow items to producer operations.
nodes/Pulsar/PulsarPublish.node.ts
Build & Delivery
- Build automation
gulpfile.js - TypeScript settings
tsconfig.json - CI pipeline
.github/workflows/ci.yaml
Other components
- Apache Pulsar cluster · External Pulsar 2.10+ service.
Connections 15
- npm community package → Package registration: declares entry
- Package registration → Pulsar trigger: registers
- Package registration → Pulsar publish: registers
- n8n runtime → Package registration: loads package
- Trigger metadata → Pulsar trigger: describes
- Publish metadata → Pulsar publish: describes
- n8n runtime → Pulsar trigger: activates workflow
- n8n runtime → Pulsar publish: passes input items
- Pulsar credentials → Pulsar trigger: supplies connection settings
- Pulsar credentials → Pulsar publish: supplies connection settings
- Apache Pulsar cluster → Pulsar trigger: delivers subscribed messages
- Pulsar publish → Apache Pulsar cluster: produces messages
- TypeScript settings → Build automation: configures compilation
- Build automation → npm community package: packages distributable
- CI pipeline → Build automation: runs build