openapi-notes

n8n community nodes generated from an OpenAPI spec, demonstrated with a Notes API

Documentation

n8n-nodes-openapi-notes

An n8n community node package that generates one n8n node per OpenAPI path from a spec file, plus a hand-written example node.

n8n is a fair-code licensed workflow automation platform.

How the generator works

openapi.yaml  ──►  npm run generate  ──►  nodes/generated/<Class>/<Class>.node.ts  ──►  tsc  ──►  dist/
                          │                                                                        │
                          └── also rewrites package.json "n8n.nodes"  ────────────────────────────►┘
                                                                                    n8n loads these

tools/generate-nodes.mts reads openapi.yaml and, for every entry under paths:, writes a self-contained n8n node. The node properties are produced by
@devlikeapro/n8n-openapi-node.

The important design decision: build time, not runtime

The library runs at build time only, and its output is serialised into the generated TypeScript. The published nodes therefore import nothing but n8n-workflow types, and this package ships with zero runtime dependencies — which n8n's
verification guidelines require.

Calling the library inside the node instead (the more common pattern) would make it a production dependency and drag pino, pino-pretty and lodash into the published package.

Why the generator files use .mts

n8n-node lint applies n8n Cloud runtime rules (no fs/path imports, no process, no console) to every *.ts file in the package, and "strict": true prevents adding eslint ignores. A build script legitimately needs those APIs. Naming the generator .mts keeps it TypeScript and outside the linter's **/*.ts glob, so the package keeps strict mode and Cloud-verification eligibility.

Lint conformance is the generator's job

n8n-node release runs the linter, so generated output must be clean. Rather than auto-fixing generated files (which the next npm run generate would overwrite), tools/build-description.mts sanitises the library's raw output: acronym casing (Notebook Id → Notebook ID), title-cased option names, displayName first, Whether-prefixed boolean descriptions, colour fields, and dropping the library's duplicate notice property.

Everyday workflow

# 1. edit the spec
vim openapi.yaml

# 2. regenerate nodes + package.json manifest
npm run generate

# 3. check and build  (build runs generate automatically)
npm run lint
npm run build

# 4. try it in a real n8n
npm run dev          # http://localhost:5678

# 5. commit the generated sources too — CI only compiles
git add openapi.yaml nodes/generated package.json

Use a different spec without editing the default:

npm run generate -- path/to/other.yaml
OPENAPI_FILE=./other.yaml npm run generate

Layout

Path Purpose
openapi.yaml Source of truth. Editing this is the only step needed to change the generated nodes.
tools/generate-nodes.mts Generator entry point: reads the spec, writes nodes, rewrites the manifest.
tools/build-description.mts Maps one OpenAPI path to a full node description; all sanitising lives here.
tools/parsers.mts Stable camelCase operation values, so renaming a spec summary doesn't break saved workflows.
nodes/generated/ Generated — do not edit. Wiped and rewritten on every npm run generate.
nodes/Example/ Hand-written node, kept as a reference. The generator preserves it in the manifest.
credentials/NotesApi.credentials.ts Hand-written. The library does not read securitySchemes.

Nodes

One node per path in openapi.yaml, each with an Operation dropdown built from that path's HTTP methods:

  • Notes /notes — List notes, Create a note
  • Notes /notes/{id} — Get, Update, Delete a note
  • Notebooks /notebooks — List notebooks, Create a notebook
  • Notebooks /notebooks/{id} — Get, Update, Delete a notebook

Plus the hand-written Example node.

Credentials

Notes API — a bearer token plus a base URL. The base URL lives in the credential so that one credential points every generated node at the same server; switching environments is a credential swap rather than an edit to every node.

The generator never touches credentials/: @devlikeapro/n8n-openapi-node does not read securitySchemes, so credentials are written by hand.

Known limitations

Inherited from @devlikeapro/n8n-openapi-node:

  • Request bodies flatten to one level. Nested objects become json fields holding a JSON string.
  • Only application/json request bodies are mapped.
  • Every operation must have tags: — the library crashes otherwise. The generator checks first and fails with a clear message.
  • Deprecated operations are skipped by default. Override shouldSkip in tools/parsers.mts to include them.
  • OpenAPI v3 only.

Installation

Follow the installation guide in the n8n community nodes documentation, or install from the n8n UI under Settings → Community nodes.

Resources

Discussion