# n8n Integration with NocoDB
## Overview
n8n integrates with NocoDB via **REST API**, not MCP. This guide covers n8n-specific integration details.
## Key Point: n8n Doesn't Use MCP
**Important:**
- ❌ n8n does **NOT** use MCP servers
- ✅ n8n uses **REST API** directly via built-in NocoDB nodes
- ✅ Your MCP server choice (native vs custom) **doesn't affect n8n**
## n8n NocoDB Node Setup
### 1. Configure NocoDB Credentials in n8n
1. Go to your n8n instance: `https://n8n.v1su4.com`
2. Navigate to **Credentials** → **Add Credential**
3. Search for **NocoDB**
4. Configure:
- **Host**: `https://nocodb.v1su4.com`
- **API Token**: Your NocoDB API token (from Account Settings → Tokens)
- **API Version**: Select appropriate version (v2 or v3)
### 2. Use NocoDB Node in Workflows
1. Add **NocoDB** node to your workflow
2. Select your NocoDB credential
3. Choose operation:
- **Create** - Add new records
- **Update** - Modify existing records
- **Get** - Retrieve records
- **Delete** - Remove records
- **List** - List records with filters
### 3. API Version Compatibility
**n8n v0.200.0+** supports:
- ✅ NocoDB API v2
- ⚠️ API v3 - May need n8n update (test first)
**Your Setup:**
- NocoDB: API v3 (with v2 fallback)
- n8n: v2 instance
- **Action**: Test n8n workflows with API v3, fallback to v2 if needed
## n8n → NocoDB Workflows
### Example: Create Record in NocoDB
1. **Trigger**: Any n8n trigger (webhook, schedule, etc.)
2. **NocoDB Node**:
- Operation: **Create**
- Base ID: `pce7ccvwd1z09bx` (your base ID)
- Table ID: Your table ID
- Fields: Map from previous nodes
### Example: Read Records from NocoDB
1. **NocoDB Node**:
- Operation: **Get** or **List**
- Base ID: `pce7ccvwd1z09bx`
- Table ID: Your table ID
- Filters: Optional query filters
2. **Process Data**: Use n8n nodes to process records
## NocoDB → n8n Workflows
### Using NocoDB Webhooks
1. **In NocoDB:**
- Go to Base → Settings → Webhooks
- Create webhook pointing to n8n webhook URL
- Configure triggers (after insert, update, delete)
2. **In n8n:**
- Add **Webhook** node (trigger)
- Copy webhook URL
- Paste into NocoDB webhook configuration
- Process incoming data
### Webhook v3 Features (NocoDB 0.264.0+)
- ✅ Unified event types
- ✅ Richer payloads (bulk inserts include records)
- ✅ Field-level triggers
- ✅ Send Everything toggle
## API Endpoints Used by n8n
n8n's NocoDB node uses these REST API endpoints:
**API v3 (Primary):**
```
GET /api/v3/data/{base_id}/{table_id}/records
POST /api/v3/data/{base_id}/{table_id}/records
PATCH /api/v3/data/{base_id}/{table_id}/records?recordId={id}
DELETE /api/v3/data/{base_id}/{table_id}/records?recordId={id}
```
**API v2 (Fallback):**
```
GET /api/v2/tables/{table_id}/records
POST /api/v2/tables/{table_id}/records
PATCH /api/v2/tables/{table_id}/records/{id}
DELETE /api/v2/tables/{table_id}/records/{id}
```
## Testing n8n Integration
### 1. Test Connection
1. Create simple workflow
2. Add NocoDB node
3. Select **Get** operation
4. Test connection - should return records
### 2. Test CRUD Operations
- ✅ **Create**: Add test record
- ✅ **Read**: Retrieve test record
- ✅ **Update**: Modify test record
- ✅ **Delete**: Remove test record
### 3. Test Webhooks
- ✅ Trigger webhook from NocoDB
- ✅ Verify n8n receives data
- ✅ Process data in n8n workflow
## Common n8n Workflow Patterns
### Pattern 1: Data Sync
```
External API → n8n → NocoDB (Create/Update)
```
### Pattern 2: Data Processing
```
NocoDB (Get) → n8n (Process) → NocoDB (Update)
```
### Pattern 3: Event-Driven
```
NocoDB Webhook → n8n (Process) → External Service
```
### Pattern 4: Scheduled Reports
```
Schedule Trigger → NocoDB (Get) → n8n (Aggregate) → Email/Slack
```
## Troubleshooting
### Issue: "Connection failed"
**Check:**
- ✅ NocoDB URL is correct: `https://nocodb.v1su4.com`
- ✅ API token is valid
- ✅ Network connectivity between n8n and NocoDB
- ✅ API version compatibility
### Issue: "API v3 not supported"
**Solution:**
- Use API v2 in n8n credentials
- Or update n8n to version that supports v3
- Your NocoDB supports both v2 and v3
### Issue: "Webhook not triggering"
**Check:**
- ✅ Webhook URL is accessible from NocoDB
- ✅ n8n webhook node is active
- ✅ Webhook configuration in NocoDB is correct
- ✅ Check NocoDB webhook logs
## Best Practices
1. **Use API Tokens**
- Generate tokens in NocoDB: Account Settings → Tokens
- Store securely in n8n credentials
- Rotate tokens periodically
2. **Handle Errors**
- Add error handling nodes in n8n
- Log errors for debugging
- Retry failed operations
3. **Optimize Queries**
- Use filters to limit data
- Paginate large datasets
- Cache frequently accessed data
4. **Monitor Performance**
- Track workflow execution times
- Monitor API rate limits
- Set up alerts for failures
## Your Setup
- **NocoDB**: `https://nocodb.v1su4.com`
- **n8n**: `https://n8n.v1su4.com`
- **Base ID**: `pce7ccvwd1z09bx` (KEDB-SOLO)
- **API Version**: v3 (with v2 fallback)
- **Storage**: MinIO S3 at `https://minio-api.v1su4.com` (configure if needed)
## References
- [n8n NocoDB Node Documentation](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.nocodb/)
- [n8n NocoDB Credentials](https://docs.n8n.io/integrations/builtin/credentials/nocodb/)
- [NocoDB Webhook Documentation](https://nocodb.com/docs/product-docs/webhooks)
- [NocoDB API v3 Documentation](https://nocodb.com/apis/v3/)