# microboxlabs/n8n-nodes-pulsar architecture

> Architecture diagram of the GitHub repository microboxlabs/n8n-nodes-pulsar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microboxlabs/n8n-nodes-pulsar
- Repository: https://github.com/microboxlabs/n8n-nodes-pulsar

## Overview

#### 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: [`nodes/Pulsar/PulsarPublish.node.ts`](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarPublish.node.ts) (Pulsar publish), [`nodes/Pulsar/PulsarTrigger.node.ts`](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarTrigger.node.ts) (Pulsar trigger), [`index.js`](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/index.js) (Package registration), [`gulpfile.js`](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/gulpfile.js) (Build automation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_package["Community Node Package"]
  node_npm["npm community package<br/>distribution<br/>[package.json]"]
  node_entry["Package registration<br/>JavaScript entry<br/>[index.js]"]
  node_n8n{{"n8n runtime<br/>host runtime"}}
  node_credentials["Pulsar credentials<br/>n8n credential"]
end

subgraph group_nodes["n8n Node Surface"]
  node_trigger_meta["Trigger metadata<br/>node manifest"]
  node_trigger["Pulsar trigger<br/>n8n trigger"]
  node_publish_meta["Publish metadata<br/>node manifest"]
  node_publish["Pulsar publish<br/>n8n action"]
end

subgraph group_delivery["Build &amp; Delivery"]
  node_build["Build automation<br/>Gulp build<br/>[gulpfile.js]"]
  node_typescript["TypeScript settings<br/>compiler config<br/>[tsconfig.json]"]
  node_ci["CI pipeline<br/>GitHub Actions<br/>[ci.yaml]"]
end

node_pulsar["Apache Pulsar cluster<br/>external broker"]

node_npm -->|"declares entry"| node_entry
node_entry -->|"registers"| node_trigger
node_entry -->|"registers"| node_publish
node_n8n -->|"loads package"| node_entry
node_trigger_meta -.->|"describes"| node_trigger
node_publish_meta -.->|"describes"| node_publish
node_n8n -->|"activates workflow"| node_trigger
node_n8n -->|"passes input items"| node_publish
node_credentials -->|"supplies connection settings"| node_trigger
node_credentials -->|"supplies connection settings"| node_publish
node_pulsar -->|"delivers subscribed messages"| node_trigger
node_publish -->|"produces messages"| node_pulsar
node_typescript -.->|"configures compilation"| node_build
node_build -->|"packages distributable"| node_npm
node_ci -->|"runs build"| node_build

click node_npm "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/package.json"
click node_entry "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/index.js"
click node_trigger_meta "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarTrigger.node.json"
click node_trigger "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarTrigger.node.ts"
click node_publish_meta "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarPublish.node.json"
click node_publish "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarPublish.node.ts"
click node_credentials "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/credentials/PulsarApi.credentials.ts"
click node_build "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/gulpfile.js"
click node_typescript "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/tsconfig.json"
click node_ci "https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/.github/workflows/ci.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_npm,node_entry,node_n8n,node_credentials toneBlue
class node_trigger_meta,node_trigger,node_publish_meta,node_publish toneAmber
class node_build,node_typescript,node_ci toneMint
class node_pulsar toneNeutral
```

## Components

### Community Node Package

- [npm community package](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/package.json): distribution · Installable extension boundary. · `package.json`
- [Package registration](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/index.js): JavaScript entry · `index.js`
- **n8n runtime**: host runtime · Loads nodes and executes workflows.
- [Pulsar credentials](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/credentials/PulsarApi.credentials.ts): n8n credential · Resolves service URL and none, token, or OAuth2 authentication. · `credentials/PulsarApi.credentials.ts`

### n8n Node Surface

- [Trigger metadata](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarTrigger.node.json): node manifest · Discovery contract for the consumer trigger. · `nodes/Pulsar/PulsarTrigger.node.json`
- [Pulsar trigger](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarTrigger.node.ts): n8n trigger · Subscribes and turns Pulsar messages into workflow items. · `nodes/Pulsar/PulsarTrigger.node.ts`
- [Publish metadata](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarPublish.node.json): node manifest · Discovery contract for the publishing action. · `nodes/Pulsar/PulsarPublish.node.json`
- [Pulsar publish](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/nodes/Pulsar/PulsarPublish.node.ts): n8n action · Maps incoming workflow items to producer operations. · `nodes/Pulsar/PulsarPublish.node.ts`

### Build & Delivery

- [Build automation](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/gulpfile.js): Gulp build · `gulpfile.js`
- [TypeScript settings](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/tsconfig.json): compiler config · `tsconfig.json`
- [CI pipeline](https://github.com/microboxlabs/n8n-nodes-pulsar/blob/trunk/.github/workflows/ci.yaml): GitHub Actions · `.github/workflows/ci.yaml`

### Other components

- **Apache Pulsar cluster**: external broker · External Pulsar 2.10+ service.

## Connections

- 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
