{
  "name": "ZapZap: send reminders one by one with a pause",
  "nodes": [
    {
      "parameters": {
        "content": "Sends a list of reminders one at a time, 5 seconds apart (the HTTP Request node batching option). Edit the list in the Code node. Use it only for people who agreed to receive them. Open the Config node and fill instanceId, apiKey and apiSecret (dashboard: Settings and API). ",
        "width": 460,
        "height": 250
      },
      "id": "n1",
      "name": "Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -260,
        -140
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 10
            }
          ]
        }
      },
      "id": "n2",
      "name": "Every day 10:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        100
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "n3",
              "name": "baseUrl",
              "value": "https://api.zapzapapi.com/api/v1",
              "type": "string"
            },
            {
              "id": "n4",
              "name": "instanceId",
              "value": "YOUR_INSTANCE_ID",
              "type": "string"
            },
            {
              "id": "n5",
              "name": "apiKey",
              "value": "YOUR_API_KEY",
              "type": "string"
            },
            {
              "id": "n6",
              "name": "apiSecret",
              "value": "YOUR_API_SECRET",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "id": "n7",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        100
      ]
    },
    {
      "parameters": {
        "jsCode": "return [\n  { json: { number: '5511999999999', text: 'Reminder: your appointment is tomorrow.' } },\n  { json: { number: '5511888888888', text: 'Reminder: your invoice is due this week.' } },\n];"
      },
      "id": "n8",
      "name": "Reminder list",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        100
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $(\"Config\").first().json.baseUrl }}/{{ $(\"Config\").first().json.instanceId }}/send/text",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $(\"Config\").first().json.apiKey }}"
            },
            {
              "name": "x-api-secret",
              "value": "={{ $(\"Config\").first().json.apiSecret }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ number: $json.number, text: $json.text }) }}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 1,
              "batchInterval": 5000
            }
          }
        }
      },
      "id": "n9",
      "name": "Send one by one",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        100
      ]
    }
  ],
  "connections": {
    "Every day 10:00": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Reminder list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reminder list": {
      "main": [
        [
          {
            "node": "Send one by one",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
