Skip to Content

next-workflow-builder

DevKit AI Builder Template DocumentationMarketplace
CTRL K
Demo
CTRL K
  • DevKit 
  • AI Builder Template 
    • Introduction
    • Getting Started
    • Configuration
    • Plugins
      • Overview
      • HTTP Request
      • Condition
      • Loop
      • Merge
      • Database Query
      • Run Workflow
      • Run Workflows in Sequence
      • Switch
    • Creating Plugins
    • API Reference
    • CLI Reference
    • Components
    • Database
    • Authentication
    • Deployment
    • Architecture
    • Contributing
    • MCP Server
  • Marketplace
  • Introduction
  • Getting Started
  • Configuration
  • Plugins
    • Overview
    • HTTP Request
    • Condition
    • Loop
    • Merge
    • Database Query
    • Run Workflow
    • Run Workflows in Sequence
    • Switch
  • Creating Plugins
  • API Reference
  • CLI Reference
  • Components
  • Database
  • Authentication
  • Deployment
  • Architecture
  • Contributing
  • MCP Server

On This Page

  • How plugins work
  • Plugin structure
  • Auto-generated files
  • Using plugins
  • Installing a local plugin
  • Installing an npm plugin
  • Plugin discovery in your build
  • Config field types
  • Conditional fields
  • Field groups
  • Output fields and templates
  • Output display configuration
  • Next steps
Question? Give us feedback Edit this page 
DocumentationPlugins

Plugins

Plugins are the extension system for next-workflow-builder. Each plugin adds an integration (e.g. Slack, GitHub, Stripe) with its own credentials, actions, step handlers, and optionally custom API routes and UI components.

How plugins work

  1. Each plugin lives in its own directory under plugins/ or is installed via npm
  2. Plugins auto-register when imported by calling registerIntegration()
  3. You manage plugins/index.ts — add import lines for each plugin (local or npm)
  4. The nwb discover-plugins CLI imports plugins/index.ts and generates registry files
  5. Generated files wire everything together: types, step imports, display configs, and codegen templates

Plugin structure

plugins/ {plugin-name}/ index.ts # Plugin definition + auto-registration (required) icon.tsx # SVG icon component (required) credentials.ts # Credential type definition (required) test.ts # Connection test function (recommended) steps/ # Step handler functions (one per action) {action-slug}.ts routes/ # Custom API route handlers (optional) {route-name}.ts components/ # Custom UI components (optional) lib/ # Shared utilities (optional) client.ts # Client-side setup / side effects (optional)

Auto-generated files

Running nwb discover-plugins generates these files in your consumer app:

FileDescription
plugins/index.tsUser-managed. Scaffolded once, then you edit it to add/remove plugin imports
lib/types/integration.tsUnion type of all integration type slugs
lib/step-registry.tsMaps action IDs to lazy step import functions
lib/output-display-configs.tsMaps action IDs to output display configurations
lib/codegen-registry.tsCode generation templates for workflow export

The lib/ files are regenerated every time you run the discovery script. Do not edit them manually. plugins/index.ts is scaffolded once and then managed by you — edit it to add or remove plugins.

Using plugins

Installing a local plugin

  1. Copy the plugin directory into your plugins/ folder
  2. Add an import line to plugins/index.ts:
    import "./my-plugin";
  3. Run pnpm discover-plugins (or it runs automatically on build)

Installing an npm plugin

  1. Install the package:
    pnpm add @next-workflow-builder/loop
  2. Add an import line to plugins/index.ts:
    import "@next-workflow-builder/loop";
  3. Run pnpm discover-plugins (or it runs automatically on build)

Plugin discovery in your build

The example app runs discovery automatically before dev and build:

{ "scripts": { "dev": "nwb discover-plugins && next dev", "build": "nwb discover-plugins && next build" } }

Config field types

Plugins define config fields for their actions. These control the UI shown when configuring a workflow node.

TypeDescription
textPlain text input
passwordPassword/secret input (masked)
numberNumber input with optional min value
selectDropdown select (requires options array)
template-inputText input with {{variable}} template support
template-textareaTextarea with {{variable}} template support
schema-builderVisual schema builder for structured output
groupGroups related fields in a collapsible section

Conditional fields

Fields support conditional rendering with showWhen:

{ key: "schema", label: "Output Schema", type: "schema-builder", showWhen: { field: "format", equals: "object" }, }

Field groups

Group related fields in collapsible sections:

{ label: "Advanced Options", type: "group", defaultExpanded: false, fields: [ { key: "timeout", label: "Timeout (ms)", type: "number" }, { key: "retries", label: "Max Retries", type: "number" }, ], }

Output fields and templates

Actions declare their output fields, which become available as {{NodeName.field}} template variables in downstream nodes:

actions: [ { slug: "scrape", label: "Scrape URL", outputFields: [ { field: "markdown", description: "Scraped content as markdown" }, { field: "metadata", description: "Page metadata object" }, ], // ... }, ];

Downstream nodes can reference these outputs using template syntax:

{{ScrapeURL.markdown}}

Output display configuration

Actions can specify how their output is displayed in the workflow execution panel:

{ slug: "generate-image", outputConfig: { type: "image", // "image" | "video" | "url" | "component" field: "imageUrl", // Field in step output containing the value }, }

For custom rendering, use a React component:

{ outputConfig: { type: "component", component: MyResultComponent, }, }

Next steps

  • Creating Plugins - Build your own plugin from scratch
  • API Reference - Plugin registry functions and types
Last updated on March 12, 2026
ConfigurationOverview

© 2026 All rights reserved.

Product by David Sanchez