n8n Integration
Self-hosted workflow automation with fair-code license.
Setup
- Add HTTP Request node to workflow
- Configure authentication
- Set request parameters
Configuration
Authentication
Header AuthHeader Name
AuthorizationHeader Value
Bearer cvt_YOUR_API_KEYMethod
POSTURL
https://api.canvelete.com/api/v1/renderBody Content Type
JSONJSON/RAW Parameters
{
"designId": "YOUR_DESIGN_ID",
"format": "png",
"quality": 90,
"dynamicElements": {
"title": "={{ $json.title }}",
"subtitle": "={{ $json.subtitle }}"
}
}Use n8n's expression syntax (={{ $json.field }}) to reference trigger data.
Example: Webhook → Image
- Webhook node (trigger)
- HTTP Request node (Canvelete)
- Map fields:
={{ $json.body.productName }}→dynamicElements.product.text={{ $json.body.imageUrl }}→dynamicElements.image.src
Expression Syntax
n8n uses expressions to reference data:
| Expression | Description |
|---|---|
={{ $json.field }} | Current item field |
={{ $node["NodeName"].json.field }} | Specific node output |
={{ $now }} | Current timestamp |
={{ $today }} | Today's date |
={{ $workflow.id }} | Workflow ID |
Data Types
Handle different data types:
// String
"={{ $json.title }}"
// Number
={{ $json.quantity }}
// Boolean
={{ $json.isActive }}
// Array access
"={{ $json.items[0].name }}"
// Object access
"={{ $json.user.email }}"Common Workflows
Schedule → Database → Image
Trigger: Cron schedule
Action: Query database, generate report image
Email → Parse → Image
Trigger: Email received
Action: Parse content, generate visual summary
API → Transform → Image
Trigger: Webhook
Action: Transform data, generate branded asset
Error Handling
Configure error workflows:
- Continue On Fail – Skip errors and proceed
- Error Trigger – Activate separate workflow on error
- Retry On Fail – Automatic retry with backoff
- Ignore SSL Issues – For self-signed certificates
Advanced Features
Split In Batches
Process large datasets:
Split In Batches → HTTP Request → MergeIF Node
Conditional logic:
IF (price > 100) → Generate Premium Image
ELSE → Generate Standard ImageFunction Node
Custom JavaScript:
// Transform data before sending
const items = $input.all();
return items.map((item) => ({
json: {
designId: "abc123",
dynamicElements: {
title: { text: item.json.name.toUpperCase() },
},
},
}));Set Node
Prepare data structure:
Set values:
- designId: YOUR_DESIGN_ID
- format: png
- dynamicElements.title.text: ={{ $json.headline }}Accessing Image URL
After successful render:
={{ $json.data.imageUrl }}Use in subsequent nodes (email, S3 upload, database store).
Self-Hosted Advantages
- No rate limits from automation platform
- Full control over execution
- Custom integrations via Function nodes
- Data privacy – all data stays on your server
- Cost effective for high-volume workflows
Performance Optimization
Parallel Execution
Enable parallel processing:
Settings → Enable parallel executionCaching
Use Canvelete's cache:
{
"cache": true
}Queue Mode
For high-volume workflows, use n8n's queue mode with Redis.
Troubleshooting
Expression Errors
- Check syntax:
={{ }}brackets - Use Expression Editor for testing
- Validate JSON structure
Timeout Issues
- Increase timeout in HTTP Request node
- Use webhook for async rendering
- Split large batches into smaller chunks
Memory Issues
- Limit batch sizes in Split node
- Clear unnecessary data with Set node
- Use execution data pruning
Best Practices
- Use credentials instead of hardcoded API keys
- Enable error workflows for monitoring
- Test with small datasets before scaling
- Use Set nodes to clean up data
- Add Wait nodes to respect rate limits
- Document workflows with Sticky Notes
- Version control workflow JSON files
Docker Deployment
Run n8n with Docker:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8nEnvironment Variables
Configure n8n for Canvelete:
N8N_DEFAULT_WEBHOOK_URL=https://your-domain.com/webhook
N8N_WEBHOOK_URL=https://your-domain.com/webhook-testMonitoring
Monitor workflow execution:
- Execution logs – View in n8n UI
- Webhook triggers – Track incoming requests
- Error notifications – Email/Slack alerts
- Custom metrics – Export to monitoring tools