Telegram limit

Hi guys.
I have made a workflow which collects 50 latest tweets by # and send them to my telegram channel every hour. but there is a problem here :
twitter node gets 50 tweets without problem but telegram can’t send more than 20 of them & 30 tweets don’t send. this is telegram bot limit.
error is this :
ERROR: The service is receiving too many requests from you! Perhaps take a break?
Too Many Requests: retry after 37
“message”: “Request failed with status code 429”,

so how to send items to telegram in pack of 20, wait some time and make a queue for the rest of items.

thanks.

Information on your n8n setup

  • n8n version: latest
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker

Hey @rhodesgod, I hope you are well?

You can use the Split In Batches node combined with the Wait node to achieve the desired behavior of sending a limited number of messages in a given time. The loop should look like so:

image

Example Workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "name": "SplitInBatches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "additionalFields": {}
      },
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "amount": 60,
        "unit": "seconds"
      },
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "webhookId": "b0b6977c-9189-47ff-8df2-123425325e3c"
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitInBatches": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

I haven’t tested this first-hand yet, but if you run into any trouble implementing this please do give me a shout and I’ll give it a go.

3 Likes

Thank you.
its working.

1 Like