Telegram but not recalling memory from Supabase

Describe the problem/error/question

Bob was working perfectly, but then I did not use the bot for some time and then the. Supabase became in active, when I reactivated again, it didn’t reactive correct so I deleted the old database and thats when the problem started happening.

What is the error message (if any)?

The memory is being stored but not being recalled.

I can see the question that I’ve prompted in the Supabase and the output said it will remember.

For example:

Input: Fav color is blue.
Output : OK I will remember your favorite color is blue.

Then immediately does not recall it and when I asked what my favorite color is in the very next TG prompt

Please share your workflow

Information on your n8n setup

  • n8n version: Latest
  • Database (default: SQLite): Supabase
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n on vps installed via snap

Thanks for sharing your workflow! Could you possibly record a video of your test happening too so I can get more insight into it?

Hi @Trying2Ai, welcome!

The fields you’re using with expressions have extra spaces, which can sometimes cause issues,

For example: the Prompt (User Message) field contains one,

Also, it should be {{ $json.message.text }}

Here’s a fixed version that I tested on my end:

1 Like

@mohamed3nan

Well my friend, you’re much smarter than chatgpt, and I was trying to make it work and it kept telling me do things like adding and removing things immediately that it just told me to add.

Was everything correct, but then it just did not work because of the extra space.

To be honest, before when it was still working, Chatgpt made me put a = before the Telegram ID, so it was =123456789 for example (when the supabase was originally working)

Then after it stop working and then I deleted the table, chatgpt made me modify the TG id to just 123456789 (without the =)

Then Supabase created two database and then it turned into a big mess.

Who I made this post. I merged the two database and deleted one of them.

Now things are working and I have clear the history of the working DB to start over, hopefully future n8n updates doesn’t break it..

I cleared it because after copy and pasting your work code. It was working but it drew on previous memory… like the below.

Anyways, after clearing it, it seems to be working for now. I appreciate your help!

Does having an extra space really stop it from working?

1 Like

@mohamed3nan I need a bit of help.

I gave it some info to remember and it is having issues reading the format, which is just emails and phone numbers with + code.

In my last version before I posted you help, I was and to paste info the TG bot and It was able to recall it. Now it is struggling to recall phone number with the country code + symbol and email.

For example I tell it to remember mohamed inc. +17585465123 [email protected] it is only able to recall the company name and the rest fails.

** I actually see the correct into in the output section then when it tries to actually give the info to TG, it fails with the below info**

The question that I have crossed out in blue is where the correct information is and on the right side is where it fails.

Output

1 item

Bad request - please check your parameters

Bad Request: can’t parse entities: Can’t find end of the entity starting at byte offset 1263

Error details

From Telegram

Error code

400

Full message

{ "ok": false, "error_code": 400, "description": "Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 1263" }

Other info

Node type

n8n-nodes-base.telegram

Node version

1.2 (Latest)

n8n version

2.2.6 (Self Hosted)

Time

1/19/2026, 7:10:07 PM

Stack trace

NodeApiError: Bad request - please check your parameters at ExecuteContext.apiRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Telegram/GenericFunctions.ts:230:9) at processTicksAndRejections (node:internal/process/task_queues:105:5) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Telegram/Telegram.node.ts:2198:21) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2297:11

Problem in node ‘Send reply to Sam‘

Bad request - please check your parameters


Actually I’m not sure what the issue is because. When I tried it with a test listing just now it worked, but on my bulk data instruction to the bot it didn’t.

Above is the bulk data imported to the bot.

I don’t want to list the bulk data here.

Below is the test summary

Hi @Trying2Ai, sry i just notice your mention!

Can you try changing the Parse Mode to HTML?

Strange, it also did not notify me of your reply.

I suppose your screenshot is from the TG output?

It now looks like:

By the way, something terrible happened.

After he was working, I made one simple amendment which is the append n8n attribution in the TG output (to remove the sent by n8n text in the reply msg) and now the bot has gone brainless, it is now again not recalling anything.

