Integrations
n8n

n8nn8n Integration

Self-hosted workflow automation with fair-code license.

Setup

  1. Add HTTP Request node to workflow
  2. Configure authentication
  3. Set request parameters

Configuration

Authentication

Header Auth

Header Name

Authorization

Header Value

Bearer cvt_YOUR_API_KEY

Method

POST

URL

https://api.canvelete.com/api/v1/render

Body Content Type

JSON

JSON/RAW Parameters

{
  "designId": "YOUR_DESIGN_ID",
  "format": "png",
  "quality": 90,
  "dynamicElements": {
    "title": "={{ $json.title }}",
    "subtitle": "={{ $json.subtitle }}"
  }
}

Example: Webhook → Image

  1. Webhook node (trigger)
  2. HTTP Request node (Canvelete)
  3. Map fields:
    • ={{ $json.body.productName }} → dynamicElements.product.text
    • ={{ $json.body.imageUrl }} → dynamicElements.image.src

Expression Syntax

n8n uses expressions to reference data:

ExpressionDescription
={{ $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:

  1. Continue On Fail – Skip errors and proceed
  2. Error Trigger – Activate separate workflow on error
  3. Retry On Fail – Automatic retry with backoff
  4. Ignore SSL Issues – For self-signed certificates

Advanced Features

Split In Batches

Process large datasets:

Split In Batches → HTTP Request → Merge

IF Node

Conditional logic:

IF (price > 100) → Generate Premium Image
ELSE → Generate Standard Image

Function 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

  1. No rate limits from automation platform
  2. Full control over execution
  3. Custom integrations via Function nodes
  4. Data privacy – all data stays on your server
  5. Cost effective for high-volume workflows

Performance Optimization

Parallel Execution

Enable parallel processing:

Settings → Enable parallel execution

Caching

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

  1. Use credentials instead of hardcoded API keys
  2. Enable error workflows for monitoring
  3. Test with small datasets before scaling
  4. Use Set nodes to clean up data
  5. Add Wait nodes to respect rate limits
  6. Document workflows with Sticky Notes
  7. 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/n8n

Environment Variables

Configure n8n for Canvelete:

N8N_DEFAULT_WEBHOOK_URL=https://your-domain.com/webhook
N8N_WEBHOOK_URL=https://your-domain.com/webhook-test

Monitoring

Monitor workflow execution:

  1. Execution logs – View in n8n UI
  2. Webhook triggers – Track incoming requests
  3. Error notifications – Email/Slack alerts
  4. Custom metrics – Export to monitoring tools