n8n-workflow-testing-fundamentals

Validate n8n workflow structure, data flow, and error handling.

436|78|Updated Sep 11, 2025
One-click install
npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill n8n-workflow-testing-fundamentals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-workflow-testing-fundamentals
Source: https://github.com/proffesor-for-testing/agentic-qe/tree/main/.claude/skills/n8n-workflow-testing-fundamentals
Command: npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill n8n-workflow-testing-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

n8n Workflow Testing Fundamentals

<default_to_action> When testing n8n workflows:

  1. VALIDATE workflow structure before execution
  2. TEST with realistic test data
  3. VERIFY node-to-node data flow
  4. CHECK error handling paths
  5. MEASURE execution performance

Quick n8n Testing Checklist:

  • All nodes properly connected (no orphans)
  • Trigger node correctly configured
  • Data mappings between nodes valid
  • Error workflows defined
  • Credentials properly referenced

Critical Success Factors:

  • Test each execution path separately
  • Validate data transformations at each node
  • Check retry and error handling behavior
  • Verify integrations with external services </default_to_action>

Quick Reference Card

When to Use

  • Testing new n8n workflows
  • Validating workflow changes
  • Debugging failed executions
  • Performance optimization
  • Pre-deployment validation

n8n Workflow Components

| Component | Purpose | Testing Focus | |-----------|---------|---------------| | Trigger | Starts workflow | Reliable activation, payload handling | | Action Nodes | Process data | Configuration, data mapping | | Logic Nodes | Control flow | Conditional routing, branches | | Integration Nodes | External APIs | Auth, rate limits, errors | | Error Workflow | Handle failures | Recovery, notifications |

Workflow Execution States

| State | Meaning | Test Action | |-------|---------|-------------| | running | Currently executing | Monitor progress | | success | Completed successfully | Validate outputs | | failed | Execution failed | Analyze error | | waiting | Waiting for trigger | Test trigger mechanism |


Workflow Structure Validation

// Validate workflow structure before execution
async function validateWorkflowStructure(workflowId: string) {
  const workflow = await getWorkflow(workflowId);

  // Check for trigger node
  const triggerNode = workflow.nodes.find(n =>
    n.type.includes('trigger') || n.type.includes('webhook')
  );
  if (!triggerNode) {
    throw new Error('Workflow must have a trigger node');
  }

  // Check for orphan nodes (no connections)
  const connectedNodes = new Set();
  for (const [source, targets] of Object.entries(workflow.connections)) {
    connectedNodes.add(source);
    for (const outputs of Object.values(targets)) {
      for (const connections of outputs) {
        for (const conn of connections) {
          connectedNodes.add(conn.node);
        }
      }
    }
  }

  const orphans = workflow.nodes.filter(n => !connectedNodes.has(n.name));
  if (orphans.length > 0) {
    console.warn('Orphan nodes detected:', orphans.map(n => n.name));
  }

  // Validate credentials
  for (const node of workflow.nodes) {
    if (node.credentials) {
      for (const [type, ref] of Object.entries(node.credentials)) {
        if (!await credentialExists(ref.id)) {
          throw new Error(`Missing credential: ${type} for node ${node.name}`);
        }
      }
    }
  }

  return { valid: true, orphans, triggerNode };
}

Execution Testing

// Test workflow execution with various inputs
async function testWorkflowExecution(workflowId: string, testCases: TestCase[]) {
  const results: TestResult[] = [];

  for (const testCase of testCases) {
    const startTime = Date.now();

    // Execute workflow
    const execution = await executeWorkflow(workflowId, testCase.input);

    // Wait for completion
    const result = await waitForCompletion(execution.id, testCase.timeout || 30000);

    // Validate output
    const outputValid = validateOutput(result.data, testCase.expected);

    results.push({
      testCase: testCase.name,
      success: result.status === 'success' && outputValid,
      duration: Date.now() - startTime,
      actualOutput: result.data,
      expectedOutput: testCase.expected
    });
  }

  return results;
}

// Example test cases
const testCases = [
  {
    name: 'Valid customer data',
    input: { name: 'John Doe', email: '[email protected]' },
    expected: { processed: true, customerId: /^cust_/ },
    timeout: 10000
  },
  {
    name: 'Missing email',
    input: { name: 'Jane Doe' },
    expected: { error: 'Email required' },
    timeout: 5000
  },
  {
    name: 'Invalid email format',
    input: { name: 'Bob', email: 'not-an-email' },
    expected: { error: 'Invalid email' },
    timeout: 5000
  }
];

Data

Frequently Asked Questions about n8n-workflow-testing-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate n8n workflow structure before running it?

Workflow structure validation checks that your n8n automation has a trigger node, no orphaned nodes, and all credentials are properly referenced. Start by confirming the trigger is configured, verify node connections are complete, and ensure credentials exist before execution to catch configuration errors early.

What's the best way to test n8n workflows with realistic data?

Test n8n workflows by creating test cases that cover valid inputs, missing fields, and invalid formats. Execute each case separately, monitor execution state, and validate that outputs match expected results and error paths handle failures correctly.

How do I check data flow between nodes in an n8n workflow?

Data-flow verification in n8n involves validating data mappings at each node connection, ensuring transformations produce correct output shapes, and monitoring how data passes through action nodes, logic nodes, and integration nodes from trigger to completion.

Why should I test error handling paths in n8n workflows?

Error-path testing ensures your n8n workflow handles failures gracefully through retry logic and error workflows. Testing failure scenarios reveals whether external API errors, missing data, or timeouts trigger proper recovery actions or notifications.

Can I measure execution performance when testing n8n workflows?

Yes, performance measurement during n8n testing tracks execution duration for each test case and identifies bottlenecks. Monitor how long workflows take to complete, compare performance across test cases, and optimize slow nodes or integrations.

What do I need to check before deploying an n8n workflow to production?

Pre-deployment validation requires confirming all nodes are connected, the trigger is reliable, data mappings are valid, error workflows are defined, credentials are active, and execution performance is acceptable under realistic load.

Related Skills