{
  "name": "DzRouter · 04 · Alerte solde bas (Telegram)",
  "nodes": [
    {
      "id": "38564d78-5187-5cd2-a16c-b67ba1fbdf9c",
      "name": "Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        -260
      ],
      "parameters": {
        "content": "## Alerte solde bas\n\n1. Installez le nœud communautaire **n8n-nodes-dzrouter** (Paramètres → Community nodes).\n2. Ouvrez chaque nœud DzRouter et choisissez votre identifiant **DzRouter API** (clé `sk-dz-…`).\n3. Cliquez **Test workflow** : un exemple algérien est déjà chargé.\n\nPuis : créez un bot avec **@BotFather**, ajoutez l'identifiant Telegram, mettez votre *chat id* et **activez** le nœud Telegram (désactivé par défaut).\n\n---\n\n<div dir=\"rtl\">\n\n### تنبيه الرصيد\n\n1. ثبّت العقدة **n8n-nodes-dzrouter** (الإعدادات ← Community nodes).\n2. افتح كل عقدة DzRouter واختر بيانات اعتماد **DzRouter API** (مفتاح `sk-dz-…`).\n3. اضغط **Test workflow**: مثال جزائري جاهز للتجربة.\n\n</div>\n\n---\n\n### Low balance alert\n\n1. Install the **n8n-nodes-dzrouter** community node (Settings → Community nodes).\n2. Open each DzRouter node and pick your **DzRouter API** credential (`sk-dz-…` key).\n3. Click **Test workflow**: an Algerian sample is already loaded.",
        "height": 600,
        "width": 440,
        "color": 4
      }
    },
    {
      "id": "a5a0c3d0-2ff6-565d-b917-59583eb1e177",
      "name": "Every morning",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 9
            }
          ]
        }
      }
    },
    {
      "id": "11988dca-090a-5895-8f44-069d2055b9b3",
      "name": "Balance",
      "type": "n8n-nodes-dzrouter.dzRouter",
      "typeVersion": 1,
      "position": [
        260,
        0
      ],
      "parameters": {
        "resource": "account",
        "operation": "getBalance"
      }
    },
    {
      "id": "146b3295-e633-55e7-ae78-0504bb91d166",
      "name": "Below 500 Pulses?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "low",
              "leftValue": "={{ $json.balancePulses }}",
              "rightValue": 500,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      }
    },
    {
      "id": "63dc2b46-571e-5cc4-ae51-9102c5cd3214",
      "name": "Telegram alert",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        780,
        0
      ],
      "parameters": {
        "resource": "message",
        "operation": "sendMessage",
        "chatId": "VOTRE_CHAT_ID",
        "text": "=⚠️ Solde DzRouter bas : {{ $json.balancePulses }} Pulses ({{ $json.balancePulses }} DA). Rechargez sur https://dzrouter.com/app/#/billing",
        "additionalFields": {}
      },
      "disabled": true
    }
  ],
  "connections": {
    "Every morning": {
      "main": [
        [
          {
            "node": "Balance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Balance": {
      "main": [
        [
          {
            "node": "Below 500 Pulses?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Below 500 Pulses?": {
      "main": [
        [
          {
            "node": "Telegram alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "templateId": "dzrouter"
  }
}
