Skip to content

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.

n8n is included in the ecosystem Docker Compose:

Terminal window
./scripts/start-ecosystem.sh -d
# n8n starts at http://localhost:5678

Default credentials: admin / printstudio (change via N8N_USER / N8N_PASSWORD in .env).

  1. Open n8n at http://localhost:5678
  2. Go to Workflows → Import from file
  3. Select any JSON file from n8n/workflows/
  4. Activate the workflow

Or use the n8n CLI:

Terminal window
# Import all PrintStudio workflows
for 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"
done
WorkflowTriggerAction
Order Confirmationorder.paid webhookSend customer confirmation email
Print Startedorder.printing webhookNotify customer via email
Order Shippedorder.shipped webhookSend tracking number email + SMS
Low Inventory Alertinventory.low webhookEmail operator + create Slack message
Print Failure Escalationjob.failed (3rd retry)Page operator via OpenClaw
Daily Production ReportDaily cron (8am)Slack/email summary of previous day
Weekly Revenue ReportWeekly cron (Monday 9am)Email revenue + SLA summary
New Customer Welcomecustomer.created webhookWelcome email + onboarding sequence
Reorder Requestinventory.low webhookCreate purchase request in InvenTree
SLA Breach AlertEvery 15 minCheck overdue jobs, alert operator

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.

Terminal window
N8N_URL=http://localhost:5678
N8N_API_KEY=your-n8n-api-key # generate in n8n Settings → API

PrintStudio sends events to n8n via webhook triggers. Register the n8n webhook URL in PrintStudio:

Terminal window
# The n8n webhook URL follows this pattern:
# http://localhost:5678/webhook/{workflow-id}
# Register it as a PrintStudio webhook endpoint
curl -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"
}'

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.

n8n data is stored in the n8n-data Docker volume. Workflows, credentials, and execution history persist across container restarts.

To back up your workflows:

Terminal window
docker exec printstudio-n8n n8n export:workflow --all --output=/data/workflows-backup.json
docker cp printstudio-n8n:/data/workflows-backup.json ./n8n/backup/