mirror of
https://github.com/thecyberlearn/quantum-ai-v2.git
synced 2026-08-18 14:52:59 +00:00
- Add N8N workflow directory structure for webhook-based agents - Create workflow management scripts (import/export/sync/backup) - Add comprehensive documentation for each agent's workflow setup - Clarify N8N deployment architecture (separate hosting from Django) - Update deployment guides with clear separation warnings - Add workflow deployment automation scripts Architecture clarification: - Django app deploys to Railway - N8N runs separately (N8N Cloud, separate Railway project, or self-hosted) - Communication via HTTP webhook URLs only 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdf_data_analyzer.json | ||
| README.md | ||
Data Analyzer Agent - N8N Workflow
Overview
This directory contains the N8N workflow configuration for the Data Analyzer Agent, which processes uploaded files (CSV, Excel, PDF) and provides intelligent data analysis.
Workflow Files
workflow.json- Production workflow for N8N importworkflow_dev.json- Development/testing version (optional)workflow_backup.json- Backup version for disaster recovery
Webhook Configuration
- Webhook URL: Configured via
N8N_WEBHOOK_DATA_ANALYZERenvironment variable - HTTP Method: POST
- Expected Data Format:
{ "file_name": "data.csv", "file_content": "base64_encoded_content", "analysis_type": "statistical", "user_request": "Analyze sales trends" }
Setup Instructions
1. Import Workflow to N8N
- Open your N8N instance
- Click "Import from File" or "Import from URL"
- Upload the
workflow.jsonfile - Configure credentials (OpenAI API key, etc.)
- Activate the workflow
2. Configure Webhook URL
- Copy the webhook URL from N8N
- Set environment variable:
N8N_WEBHOOK_DATA_ANALYZER=https://your-n8n.com/webhook/data-analyzer - Restart your Django application
3. Test the Workflow
# Test via Django application
python manage.py test_webhook data_analyzer
# Or test directly via curl
curl -X POST https://your-n8n.com/webhook/data-analyzer \
-H "Content-Type: application/json" \
-d '{"file_name":"test.csv","file_content":"dGVzdA==","analysis_type":"basic"}'
Workflow Components
- Webhook Node: Receives requests from Django application
- AI Processing: Uses OpenAI GPT-4 for data analysis
- Response Node: Returns structured analysis results
- Error Handling: Manages failures and timeouts
Expected Response Format
{
"success": true,
"analysis": {
"summary": "Data analysis summary",
"insights": ["Key insight 1", "Key insight 2"],
"recommendations": ["Recommendation 1", "Recommendation 2"],
"charts": [{"type": "bar", "data": {...}}]
},
"processing_time": 1.5
}
Troubleshooting
- Webhook not responding: Check N8N workflow is active and URL is correct
- Authentication errors: Verify OpenAI API credentials in N8N
- Timeout issues: Increase workflow timeout settings for large files
- Rate limiting: Monitor OpenAI API usage limits
Maintenance
- Regularly backup workflow configurations
- Monitor workflow execution logs in N8N
- Update AI prompts based on user feedback
- Scale webhook handling based on usage patterns