Skip to main content

Introduction

The AutoMFlows API provides programmatic access to workflow execution, batch management, plugin discovery, and report generation. Built on Node.js with Express, the API supports both single workflow execution and parallel batch processing with WebSocket real-time updates.

Base URL

http://localhost:3003
The server dynamically finds an available port. The actual port is written to .automflows-port in the project root.

API Endpoints

The API is organized into the following resource groups:

Workflows

Execute workflows in single or parallel mode, manage batches, and control execution

Execution Control

Monitor execution status, stop/continue workflows, and manage breakpoints

Plugins

Discover and retrieve information about loaded plugins

Reports

Access, download, and manage execution reports in multiple formats

Authentication

Currently, the AutoMFlows API does not require authentication. All endpoints are accessible without API keys or tokens. This is suitable for local development and internal network deployments.
If exposing the API over a network, consider implementing authentication middleware or using a reverse proxy with authentication.

Request Format

The API accepts JSON request bodies for POST requests:
curl -X POST http://localhost:3003/api/workflows/execute \
  -H "Content-Type: application/json" \
  -d '{
    "workflow": {
      "nodes": [...],
      "edges": [...]
    },
    "executionMode": "single"
  }'
For file uploads, use multipart/form-data:
curl -X POST http://localhost:3003/api/workflows/execute \
  -F '[email protected]' \
  -F '[email protected]' \
  -F 'workers=4'

Response Format

All API responses return JSON with consistent error formatting:

Success Response

{
  "executionId": "exec-1234567890",
  "status": "running",
  "executionMode": "single"
}

Error Response

{
  "error": "Invalid workflow format",
  "message": "Workflow must contain nodes and edges arrays"
}

HTTP Status Codes

Status CodeDescription
200Success - Request completed successfully
400Bad Request - Invalid request parameters or body
404Not Found - Resource not found
500Internal Server Error - Server error occurred

Real-Time Updates

The API includes Socket.IO support for real-time execution updates:
import { io } from 'socket.io-client';

const socket = io('http://localhost:3003');

socket.on('execution-update', (data) => {
  console.log('Execution update:', data);
});

socket.on('batch-update', (data) => {
  console.log('Batch update:', data);
});

Rate Limiting

Currently, the API does not enforce rate limiting. For production deployments, consider implementing rate limiting middleware.

CORS

CORS is enabled for all origins (*). To restrict access, modify the CORS configuration in backend/src/server.ts:
app.use(cors({
  origin: 'https://yourdomain.com'
}));

Request Size Limits

The API accepts request bodies up to 10MB to accommodate large workflow definitions and batch uploads:
app.use(express.json({ limit: '10mb' }));
app.use(express.urlencoded({ extended: true, limit: '10mb' }));

API Documentation (Swagger)

Interactive API documentation is available via Swagger UI:
http://localhost:3003/api-docs
The OpenAPI JSON specification is available at:
http://localhost:3003/api-docs.json

System Information

Retrieve system information including versions and resource usage:
curl http://localhost:3003/api/system-info
Response:
{
  "appVersion": "1.0.0",
  "nodeVersion": "v18.17.0",
  "os": "linux",
  "arch": "x64",
  "playwrightVersion": "1.40.0",
  "ramTotal": 16777216000,
  "ramFree": 8388608000,
  "username": "developer"
}

Next Steps

Execute Workflows

Learn how to execute workflows via API

Manage Batches

Control batch executions and monitor progress

Build docs developers (and LLMs) love