Skip to main content

Overview

The Plugins API provides endpoints to discover and retrieve information about loaded plugins. Plugins extend AutoMFlows with custom node types, actions, and functionality.

List All Plugins

Retrieve metadata for all loaded plugins.

Endpoint

GET /api/plugins

Example Request

curl http://localhost:3003/api/plugins

Response

Returns an array of plugin metadata objects.
id
string
required
Plugin directory name (unique identifier)
manifest
object
required
Plugin manifest containing metadata and configuration
path
string
required
Absolute path to plugin directory on the filesystem
loaded
boolean
required
Whether the plugin was successfully loaded
error
string
Error message if plugin failed to load

Response Example

[
  {
    "id": "example-plugin",
    "manifest": {
      "name": "Example Plugin",
      "version": "1.0.0",
      "description": "Example plugin demonstrating custom node types",
      "author": "AutoMFlows Team",
      "nodes": [
        {
          "type": "customAction",
          "name": "Custom Action",
          "category": "actions",
          "icon": "bolt",
          "description": "Perform a custom action"
        }
      ],
      "dependencies": {
        "axios": "^1.6.0"
      }
    },
    "path": "/absolute/path/to/plugins/example-plugin",
    "loaded": true
  },
  {
    "id": "api-integration",
    "manifest": {
      "name": "API Integration Plugin",
      "version": "2.1.0",
      "description": "Advanced API integration nodes",
      "author": "Community",
      "nodes": [
        {
          "type": "apiRequest",
          "name": "API Request",
          "category": "integration",
          "icon": "globe",
          "description": "Make HTTP API requests"
        },
        {
          "type": "jsonParse",
          "name": "Parse JSON",
          "category": "data",
          "icon": "code",
          "description": "Parse and extract JSON data"
        }
      ]
    },
    "path": "/absolute/path/to/plugins/api-integration",
    "loaded": true
  },
  {
    "id": "broken-plugin",
    "manifest": {
      "name": "Broken Plugin",
      "version": "1.0.0"
    },
    "path": "/absolute/path/to/plugins/broken-plugin",
    "loaded": false,
    "error": "Failed to load plugin: Missing required field 'main' in manifest"
  }
]

Get Plugin Details

Retrieve detailed metadata for a specific plugin by ID.

Endpoint

GET /api/plugins/{pluginId}

Path Parameters

pluginId
string
required
Plugin ID (directory name)

Example Request

curl http://localhost:3003/api/plugins/example-plugin

Response

Returns a single plugin metadata object (same structure as list endpoint).
Response Example
{
  "id": "example-plugin",
  "manifest": {
    "name": "Example Plugin",
    "version": "1.0.0",
    "description": "Example plugin demonstrating custom node types",
    "author": "AutoMFlows Team",
    "main": "index.js",
    "nodes": [
      {
        "type": "customAction",
        "name": "Custom Action",
        "category": "actions",
        "icon": "bolt",
        "description": "Perform a custom action",
        "inputs": [
          {
            "name": "target",
            "type": "string",
            "required": true,
            "description": "Target element"
          },
          {
            "name": "value",
            "type": "string",
            "required": false,
            "description": "Value to use"
          }
        ],
        "outputs": [
          {
            "name": "result",
            "type": "string",
            "description": "Action result"
          }
        ]
      }
    ],
    "dependencies": {
      "axios": "^1.6.0"
    },
    "scripts": {
      "install": "npm install"
    }
  },
  "path": "/absolute/path/to/plugins/example-plugin",
  "loaded": true
}

Error Response (404)

{
  "error": "Plugin not found"
}

Plugin Manifest Structure

The plugin manifest (manifest.json) defines plugin metadata, node types, and configuration:

Required Fields

name
string
required
Plugin display name
version
string
required
Plugin version (semantic versioning)
main
string
required
Entry point file (e.g., index.js)

Optional Fields

description
string
Plugin description
author
string
Plugin author name or email
license
string
License identifier (e.g., MIT, Apache-2.0)
repository
string
Git repository URL
nodes
array
Array of node type definitions
dependencies
object
npm package dependencies

Example Manifest

manifest.json
{
  "name": "My Custom Plugin",
  "version": "1.0.0",
  "description": "Custom nodes for AutoMFlows",
  "author": "Your Name",
  "license": "MIT",
  "main": "index.js",
  "nodes": [
    {
      "type": "customClick",
      "name": "Custom Click",
      "category": "actions",
      "icon": "hand-pointer",
      "description": "Advanced click with custom options",
      "inputs": [
        {
          "name": "selector",
          "type": "string",
          "required": true,
          "description": "CSS selector"
        },
        {
          "name": "clickCount",
          "type": "number",
          "default": 1,
          "description": "Number of clicks"
        }
      ]
    }
  ],
  "dependencies": {
    "lodash": "^4.17.21"
  }
}

Plugin Loading

Plugins are automatically loaded from the plugins directory at server startup:
  1. Server scans the plugins directory
  2. Reads manifest.json from each plugin subdirectory
  3. Validates manifest structure
  4. Loads plugin entry point file
  5. Registers node types with the plugin registry

Plugin Directory Structure

plugins/
├── example-plugin/
│   ├── manifest.json
│   ├── index.js
│   ├── package.json
│   └── node_modules/
├── api-integration/
│   ├── manifest.json
│   ├── index.js
│   └── package.json
└── custom-nodes/
    ├── manifest.json
    └── index.js

Plugin Lifecycle

1

Discovery

Server discovers plugins in the plugins directory
2

Validation

Validates manifest.json structure and required fields
3

Loading

Loads plugin entry point and initializes
4

Registration

Registers node types with the plugin registry
5

Availability

Plugin nodes become available in the workflow editor

Error Handling

Plugins that fail to load are included in the API response with loaded: false and an error message:
{
  "id": "broken-plugin",
  "manifest": {
    "name": "Broken Plugin",
    "version": "1.0.0"
  },
  "path": "/absolute/path/to/plugins/broken-plugin",
  "loaded": false,
  "error": "Failed to load plugin: Missing required field 'main' in manifest"
}

Common Load Errors

  • Missing or invalid manifest.json
  • Missing required fields (name, version, main)
  • Invalid node type definitions
  • Entry point file not found
  • JavaScript syntax errors in plugin code
  • Missing dependencies

Creating Plugins

To create a custom plugin:
1

Create Plugin Directory

mkdir plugins/my-plugin
cd plugins/my-plugin
2

Create Manifest

manifest.json
{
  "name": "My Plugin",
  "version": "1.0.0",
  "main": "index.js",
  "nodes": [
    {
      "type": "myNode",
      "name": "My Custom Node",
      "category": "actions"
    }
  ]
}
3

Create Entry Point

index.js
module.exports = {
  nodes: {
    myNode: {
      async execute(context, nodeData) {
        // Node implementation
        console.log('Executing custom node');
        return { success: true };
      }
    }
  }
};
4

Restart Server

npm run dev
5

Verify Plugin Loaded

curl http://localhost:3003/api/plugins

Next Steps

Workflow Execution

Execute workflows using plugin nodes

Plugin Development

Learn how to develop custom plugins

Build docs developers (and LLMs) love