test-workflow
Skill0 starsChanged 10 months agoMITView on GitHub
Universal n8n workflow testing via webhook or sub-workflow pattern
- Reads credentials
- Sends data out
2 other projects use a version of this.
Adopted by
Most recently taken up by
- jerseycheese/agent-skillstheir own version, first seen Oct 28, 2026
- rockychang7/skillstheir own version, first seen May 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jerseycheese/agent-skills★ 4same name
- rockychang7/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- create-credentialsSkill
- monitor-executionsSkill
- n8n-deploymentSkill
- n8n-diagnosticsSkill
- n8n-patternsSkill
- n8n-securitySkill
- n8n-testingSkill
- workflow-helpersSkill
- workflow-templatesSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Create or update .env in the n8n-mcp-agent root:
- Very specific: line 210
IMPORTANT FOR AI AGENTS: If workflow has Manual Trigger or Schedule Trigger, it cannot be tested directly.
- Distinctive: line 233
Add connection from new trigger to that node
- Distinctive: line 234
Keep Manual Trigger for manual runs
- Distinctive: line 265
When asked to test a workflow:
- Very specific: line 339
Add N8N_URL=https://your-n8n.com to .env file.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Workflow Skill
Universal testing solution for n8n workflows. Supports two patterns:
- Direct Webhook - for workflows with Webhook trigger
- Test Runner - for workflows with Execute Sub-workflow Trigger
Quick Start
1. Configure Environment
Create or update .env in the n8n-mcp-agent root:
N8N_URL=https://your-n8n-instance.com
N8N_API_KEY=your-api-key
TEST_RUNNER_PATH=test-runner # optional, default: test-runner2. Setup Test Runner (one-time)
./scripts/setup-test-runner.shThis creates a universal Test Runner workflow on your n8n instance.
3. Test Workflows
# Pattern 1: Direct webhook (for workflows with Webhook trigger)
./scripts/test-workflow.sh <workflow_id>
# Pattern 2: Test Runner (for workflows with Execute Sub-workflow Trigger)
./scripts/test-workflow.sh --runner <workflow_id>Scripts
| Script | Purpose | When to Use |
setup-test-runner.sh | Create Test Runner workflow | First time setup on new n8n instance |
test-workflow.sh | Test any workflow | Always - main testing script |
add-subworkflow-trigger.sh | Add testable trigger to workflow | If workflow has Manual/Schedule Trigger |
create-sample-workflow.sh | Create sample testable workflow | For testing the setup |
AI Agent Decision Flow
User asks: "Test workflow <ID>"
│
▼
┌─────────────────────────────┐
│ 1. Get workflow details │
│ curl .../workflows/<ID> │
└─────────────┬───────────────┘
│
▼
┌─────────────────────────────┐
│ 2. Check trigger type │
└─────────────┬───────────────┘
│
┌─────────┴─────────┬────────────────┬──────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│Webhook │ │ExecuteWorkflow│ │ManualTrigger│ │ScheduleTrigger│
│Trigger │ │Trigger │ │ │ │ │
└───┬────┘ └──────┬───────┘ └──────┬──────┘ └──────┬───────┘
│ │ │ │
▼ ▼ ▼ ▼
┌────────┐ ┌──────────────┐ ┌─────────────────────────────┐
│Pattern1│ │ Pattern 2 │ │ RUN: add-subworkflow- │
│Direct │ │ Test Runner │ │ trigger.sh <ID> │
└───┬────┘ └──────┬───────┘ │ Then use Pattern 2 │
│ │ └──────────────┬──────────────┘
▼ ▼ │
┌────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────┐
│ 3. Run test │
│ test-workflow.sh ... │
└─────────────────────────────┘Script Selection Rules
| Workflow Trigger | Script to Run First | Test Command |
n8n-nodes-base.webhook | None | test-workflow.sh <ID> |
n8n-nodes-base.executeWorkflowTrigger | None | test-workflow.sh --runner <ID> |
n8n-nodes-base.manualTrigger | add-subworkflow-trigger.sh <ID> | test-workflow.sh --runner <ID> |
n8n-nodes-base.scheduleTrigger | add-subworkflow-trigger.sh <ID> | test-workflow.sh --runner <ID> |
Usage Examples
Test workflow with Webhook trigger
# Auto-detect webhook path from workflow
./scripts/test-workflow.sh p02YJcCILcg5p3OQ
# With custom data
./scripts/test-workflow.sh p02YJcCILcg5p3OQ '{"user": "test", "action": "create"}'
# Direct webhook path
./scripts/test-workflow.sh --path my-webhook-pathTest workflow with Execute Sub-workflow Trigger
# Via Test Runner
./scripts/test-workflow.sh --runner BFeLmDYJ7DlbwQMM
# With input data
./scripts/test-workflow.sh --runner BFeLmDYJ7DlbwQMM '{"input": "data"}'Setup commands
# Create Test Runner (first time setup)
./scripts/setup-test-runner.sh
# Recreate Test Runner (force)
./scripts/setup-test-runner.sh --force
# Create sample workflow for testing
./scripts/create-sample-workflow.sh
# Create sample with custom name
./scripts/create-sample-workflow.sh "My Test Workflow"Architecture
Pattern 1: Direct Webhook
┌─────────────────┐
│ Workflow ID │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Get webhook URL │
└────────┬────────┘
│
┌────┴────┐
│ Active? │
└────┬────┘
NO │ YES
│ │ │
▼ │ ▼
┌──────┐ │ ┌──────────────┐
│Activ.│─┘ │ Call webhook │
└──────┘ └──────┬───────┘
│
▼
┌────────────────┐
│ Get execution │
└────────────────┘Pattern 2: Test Runner (Sub-workflow)
┌─────────────────────────────────────────────────┐
│ Test Runner Workflow │
│ ┌──────────┐ ┌────────────────────┐ │
│ │ Webhook │───▶│ Execute Sub-workflow│ │
│ │ /test- │ │ (dynamic by ID) │ │
│ │ runner │ └─────────┬──────────┘ │
│ └──────────┘ │ │
│ ┌──────────▼──────────┐ │
│ │ Respond to Webhook │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Target Workflow │
│ ┌──────────────────────┐ ┌─────────────┐ │
│ │ Execute Sub-workflow │───▶│ Your Logic │ │
│ │ Trigger │ │ ... │ │
│ └──────────────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────┘Which Pattern to Use?
| Trigger Type | Recommended Pattern |
| Webhook | Pattern 1 (Direct) |
| Execute Sub-workflow Trigger | Pattern 2 (Test Runner) |
| Manual Trigger | Convert → add Execute Sub-workflow Trigger |
| Schedule Trigger | Add Execute Sub-workflow Trigger as alternative |
Converting Manual Trigger Workflows
IMPORTANT FOR AI AGENTS: If workflow has Manual Trigger or Schedule Trigger, it cannot be tested directly. You MUST add an Execute Sub-workflow Trigger node.
Step-by-step Conversion
- Get current workflow
curl -H "X-N8N-API-KEY: $API_KEY" "$N8N_URL/api/v1/workflows/<id>"- Add Execute Sub-workflow Trigger node
{
"parameters": {},
"id": "subworkflow-trigger",
"name": "Execute Sub-workflow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1,
"position": [250, 500]
}- Connect to existing flow
- Find the first node after Manual Trigger
- Add connection from new trigger to that node
- Keep Manual Trigger for manual runs
- Update workflow via API
curl -X PUT -H "X-N8N-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "...", "nodes": [...], "connections": {...}, "settings": {...}}' \
"$N8N_URL/api/v1/workflows/<id>"Or use the script:
./scripts/add-subworkflow-trigger.sh <workflow_id> [target_node]Example: Before and After
Before (not testable):
Manual Trigger → Shopify → AI Agent → ...After (testable via Test Runner):
Manual Trigger ─────────────────┐
├→ Shopify → AI Agent → ...
Execute Sub-workflow Trigger ───┘AI Agent Checklist
When asked to test a workflow:
- ✅ Get workflow details
- ✅ Check trigger type:
n8n-nodes-base.webhook→ use Pattern 1 (direct)n8n-nodes-base.executeWorkflowTrigger→ use Pattern 2 (runner)n8n-nodes-base.manualTrigger→ ADD executeWorkflowTrigger firstn8n-nodes-base.scheduleTrigger→ ADD executeWorkflowTrigger first
- ✅ If trigger added, update workflow via API
- ✅ Activate workflow if needed
- ✅ Run test with
--runnermode
Environment Variables
| Variable | Required | Default | Description |
N8N_URL | Yes | - | Your n8n instance URL |
N8N_API_KEY | Yes | - | n8n API key |
TEST_RUNNER_PATH | No | test-runner | Webhook path for Test Runner |
TEST_RUNNER_NAME | No | Test Runner | Workflow name for Test Runner |
Output Format
The test script outputs:
- Workflow status (active/inactive)
- Webhook response (JSON formatted)
- Execution details (id, status, timing)
- Error details (if any)
Example output:
========================================
N8N WORKFLOW TEST
========================================
URL: https://n8n.example.com
Time: Fri Jan 23 10:41:10 PST 2026
----------------------------------------
Mode: Test Runner (sub-workflow)
Target Workflow: BFeLmDYJ7DlbwQMM
Test Runner Path: test-runner
Status: Active
----------------------------------------
Calling test runner...
Data: {"test": true, "source": "claude-code"}
----------------------------------------
RESPONSE:
[
{
"received": {...},
"status": "success"
}
]
----------------------------------------
TARGET WORKFLOW EXECUTION:
{
"id": "37",
"status": "success",
"mode": "integrated",
"startedAt": "2026-01-23T10:41:10.766Z",
"stoppedAt": "2026-01-23T10:41:10.792Z",
"workflowId": "BFeLmDYJ7DlbwQMM"
}
========================================Dependencies
curl- HTTP clientjq- JSON processor- n8n instance with API access
Troubleshooting
"N8N_URL not set"
Add N8N_URL=https://your-n8n.com to .env file.
"N8N_API_KEY not set"
Generate API key in n8n: Settings → API → Create API Key.
"No webhook trigger found"
Workflow doesn't have a Webhook node. Use --runner mode instead.
"Missing node to start execution"
Target workflow needs Execute Sub-workflow Trigger node for --runner mode.
Test Runner doesn't exist
Run ./scripts/setup-test-runner.sh first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

