Skip to content

New Generator: n8n community node client #25802

Open

Description

@Riventh

Description

I've implemented a new generator, n8n, which produces an n8n community node package (TypeScript) from an OpenAPI spec, instead of a traditional client SDK. Opening this issue per the contribution guidelines before submitting the PR, to gather feedback on the idea.

What it generates

Given an OpenAPI spec, the generator produces a ready-to-build n8n community node package:

  • One n8n node class grouping the spec's operations into Resource (per OpenAPI tag) / Operation (per operation) dropdowns, matching n8n's usual convention for multi-operation nodes.
  • Request parameters mapped to n8n field types (string/number/boolean/options/collection), including:
    • Enum parameters mapped to n8n options fields.
    • Array parameters mapped to n8n's collection field type.
    • JSON object request bodies flattened into individual node fields (with disambiguation when a flattened field name collides with another parameter), falling back to a generic JSON field for shapes that don't map cleanly (e.g. arrays of complex objects).
  • One generated n8n credential type per security scheme declared in the spec (API key, HTTP basic, HTTP bearer), or OAuth2 auto-wired to n8n's built-in OAuth2 credential when the scheme declares a clientCredentials or authorizationCode flow (falls back to a manual access-token field otherwise).
  • Each operation authenticates with whichever credential matches its own declared security requirement (or the spec's global default), so multi-scheme specs are handled per-operation rather than per-package.
  • A generated README.md documenting the package's resources/operations and credentials.

Motivation

n8n is a popular workflow-automation tool, and building community nodes by hand for an existing HTTP API is repetitive boilerplate that maps closely to what's already declared in that API's OpenAPI spec. This generator automates that boilerplate the same way existing client-SDK generators do for their respective languages/frameworks.

Status

Implementation is complete, including unit tests and a sample under samples/client/petstore/n8n. I'll open a PR shortly that references this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions