Workflows API Validation Testing Guide banner
salacoste salacoste

Workflows API Validation Testing Guide

Testing community intermediate

Description

**Story 2.1: Validate & Test Workflows API** This guide explains how to run comprehensive validation tests for all 8 Workflows API methods against a live n8n instance.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for salacoste/mcp-n8n-workflow-builder, shared by 8 entries in this directory. It describes the repository, not this entry specifically.

Workflows API Validation Testing Guide

**Story 2.1: Validate & Test Workflows API**

This guide explains how to run comprehensive validation tests for all 8 Workflows API methods against a live n8n instance.

Prerequisites

1. Live n8n Instance

You need access to a running n8n instance (v1.82.3 or later) with:

  • API access enabled
  • Valid API key with workflow management permissions
  • Network accessibility from your test environment

2. Project Setup

# Install dependencies
npm install

# Build the project
npm run build

3. Configuration

Option A: Using .config.json (Multi-Instance)

Create or update `.config.json` in the project root:

{
  "environments": {
    "production": {
      "n8n_host": "https://your-n8n-instance.com",
      "n8n_api_key": "your_api_key_here"
    },
    "staging": {
      "n8n_host": "https://staging-n8n.com",
      "n8n_api_key": "staging_api_key"
    }
  },
  "defaultEnv": "production"
}

Option B: Using .env (Single Instance)

Create `.env` file in project root:

N8N_HOST=https://your-n8n-instance.com
N8N_API_KEY=your_api_key_here
MCP_PORT=3456

**Important**: Provide the base URL without `/api/v1`. The server automatically appends `/api/v1`.

Running Validation Tests

1. Start MCP Server

In one terminal:

npm start

The server should start on `http://localhost:3456` (or your configured `MCP_PORT`).

Verify health:

curl http://localhost:3456/health

Expected response:

{"status":"ok"}

2. Run Validation Tests

In another terminal:

node test-workflows-validation.js

3. Test Execution Options

Edit `test-workflows-validation.js` to control which tests run:

const testFlags = {
  runListWorkflowsTests: true,      // GET /workflows
  runGetWorkflowTests: true,         // GET /workflows/{id}
  runCreateWorkflowTests: true,      // POST /workflows
  runUpdateWorkflowTests: true,      // PUT /workflows/{id}
  runDeleteWorkflowTests: true,      // DELETE /workflows/{id}
  runActivateWorkflowTests: true,    // PUT /workflows/{id}/activate
  runDeactivateWorkflowTests: true,  // PUT /workflows/{id}/deactivate
  runExecuteWorkflowTests: true,     // Execute workflow
  runMultiInstanceTests: false,      // Requires multi-instance config
  runErrorHandlingTests: true,       // Error scenarios
  runCleanup: true                   // Delete test workflows after
};

4. Debug Mode

Enable detailed logging:

DEBUG=true node test-workflows-validation.js

Test Coverage

The validation suite includes **54+ comprehensive tests**:

Task 2: list_workflows (7 tests)

  • ✓ List all workflows without filters
  • ✓ Response structure validation
  • ✓ Filter by active=true
  • ✓ Filter by active=false
  • ✓ Pagination with limit parameter
  • ✓ Multi-instance routing
  • ✓ Error handling (401, malformed params)

Task 3: get_workflow (5 tests)

  • ✓ Retrieve existing workflow by ID
  • ✓ Compl