🔗 AI Agent Army Integration
Complete Guide to Using AI APIs with n8n & Workflow Automation
✅ PRODUCTION READY - All endpoints validated
🚀 Quick Start: Your First API Call
Add HTTP Request Node
Click the "+" button and search for "HTTP Request". Add it to your workflow.
💡 Pro Tip
You can also use "Webhook" node as a trigger and "HTTP Request" node for API calls!
Configure Optimal HTTP Request
Use the container name for fastest performance (75% faster than external domain):
🏆 Why Use Container Alias?
Container alias ncat
is 80% faster than external domains!
- Response time: ~0.35s vs 1.3s
- Shorter and cleaner URL
- No DNS lookup overhead
- No SSL handshake delay
- Direct network routing
- Built-in container alias support
Headers Configuration:
Execute and Verify
Click "Execute Node" and you should see a successful response:
✅ Expected Response (PRODUCTION VALIDATED):
✅ This response format is validated and production-ready using container URLs only.
🐳 Complete Docker URL Reference
📊 Container Information
Current Docker containers in our setup:
Service | Container Name | IP Address | Ports |
---|---|---|---|
NCA Toolkit | no-code-architects-toolkit-ncat-1 | 172.19.0.2 | 8080→8080 |
MinIO S3 | minio | 172.19.0.3 | 9000-9001 |
n8n Workflow | n8n-n8n-1 | 172.19.0.4 | 5678→5678 |
PostgreSQL | n8n-postgres-1 | 172.19.0.5 | 5432 (internal) |
🏆 Optimal URLs for n8n (Best Performance)
Use these container names for fastest communication between services:
✅ NCA Toolkit API (Recommended for n8n)
Response time: ~0.35s (80% faster than external domain)
✅ MinIO S3 Storage
Direct S3 API access for file operations (~0.5ms ping)
✅ PostgreSQL Database
Database connections for data storage
🌐 All URL Access Methods
1. Container Aliases (OPTIMAL for n8n)
2. Container Names (Alternative)
2. External Domains (Public Access) ⚠️ AVOID - SLOW & TIMEOUTS
3. Container IP Addresses (Direct)
4. Localhost (Server Scripts)
📊 Performance Comparison
Connection Method | Response Time | Best Use Case |
---|---|---|
Container Alias | 0.35s | n8n workflows (BEST CHOICE) |
Container IP | 0.3s | Direct internal calls |
Container Name | 0.4s | Full container names |
Localhost | 0.6s | Server scripts |
External Domain | 1.3s + timeouts | ❌ AVOID - Public access only |
💡 Pro Tip: Network Configuration
Docker Network: no-code-architects-toolkit_nca-network
Subnet: 172.19.0.0/16
Gateway: 172.19.0.1
All containers can communicate directly using container names for optimal performance!
⚙️ Basic Setup: HTTP Node Configuration
Standard HTTP Request Configuration
Every NCA API call follows this basic pattern in n8n:
Required Headers (All Requests):
POST Request Example: Audio Transcription
Here's how to configure a more complex POST request:
Request Body (JSON) - CORRECTED:
✅ Fixed Parameters
Removed invalid parameters based on actual API testing:
- ❌ Removed "task", "model", "include_text" - not supported
- ❌ Removed "include_srt", "word_timestamps" - not supported
- ✅ Only "media_url" parameter is required and working
💡 Dynamic Values
Use n8n expressions like {{ $json.file_url }}
to use data from previous nodes!
Handling Responses & Job Tracking
NCA API returns job IDs for long-running processes. Here's how to handle them:
Check Job Status:
🔄 Complete Workflow Examples
📹 Video Creation Pipeline
Transform an image into a professional video with captions
Node 1: Manual Trigger
Set up initial data for the workflow:
Node 2: HTTP Request - Image to Video
Method: POST | URL: http://ncat:8080/v1/image/convert/video
Node 3: Wait Node
Add a 30-second wait for processing to complete
Node 4: HTTP Request - Add Captions
Method: POST | URL: http://ncat:8080/v1/video/caption
🎵 Podcast Processing Workflow
Webhook Trigger
Accept incoming audio files via webhook
Transcription Node
🖼️ Automated Screenshot Service
Create a webhook endpoint that captures screenshots of any website
Screenshot Configuration
🎯 Advanced n8n Features
Using Variables and Expressions
Leverage n8n's powerful expression system with NCA APIs:
Error Handling and Retries
Implement robust error handling for API calls:
Error Handling Node:
Bulk Processing with Split & Merge
Process multiple files efficiently:
💡 Bulk Processing Pattern
- Use Split in Batches node to process files in groups
- Add HTTP Request nodes for each API call
- Use Wait nodes between batches to avoid rate limits
- Merge results with Merge node
Monitoring and Notifications
Set up comprehensive monitoring for your workflows:
Custom Functions for Complex Logic
Use Function nodes for advanced data manipulation:
🔧 Troubleshooting Guide
❌ Common Issues & Solutions
x-api-key
(not Authorization)
and the value is local-dev-key-123
http://minio:9000
for direct container access or ensure proper network configuration.
Debugging Tips
🔍 Debug Checklist
- Check the exact error message in n8n execution logs
- Verify API key in headers (case-sensitive)
- Test API endpoints with curl first
- Use n8n's "Execute Previous Nodes" to test step by step
- Check file URLs are publicly accessible
- Monitor API server status at http://ncat:8080/v1/toolkit/test (Container URL - Fast & Reliable)
Performance Optimization
⚠️ Rate Limiting
While there's no strict rate limiting, avoid sending 100+ concurrent requests. Use batching and delays for large operations.
✅ Best Practices
- Use job status polling for long operations instead of long timeouts
- Implement retry logic with exponential backoff
- Cache results in n8n workflow data when possible
- Use webhooks for asynchronous processing
- Monitor storage space in MinIO console
Testing Your Setup
Use this comprehensive test workflow to validate your configuration: