Document
Node

Node

Utitled.png

A Node Shape is like this.

(function () {
  const nodeConfig = {
    config: {
      // name, description, input/output/options definites here
    },
    run(input, options, context) {
      // receive input, and return output
    },
  }
  return nodeConfig
})()

Definition

type TypeDefinition = {
  type: "string" | "number" | "boolean" | "json" | "enum" | "any" | "file"
  enumItems?: { name: string; value: string }[]
  desc?: string
}
type Option = {
  name: string
  default?: any
} & TypeDefinition
type MetaNodeConfig = {
  config: {
    name: string
    input?: TypeDefinition
    output?: TypeDefinition
    options?: Option[]
  }
  run(input: any, options: Record<string, any>, context: RunningContext): any
}

Bundled Node

If your node is very complex or depends on an npm package, you will need to use a bundler to bundle it. This GitHub repository (opens in a new tab) provides a template for bundling a Node.