Skip to content

n8n Integration

With n8n you can automatically process upcoming pickup dates – for example for push notifications, Slack or Matrix messages, smart home actions or custom workflows. The integration works via müll.io's webhook mechanism: müll.io sends a daily HTTP POST to your n8n workflow at 6:00 PM when a pickup is due in the configured number of days.


1. Create API key

To create webhooks, you first need an API key.

Get free API key


2. Create Webhook Trigger in n8n

Add a Webhook trigger node as the first node in your n8n workflow:

Activate the workflow (toggle "Active" in the top right) so n8n provides the incoming URL. The full webhook URL is:

https://<deine-n8n-instanz>/webhook/muell-abfuhr

3. Register webhook with müll.io

Register the n8n webhook URL via the müll.io API:

curl -X POST https://müll.io/api/webhook \
  -H "Authorization: API-KEY <dein-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://<deine-n8n-instanz>/webhook/muell-abfuhr",
    "daysBeforeCollection": 1,
    "street": "Musterstraße",
    "houseNumber": "1a",
    "zip": "12345",
    "city": "Musterstadt",
    "country": "DE"
  }'

The response contains a secret that you need for optional signature verification.


4. Process payload

When a pickup is due, müll.io sends a POST with the following body to your n8n webhook:

{
  "event": "upcoming_collection",
  "sent_at": "2024-01-14T18:00:00+00:00",
  "days_until": 1,
  "address": {
    "street": "Musterstraße",
    "houseNumber": "1a",
    "zip": "12345",
    "city": "Musterstadt",
    "country": "DE"
  },
  "collections": [
    { "type": "Restmüll", "date": "2024-01-15" },
    { "type": "Papier",   "date": "2024-01-15" }
  ]
}

In n8n, the fields are directly available via the webhook node. Connect any action nodes afterwards – such as Send Email, Slack, Telegram, ntfy or an HTTP Request node for custom systems.


5. Optional: Signature verification

Each incoming request contains the header X-Muell-Signature: sha256=<hmac>. To ensure the request actually comes from müll.io, you can add a Code node before your actions in n8n to check the signature:

const crypto = require('crypto');
const secret = '<dein-webhook-secret>';
const body = JSON.stringify($input.first().json);
const sig = $input.first().headers['x-muell-signature'];
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex');
if (sig !== expected) throw new Error('Invalid signature');
return $input.all();

More details on the complete webhook API can be found in the webhook integration documentation. Webhook-Integrationsdokumentation.


← Integration overview  ·  Full API documentation (opens in new tab)