n8n
MCP molecule that provides AI agents with tools to interact with n8n workflows.
The n8n molecule provides these tools to AI agents:
-
n8n_list_workflows- List all workflows with metadata -
n8n_search_workflows- Search workflows by name/tag/keyword -
n8n_get_workflow_schema- Get workflow input schema and capabilities -
n8n_get_workflow- Get detailed workflow configuration -
n8n_execute_workflow- Trigger a workflow with input data -
n8n_get_execution- Get execution status and results -
n8n_list_executions- List recent workflow executions -
n8n_activate_workflow- Enable a workflow -
n8n_deactivate_workflow- Disable a workflow
AI discovers workflows without knowing IDs:
User: "What automation workflows do I have for Slack?"
AI: [Calls n8n_search_workflows("slack")]
"Found 3 Slack-related workflows:
• Slack Daily Standup (active) - Posts daily standup reminder
• Slack Incident Alert (active) - Sends incident notifications
• Slack Deploy Notification (inactive) - Announces deployments"
User: "What does the incident alert workflow need as input?"
AI: [Calls n8n_get_workflow_schema("slack-incident-alert")]
"The Slack Incident Alert workflow accepts:
• severity (string): 'P0', 'P1', 'P2'
• message (string): Alert message
• channel (string): Slack channel name
Trigger type: webhook"
User: "Send a P0 alert to #engineering about the database being down"
AI: [Searches for alert workflow, gets schema, then executes]
[n8n_search_workflows("alert") → finds "Slack Incident Alert"]
[n8n_get_workflow_schema("id") → learns input format]
[n8n_execute_workflow("id", {
severity: "P0",
message: "Database is down",
channel: "#engineering"
})]
"✅ P0 alert sent to #engineering. Execution ID: abc-123"
User: "We just deployed v2.4 to production"
AI: [Searches for deploy workflows]
[n8n_search_workflows("deploy") → finds notification workflow]
[n8n_execute_workflow with version info]
"✅ I've:
• Sent deployment notification to #releases
• Updated the status dashboard
• Created changelog entry"
- n8n instance with API access enabled
- n8n API key - Generate in n8n: Settings → API
cd molecules/n8n
docker build -t n8n-molecule:latest .
Edit k8s-deployment.yaml and update the Secret:
stringData:
url: "https://your-n8n-instance.com"
api-key: "n8n_api_YOUR_API_KEY"
kubectl apply -f k8s-deployment.yaml
The molecule will be auto-discovered by the SixDegree controller if:
- Deployed in
sixdegree-systemnamespace - Has label
molecule.sixdegree.ai/type: mcp - Service is named
n8n-molecule
Or register manually:
INSERT INTO sixdegree.molecules (
environment_id,
fully_qualified_path,
deployment_status,
external_http_url
) VALUES (
'your-env-id',
'n8n.sixdegree.ai/v1/automation',
'deployed',
'http://n8n-molecule.sixdegree-system.svc.cluster.local'
);
export N8N_URL="http://localhost:5678"
export N8N_API_KEY="your-api-key"
go run main.go
curl http://localhost:8080/mcp
The molecule uses the n8n REST API:
-
Requires n8n version 0.190.0+ for full API support
-
API keys are stored in Kubernetes Secrets
-
All communication with n8n should use HTTPS in production
-
Consider using network policies to restrict access to n8n
Here are some n8n workflows the AI could help manage:
- Data Sync - Sync data between systems on schedule
- Alert Notifications - Send Slack/email alerts on events
- Report Generation - Generate and distribute reports
- Data Processing - Transform and load data pipelines
- Incident Response - Automated incident workflows
Molecule not showing up in tools:
- Check pod logs:
kubectl logs -n sixdegree-system -l app=n8n-molecule - Verify service is accessible:
kubectl get svc -n sixdegree-system n8n-molecule - Check molecule registration in database
401 Authentication errors:
- Verify n8n API key is correct
- Check n8n API is enabled in settings
Workflow execution fails:
- Check workflow is active:
n8n_list_workflows - Verify input data format matches workflow expectations
- Check n8n execution logs in n8n UI