تذكيرات متصاعدة للفواتير غير المدفوعة تتوقف عند الدفع
تذكيرات متصاعدة للفواتير المتأخرة (اليوم 1 و15 و30) تتوقف لحظة الدفع.
الخطوات
- Schedule Trigger يوميًا الساعة 09:00.
- عقدة Config: مفتاح KV لقائمة الفواتير، ومراحل التذكير [1,15,30] يوم تأخير.
- يقرأ قائمة الفواتير (JSON) من KV.
- عقدة Code تتجاهل المدفوعة، وتنقل المتأخرة إلى المرحلة التالية (Friendly ← Second notice ← Final notice) مرة يوميًا كحد أقصى.
- يحفظ المرحلة الجديدة في KV.
- تنبيه ntfy بمن تذكّره اليوم مع عنوان جاهز، والفواتير التي دُفعت وتوقفت.
ما الذي جرّبناه
✓ مجرّبة بالكامل بتاريخ 2026-10-16، على خدمات حقيقية في n8n 1.70.3. تفاصيل الاختبار (بالإنجليزية):
Ran on local n8n 1.70.3 with 5 test invoices in real Cloudflare KV: 1, 16 and 31 days overdue got Friendly, Second and Final notice; the paid invoice was stopped; the not-yet-due invoice was skipped. Stages were written back to KV (read back and verified), and a real ntfy push arrived. A second run the same day sent nothing. Not included / untested: emailing the client automatically – you send the drafted reminder (a Gmail/SMTP swap needs an account and was not tested).
التكلفة الشهرية
مجانية مع n8n المستضاف ذاتيًا (أنت تشغّل الخادم)، أو من 20 يورو شهريًا مع n8n Cloud Starter بالدفع السنوي. n8n.io/pricing/
Free on self-hosted n8n (you run the server); €20/mo on n8n Cloud Starter, billed annually
الإعداد
تفاصيل الإعداد بالإنجليزية لأنها تطابق أسماء الحقول والعقد داخل الأداة. للبدء من الصفر اقرأ دليل n8n من الصفر.
You will need
- n8n (self-hosted Community Edition is free; n8n Cloud from €20/mo)
- Free ntfy app – no account needed
- A free Cloudflare account with a KV namespace
Credentials
- Cloudflare API token with Account → Workers KV Storage → Edit (free Cloudflare account)
- In n8n: Credentials → New → Header Auth, Name: Authorization, Value: Bearer YOUR_TOKEN
Configure
- Create a KV key 'unpaid-invoices.json': [{"number":"INV-201","client":"Name","email":"x@y.com","amount":"SAR 1,150","dueDate":"2026-10-15","status":"unpaid"}]
- When paid, set status to paid – reminders stop.
- Config: cfAccountId, kvNamespaceId, invoicesKey, stageDays, yourName, ntfyTopic.
Test
- Add an invoice due yesterday and click Test workflow: you get 'Send 1 invoice reminder(s)' with 'Friendly reminder'.
- Click Test again: nothing (already reminded today).
- Set status to paid: listed as stopped.
Common errors
- Dates must be YYYY-MM-DD.
- An invoice jumped straight to Final notice: it was already 30+ days overdue on its first check (intended).
- KV step returns 401/403: the token lacks Workers KV Storage Edit, or the Header Auth value is missing the word 'Bearer '.
- 'key missing or not JSON': create the key in Cloudflare → Workers & Pages → KV → your namespace → Add entry, with a JSON array as the value.
- Nothing arrives in ntfy: the topic in Config must match the one you subscribed to exactly (case-sensitive).
- Never runs on its own: toggle the workflow Active – the manual trigger only runs when you click Test workflow.