Skip to content

n8n Integration

Self-hosted workflow automation with full control over your data.

Overview

n8n is an open-source, self-hostable automation tool. Keep photo data on your infrastructure while automating workflows with 200+ integrations.

Prerequisites

  • Visiono account with API access
  • n8n instance (self-hosted or cloud)
  • API Key from Visiono

Why n8n?

FeatureBenefit
Self-hostedFull data control
Open sourceInspect and modify code
No execution limitsUnlimited workflows
Custom nodesBuild integrations
Fair-code licenseFree for most uses

Setup Steps

1. Create Webhook Node

  1. Open n8n workflow editor
  2. Add Webhook node
  3. Set method: POST
  4. Copy the webhook URL (Production or Test)

2. Configure in Visiono

  1. Go to Workspace SettingsWebhooks
  2. Click Add Webhook
  3. Paste n8n webhook URL
  4. Select events to trigger
  5. Save configuration

3. Test the Connection

  1. In n8n, click Listen for Test Event
  2. Submit a test photo in Visiono
  3. n8n displays received data
  4. Click Stop Listening

4. Build Your Workflow

Add nodes to process data:

[Webhook] → [IF] → [HTTP Request] → [Email]
                 ↘ [Slack]

Workflow Examples

Photo Backup Workflow

Save photos to local storage or S3:

json
{
  "nodes": [
    {
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "parameters": {
        "path": "visiono-photos",
        "httpMethod": "POST"
      }
    },
    {
      "name": "Loop Photos",
      "type": "n8n-nodes-base.splitInBatches",
      "parameters": {
        "batchSize": 1
      }
    },
    {
      "name": "Download Photo",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "={{$json.url}}",
        "responseFormat": "file"
      }
    },
    {
      "name": "Save to S3",
      "type": "n8n-nodes-base.awsS3",
      "parameters": {
        "operation": "upload",
        "bucketName": "visiono-backups",
        "fileName": "={{$json.slot_name}}.jpg"
      }
    }
  ]
}

Notification Workflow

Alert team on new submissions:

Nodes:

  1. Webhook - Receive Visiono event
  2. Set - Format message data
  3. Slack - Send to channel
  4. Email - Send summary

Database Logging

Record submissions to PostgreSQL:

Nodes:

  1. Webhook - Receive event
  2. Postgres - Insert record
  3. IF - Check photo count
  4. HTTP Request - Call external API

Node Configuration

Webhook Node

yaml
HTTP Method: POST
Path: visiono-webhook
Response Mode: On Received
Response Data: Success

HTTP Request Node

For downloading photos:

yaml
Method: GET
URL: ={{ $json.data.photos[0].url }}
Response Format: File

IF Node

Conditional routing:

yaml
Condition: Number
Value 1: ={{ $json.data.photos.length }}
Operation: Larger
Value 2: 5

Data Reference

Access webhook data in expressions:

ExpressionData
{{ $json.event }}Event type
{{ $json.data.smart_link.name }}Permanent Link name
{{ $json.data.photos[0].url }}First photo URL
{{ $json.data.photos.length }}Photo count
{{ $json.data.metadata.full_name }}Submitter name
{{ $json.data.metadata.unique_field }}Identifier

Loops and Iteration

Process All Photos

Use Split In Batches node:

  1. Add after Webhook
  2. Set items: {{ $json.data.photos }}
  3. Batch size: 1
  4. Connect processing nodes
  5. Add Merge at end

Aggregate Results

Collect processed data:

  1. Code node for aggregation
  2. Store in workflow static data
  3. Output combined results

Error Handling

Retry on Failure

Configure per-node:

  • Continue on Fail: Process next item
  • Retry on Fail: Attempt again
  • Max Retries: 3

Error Trigger

Catch and handle errors:

  1. Add Error Trigger node
  2. Connect to notification node
  3. Log or alert on failures

Self-Hosting Tips

Docker Deployment

yaml
version: "3"
services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=secure-password
      - WEBHOOK_URL=https://n8n.yourdomain.com/
    volumes:
      - n8n_data:/home/node/.n8n

Webhook URL

For production webhooks:

  • Use production URL (not test)
  • Configure WEBHOOK_URL environment variable
  • Use HTTPS with valid certificate

Security

  • Enable authentication
  • Use HTTPS
  • Restrict network access
  • Regular backups

Advanced Features

Custom Code

Use Code node for JavaScript:

javascript
const photos = items[0].json.data.photos;
const processed = photos.map(photo => ({
  url: photo.url,
  name: photo.slot_name,
  downloaded: new Date().toISOString()
}));
return [{ json: { photos: processed } }];

Credentials

Store API keys securely:

  1. Go to Credentials
  2. Add new credential
  3. Reference in nodes

Sub-Workflows

Modularize workflows:

  1. Create reusable workflow
  2. Call via Execute Workflow node
  3. Pass data between workflows

Troubleshooting

Webhook Not Receiving

  1. Check n8n is running
  2. Verify URL includes port if needed
  3. Check firewall allows traffic
  4. Test with curl

Expression Errors

  1. Verify data structure
  2. Check property paths
  3. Use optional chaining: $json.data?.photos

Execution Issues

  1. Check execution log
  2. Review node outputs
  3. Test individual nodes
  4. Verify credentials

Performance Optimization

Batch Processing

  • Group similar operations
  • Use bulk API calls
  • Limit concurrent executions

Resource Management

  • Monitor memory usage
  • Limit workflow executions
  • Archive old data

Professional Photo Documentation Platform