I try to switch it back but it also did not work (append n8n attribution I switched on and off.

My current flow

{
“nodes”: [
{
“parameters”: {
“chatId”: “1414559473”,
“text”: “={{ $node["Skynet"].json.output }}\n”,
“additionalFields”: {
“appendAttribution”: false,
“parse_mode”: “HTML”
}
},
“type”: “n8n-nodes-base.telegram”,
“typeVersion”: 1.2,
“position”: [
-192,
-240
],
“id”: “b74550a9-a7d5-4059-854b-652ffbef4e70”,
“name”: “Send reply to Sam”,
“webhookId”: “97f6f3e1-051b-40bb-a004-562ae930df96”,
“credentials”: {
“telegramApi”: {
“id”: “A3K059LClqeh1HI4”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“updates”: [
“message”
],
“additionalFields”: {}
},
“type”: “n8n-nodes-base.telegramTrigger”,
“typeVersion”: 1.2,
“position”: [
-1024,
-224
],
“id”: “39189d2f-d9f4-4e92-b495-05da80465443”,
“name”: “Msg from Sam”,
“webhookId”: “8032114d-ae93-44cd-8c14-8943f0e920c7”,
“credentials”: {
“telegramApi”: {
“id”: “A3K059LClqeh1HI4”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “=={{ $json.message.chat.id.toString() }}\n”,
“contextWindowLength”: 50000
},
“type”: “@n8n/n8n-nodes-langchain.memoryPostgresChat”,
“typeVersion”: 1.3,
“position”: [
-416,
-32
],
“id”: “c007be3e-8aa1-4fd4-abc6-a287e966150e”,
“name”: “Postgres Chat Memory”,
“credentials”: {
“postgres”: {
“id”: “GrbwOyRtZfuJh4iF”,
“name”: “Postgres account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “loose”,
“version”: 3
},
“conditions”: [
{
“id”: “ffeb2252-c637-414e-ab78-3cd2a5463e8e”,
“leftValue”: “={{ Number($json.message.from.id) }}\n”,
“rightValue”: 1414559473,
“operator”: {
“type”: “number”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“looseTypeValidation”: true,
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
-832,
-224
],
“id”: “994287ac-9242-4cf5-b6a9-97782ce363d9”,
“name”: “If”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
-512,
-32
],
“id”: “e185f134-e803-418d-8a44-99a22b43810c”,
“name”: “Google Gemini Chat Model”,
“credentials”: {
“googlePalmApi”: {
“id”: “pDGgW7JgpO3Qrjc0”,
“name”: “Google Gemini(PaLM) Api account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.chatInput }}\n”,
“options”: {
“systemMessage”: “You are a stateful assistant.\n\nYou MUST treat the provided chat history as factual memory about the user.\n\nIf the user asks about:\n- preferences\n- facts about themselves\n- things they previously stated\n\nYou MUST search the chat history and answer from it.\n\nIf the answer exists in memory, you are NOT allowed to say:\n"I don’t know", "you haven’t told me", or similar.\n\nOnly say you don’t know if the information is truly absent from memory.\n”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
-512,
-240
],
“id”: “e6553d20-92be-48b5-a3b4-ec09019e2c48”,
“name”: “Skynet”
}
],
“connections”: {
“Msg from Sam”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
},
“Postgres Chat Memory”: {
“ai_memory”: [
[
{
“node”: “Skynet”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
[
{
“node”: “Skynet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “Skynet”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Skynet”: {
“main”: [
[
{
“node”: “Send reply to Sam”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “296e6cc8a58e3c74d3b02e577223b5a9443313a173504ed35f8cc3e9a8d2b550”
}
}

@mohamed3nan tagging you for an update.

yes, just use {{ $json.output }}

your secreenshot shows that there is an extra space here:

@mohamed3nan

I fixed the space (n8n should really delete extra spaces automatically if it does more harm than nothing]

Anyways, it didn’t fix the memory issue, Like I mentioned above, I only adjusted the append n8n attribution in the TG output (to remove the sent by n8n text in the reply msg) and now the bot has gone brainless, it is now again not recalling anything.

sry i cant follow at this point,
this workflow is suppose to work without issues:

Well, the option was always going for me to delete the workflow and then copy and paste it again, which I did and is working again.

I just wanted to see if I can figure out what was happening so I can avoid it in the future.

Thanks for your help @mohamed3nan

1 Like