--n8n flag exports your PraisonAI workflow to n8n format and optionally auto-imports it into your n8n instance.
Quick Start
Usage
Basic Export
Auto-Import with API Key
Custom n8n URL
Custom API URL (Cloud/Tunnel)
When n8n is in the cloud and PraisonAI runs locally, use--api-url to specify a tunnel or cloud URL:
Generated Workflow Structure
The n8n workflow includes:Complete Workflow
Step 1: Start the API Server
Step 2: Create n8n Workflow
Step 3: Trigger the Workflow
Getting n8n API Key
- Open n8n UI (http://localhost:5678)
- Go to Settings → API
- Click Create API Key
- Copy the key and set it:
Example agents.yaml
n8n Workflow Features
Webhook Trigger
The workflow uses a webhook trigger for programmatic execution:- Path: Auto-generated from workflow name
- Method: POST
- Response Mode: Returns final agent output
Per-Agent HTTP Nodes
Each agent gets its own HTTP Request node:| Node | Endpoint | Purpose |
|---|---|---|
| Researcher | /agents/researcher | First agent, receives webhook input |
| Narrative Designer | /agents/narrative_designer | Receives researcher output |
| Scriptwriter | /agents/scriptwriter | Receives designer output, returns final |
Data Flow
Use Cases
Visual Workflow
See agent execution flow in n8n’s visual editor
Conditional Logic
Add IF nodes between agents for branching
Integration
Connect to other n8n nodes (Slack, Email, etc.)
Scheduling
Use n8n’s scheduler to run workflows periodically
Advanced: Manual Import
If auto-import fails, manually import the generated JSON:- Run
praisonai agents.yaml --n8n - Open n8n UI
- Click Add Workflow → Import from File
- Select
agents_n8n.json - Click Import
Troubleshooting
Connection Refused
API Key Invalid
Workflow Not Activating
Solution: Manually activate in n8n UI or check webhook settings.Command Options
| Option | Default | Description |
|---|---|---|
--n8n | - | Enable n8n export |
--n8n-url | http://localhost:5678 | n8n instance URL |
--api-url | http://127.0.0.1:8005 | PraisonAI API URL (for tunnel/cloud) |
Environment Variables
| Variable | Description |
|---|---|
N8N_API_KEY | n8n API key for auto-import |

