Executions API Validation Testing Guide banner
salacoste salacoste

Executions API Validation Testing Guide

Testing community intermediate

Description

**Story:** 2.2 - Validate & Test Executions API **Status:** In Progress **Test Suite:** `test-executions-validation.js`

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.

Executions API Validation Testing Guide

**Story:** 2.2 - Validate & Test Executions API **Status:** In Progress **Test Suite:** `test-executions-validation.js`

Overview

Comprehensive validation testing for all 3 Executions API methods implemented in the n8n Workflow Builder MCP Server:

  • list_executions - List and filter execution history
  • get_execution - Retrieve detailed execution information
  • delete_execution - Remove execution records

Prerequisites

1. Running n8n Instance

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

  • Valid API key
  • Existing workflow executions (for comprehensive testing)

**Recommended:** Execute some workflows manually through the n8n web interface before running tests to ensure test data availability.

2. Environment Configuration

**Option A: Multi-instance configuration (`.config.json`)**

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

**Option B: Single instance configuration (`.env`)**

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

**Important:** Both `.config.json` and `.env` are gitignored for security.

3. Built Project

npm run build

Running the Tests

Basic Test Execution

# 1. Build the project
npm run build

# 2. Start the MCP server in background
npm start &

# 3. Wait for server to start (2-3 seconds)
sleep 3

# 4. Run executions validation tests
node test-executions-validation.js

Test Configuration

Edit `test-executions-validation.js` to customize test behavior:

const config = {
  testFlags: {
    generateExecutions: true,  // Create test workflows (note: executions must be manual)
    runListTests: true,        // Test list_executions method
    runGetTests: true,         // Test get_execution method
    runDeleteTests: true,      // Test delete_execution method
    runCleanup: true           // Clean up test data after tests
  }
};

Test Categories

1. list_executions Tests (6 tests)

Tests the execution listing and filtering functionality:

  • List all executions - Basic listing functionality
  • Response structure - Validate required fields (id, finished, mode, startedAt, workflowId)
  • Pagination limit - Test limit parameter
  • Cursor pagination - Test cursor-based pagination with nextCursor
  • Filter by workflowId - Test workflow-specific filtering
  • includeData parameter - Test data inclusion/exclusion

**Expected Fields in Response:**

{
  "data": [
    {
      "id": "string",
      "finished": boolean,
      "mode": "string",
      "startedAt": "ISO 8601 date",
      "stoppedAt": "ISO 8601 date or null",
      "workflowId": "string"
    }
  ],
  "nextCursor": "string or null"
}

2. get_execution Tests (4 tests)

Tests individual execution retrieval:

  • Retrieve by ID - Get