n8n Workflows
n8n is a self-hosted workflow automation platform. PrintStudio ships with 10 pre-built workflow JSON files in n8n/workflows/ that you can import directly.
Starting n8n
Section titled “Starting n8n”n8n is included in the ecosystem Docker Compose:
./scripts/start-ecosystem.sh -d# n8n starts at http://localhost:5678Default credentials: admin / printstudio (change via N8N_USER / N8N_PASSWORD in .env).
Importing Workflows
Section titled “Importing Workflows”- Open n8n at
http://localhost:5678 - Go to Workflows → Import from file
- Select any JSON file from
n8n/workflows/ - Activate the workflow
Or use the n8n CLI:
# Import all PrintStudio workflowsfor f in n8n/workflows/*.json; do curl -X POST http://localhost:5678/api/v1/workflows \ -H "Content-Type: application/json" \ -H "X-N8N-API-KEY: $N8N_API_KEY" \ -d @"$f"doneIncluded Workflows
Section titled “Included Workflows”| Workflow | Trigger | Action |
|---|---|---|
| Order Confirmation | order.paid webhook | Send customer confirmation email |
| Print Started | order.printing webhook | Notify customer via email |
| Order Shipped | order.shipped webhook | Send tracking number email + SMS |
| Low Inventory Alert | inventory.low webhook | Email operator + create Slack message |
| Print Failure Escalation | job.failed (3rd retry) | Page operator via OpenClaw |
| Daily Production Report | Daily cron (8am) | Slack/email summary of previous day |
| Weekly Revenue Report | Weekly cron (Monday 9am) | Email revenue + SLA summary |
| New Customer Welcome | customer.created webhook | Welcome email + onboarding sequence |
| Reorder Request | inventory.low webhook | Create purchase request in InvenTree |
| SLA Breach Alert | Every 15 min | Check overdue jobs, alert operator |
Configuration
Section titled “Configuration”After importing, update credential nodes with your specific values:
PrintStudio API — base URL and API key for the HTTP Request nodes
Email (SMTP or Resend) — your mail provider credentials
Slack — webhook URL or bot token (optional)
Generate a PrintStudio API key for n8n under Dashboard → Settings → API Keys. Use the operator role.
N8N_URL=http://localhost:5678N8N_API_KEY=your-n8n-api-key # generate in n8n Settings → APIWebhook Configuration
Section titled “Webhook Configuration”PrintStudio sends events to n8n via webhook triggers. Register the n8n webhook URL in PrintStudio:
# The n8n webhook URL follows this pattern:# http://localhost:5678/webhook/{workflow-id}
# Register it as a PrintStudio webhook endpointcurl -X POST http://localhost:8787/api/webhooks/endpoints \ -H "Content-Type: application/json" \ -H "X-API-Key: your-api-key" \ -d '{ "url": "http://localhost:5678/webhook/order-events", "events": ["order.created", "order.paid", "order.shipped"], "secret": "your-shared-secret" }'Creating Custom Workflows
Section titled “Creating Custom Workflows”n8n’s visual editor makes it straightforward to add new automations. Common patterns:
HTTP Request → PrintStudio API — use the HTTP Request node with base URL http://print-ops-api:8787 (Docker internal hostname) and X-API-Key header.
Webhook trigger — add a Webhook node as the trigger, then register its URL in PrintStudio’s webhook endpoints.
Error handling — add an Error Trigger workflow to catch failures and notify via Slack or email.
Persistence
Section titled “Persistence”n8n data is stored in the n8n-data Docker volume. Workflows, credentials, and execution history persist across container restarts.
To back up your workflows:
docker exec printstudio-n8n n8n export:workflow --all --output=/data/workflows-backup.jsondocker cp printstudio-n8n:/data/workflows-backup.json ./n8n/backup/