Skip to content

Build n8n nodes from OpenAPI specs and YAML files

License

Notifications You must be signed in to change notification settings

ivov/nodebuilder

Repository files navigation

Nodemaker

Nodebuilder

Build n8n nodes from OpenAPI specs and custom API mappings
by Iván Ovejero

InstallationOperationCustom Spec Syntax


Nodebuilder is a utility to generate n8n node files from

Developed to automate the node creation process for:

  • *.node.ts, logic for a regular node,
  • GenericFunctions.ts, helper functions, and
  • *Description.ts, parameter descriptions.

Installation

$ git clone https://github.com/ivov/nodebuilder.git
$ cd nodebuilder && npm i

Operation

OpenAPI

  1. Place the input file in src/input/openApi/
  2. Run npm run generate
  3. Inspect src/output/

Notes:

  • OpenAPI parsing may fail at undetected edge cases. If your spec cannot be parsed, please open an issue.
  • OpenAPI parsing needs to be adjusted to respect n8n's resources-and-operations format. Work in progress.

YAML

  1. Write a YAML file in src/input/custom/
  2. Run npm run generate
  3. Inspect src/output/

For a full description of how to describe an API in YAML, refer to this explanation.

For a full example of an API description in YAML, refer to copper.yaml.

Placement

Run npm run place to place the output files in:

  • an n8n clone dir (located alongside the nodebuilder dir), or
  • the default custom nodes dir at ~/.n8n/custom.

Pending

OpenAPI:

  • Add intermediate step to structure the result.
  • Add support for more content types.

YAML:

  • Add support for multiOptions

Generator:

  • Add resource loaders to the TypeScript generator.
  • Generate *.credentials.ts

Extras:

Author

© 2021 Iván Ovejero

License

Distributed under the MIT License. See LICENSE.md.

About

Build n8n nodes from OpenAPI specs and YAML files

Topics

Resources

License

Stars

Watchers

Forks