Workflow only shows error when activated

Describe the problem/error/question

The flow works perfectly when I test it.
But when it runs by itself, I always receive an error message from the Telegram node.
Although it sometimes manages to finish the tasks even though an error is triggered.

What is the error message (if any)?

Bad request - please check your parameters
400 - {“ok”:false,“error_code”:400,“description”:“Bad Request: message to delete not found”} - Bad Request: message to delete not found

It happens on the Telegram node called “Deleta senha antiga”, that deletes a previous message.

Please share your workflow

Share the output returned by the last node

NodeApiError: Bad request - please check your parameters
    at Object.apiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Telegram/GenericFunctions.js:107:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Telegram/Telegram.node.js:1723:36)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:706:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1058:20

Information on your n8n setup

  • n8n version: 1.27.2
  • Database: default (SQLite)
  • n8n EXECUTIONS_PROCESS setting: default (own, main)
  • Running n8n via: docker
  • Operating system:Ubuntu 22.04

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @gmsalomao2,

The error coming back from Telegram is saying the message you are trying to delete can’t be found. Is it possible that the ID being stored is incorrect or the chat id is wrong?

1 Like

The code is correct.
The message even gets deleted! But I receive an error message from my Error Handler workflow.

Every time I test the flow, it works fine.
It just throws an error message when executing automatically.

And for some reason the other Notion node doesn’t execute either, when running automatically. Maybe because an error happens, but I had created 2 paths just to make sure it would execute despite the error on the Telegram node. Very confusing.
image

Hey @gmsalomao2,

The node to delete is running 112 times, Is it possible that the message ID is appearing more than once in the 112 items?

I’ve changed the Notion automation to fix that. Now only 2 items go through the workflow.
But it was an unrelated problem.

Hey @gmsalomao2,

So now with the 2 items do you still see the same error and are the 2 IDs the same or different?

Yes, still the same error. Nothing changed.
There’s no second ID. Only one ID.
2 itens just mean that 2 pages were updated. But one of them always has an empty ID, while the other has the ID I need.

The second ID is stored only at the end of the workflow, after the previous ID has already been deleted from Notion.

Well… I gave up :confused:

Today I learned there’s no way to delete a Telegram message after 48h by using the API.
So my deletion node becomes useless anyways.

I hope I’ve provided enough information to debug the issue. I’ve tried with 2 different n8n installations, so I think it is indeed a bug.

2 Likes

Hey @gmsalomao2,

Where do you believe the bug to be? If you have 2 items going into the Telegram node and one contains the ID and one doesn’t the one that doesn’t have it will cause an error so it could have been worth checking to make sure that only the input item with the id is sent to the Telegram node.

I will do some digging and see if I can cobble together something similar to your workflow and see if anything jumps out.

Hey @Jon ,

Good call on the empty ID! Turns out you were right.

While testing the flow, I only saw one item captured by the “Fetch test event”. This limited view made me think the data filtering was working as intended, but…well, not quite.

After some tinkering, I’ve updated the workflow and it’s now working.
But now I wonder if there’s a way of testing the flow with real data, instead of receiving only one result.

You could try using a manual trigger node attached to a normal notion node and get a bunch in one go for testing. Another thing you could do is under the settings for the nodes they have an option to continue on error it may be worth moving the Notion change to after the Telegram node and using the error output from telegram to notify if you need to manually do something.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.