Module 12 · ship · advanced
Exercises 12 · Self-hosting and Client Delivery
Exercise 1: Alert only on state changes
Task: Wire Send Alert to Telegram/Slack/email, but alert only when a site goes down or comes back, not every 5 minutes while it stays down.
Done when: stopping a test site gives one "DOWN" alert, and starting it again gives one "RECOVERED" alert.
Hint
Remember the last state between executions with $getWorkflowStaticData('global') in a Code node (it persists for production executions).
Exercise 2: Restore drill
Task: Restore a backup archive into a fresh local stack and confirm your workflows are there.
Done when: a throwaway stack started from the backup shows the same workflows and credentials decrypt.
Hint
Same .env (especially N8N_ENCRYPTION_KEY), start only postgres, pipe the dump into psql, then start n8n.
Exercise 3: Protect your webhooks
Task: Require a secret header on /webhook/ops/health so only your monitor can call it.
Done when: calls without the header get 403; calls with it work.
Hint
Webhook node → Authentication → Header Auth, with a credential holding the header name and secret.