Skip to content
My Slack bot is stu...
 
Notifications
Clear all

My Slack bot is stuck in a reply loop, repeating up to 20 times per minute

2 Posts
2 Users
0 Reactions
3 Views
James_Bellis
(@james_bellis)
Posts: 1
New Member
Topic starter
 

I've developed a Slack AI bot workflow using callin.io, designed to function as an assistant for managing tasks, calendar, and communications. It performs well in test mode. However, when deployed in production mode, I'm encountering an issue where the bot enters a continuous reply loop, even without any new input from a human user.

What I've attempted:

  • I incorporated an IF node to verify if the message originates from the bot's own user ID and to block it.
  • I experimented with expressions like {{$json["event"]["bot_id"]}}, {{$json["user"]}}, and even examined the complete incoming payload, but I consistently receive undefined, or the comparison fails.
  • I've also tried filtering based on the user ID from the Slack Trigger, and confirmed the bot's bot_id is accurate (B08V6SCDG56), yet the IF node expression either fails or does not block as intended.
  • The bot repeatedly posts the same "How can I help you?" message, often 5–10 times without any prompt.

What is the error message (if any)?

There is no specific error message—the workflow exhibits incorrect behavior: it loops and continues replying repeatedly, rendering it unusable in production.

Information on your callin.io setup

n8n version: (cloud latest, May 2025)
Database: Default (SQLite)
Execution mode:** Default (own)
Running callin.io via: callin.io Cloud
Operating system: Windows 10 (for setup/testing)

{
“nodes”: [
{
“parameters”: {
“trigger”: [
“message”
],
“channelId”: {
rl”: true,
“value”: “C08V7112VEC”,
“mode”: “list”,
“cachedResultName”: “assistant-chatbot”
},
“options”: {}
},
“type”: “n8n-nodes-base.slackTrigger”,
“typeVersion”: 1,
“position”: [
-500,
480
],
“id”: “6aeb7059-c048-49f1-9ceb-8005f18d9f83”,
“name”: “Slack Trigger”,
“webhookId”: “15aca322-2d67-4b52-95ca-4b2e249a68de”,
“credentials”: {
“slackApi”: {
“id”: “xreszx1ggPRXMWna”,
“name”: “Slack account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “0acf8188-6280-4533-8571-a54531ae67e6”,
“leftValue”: “={{$json["files"]["0"]["mimetype"]}}n”,
“rightValue”: “audio”,
“operator”: {
“type”: “string”,
“operation”: “startsWith”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-20,
480
],
“id”: “32a3ba90-9ffd-4b82-b596-3ead9e40d3b6”,
“name”: “If”
},
{
“parameters”: {
“resource”: “file”,
“operation”: “get”,
“fileId”: “={{ $json.files[0].id }}”
},
“type”: “n8n-nodes-base.slack”,
“typeVersion”: 2.3,
“position”: [
600,
380
],
“id”: “8092e5b6-b58b-4eb1-a405-eda45413d2b0”,
“name”: “Slack1”,
“webhookId”: “1fba9ed1-e186-4a69-bd67-8c81f6a307be”,
“credentials”: {
“slackApi”: {
“id”: “xreszx1ggPRXMWna”,
“name”: “Slack account”
}
}
},
{
“parameters”: {
“url”: “={{ $json.urlprivate }}”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Authorizationt”,
“value”: “Bearer xoxb-1081200626662-8992896477104-lJIabuib33CPDB0Yo7UMTseD”
}
]
},
“options”: {
“response”: {
“response”: {
“responseFormat”: “file”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
820,
380
],
“id”: “90d176a9-e730-490d-8f16-7cbea20f9566”,
“name”: “HTTP Request”
},
{
“parameters”: {
“resource”: “audio”,
“operation”: “transcribe”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.openAi”,
“typeVersion”: 1.8,
“position”: [
1040,
380
],
“id”: “b79747c1-af35-413c-9c7f-d71f35d76c88”,
“name”: “OpenAI”,
“credentials”: {
“openAiApi”: {
“id”: “JA0ROGyBQk2nCcLc”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “d0b1f6d2-67aa-4e35-b391-32a43a4bc47e”,
“name”: “text”,
“value”: “={{ $(‘Slack Trigger’).item.json.text }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
1040,
580
],
“id”: “deb85d35-2883-496a-80bd-aafac320a957”,
“name”: “Edit Fields”
},
{
“parameters”: {
“model”: {
rl”: true,
“value”: “gpt-4.1”,
“mode”: “list”,
“cachedResultName”: “gpt-4.1”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
1160,
780
],
“id”: “952268f5-ebac-470e-8696-d73c3d9271d9”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “JA0ROGyBQk2nCcLc”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “={{ ‘my
testsession’ }}n”,
“contextWindowLength”: 10
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
1360,
800
],
“id”: “202adf23-c60e-4bb8-bbe1-6a41b6e12f57”,
“name”: “Simple Memory”
},
{
“parameters”: {
“select”: “channel”,
“channelId”: {
_rl”: true,
“value”: “C08V7112VEC”,
“mode”: “list”,
“cachedResultName”: “assistant-chatbot”
},
“text”: “={{ $json.output }}”,
“otherOptions”: {}
},
“type”: “n8n-nodes-base.slack”,
“typeVersion”: 2.3,
“position”: [
1940,
480
],
“id”: “71bcdb0f-ee26-4851-a8d6-b834c0e702f4”,
“name”: “Slack2”,
“webhookId”: “852f29a3-2862-4a2d-a8ed-46dfa117e808”,
“retryOnFail”: false,
“credentials”: {
“slackApi”: {
“id”: “xreszx1ggPRXMWna”,
“name”: “Slack account”
}
}
},
{
“parameters”: {
“url”: “= https://api.duckduckgo.com ”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequestTool”,
“typeVersion”: 4.2,
“position”: [
1480,
800
],
“id”: “977d690e-c85c-43c3-bf76-577c54c3021a”,
“name”: “web search”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.text }}”,
“options”: {
“systemMessage”: “=##ROLE / OBJECTIVEnnYou are SUPER BOT, a highly capable, organized, and proactive AI Personal Assistant designed to help James stay on top of his life, work, and communication — all through natural conversations in Slack.nnYour job is to manage and orchestrate the activities between different agents and the formulate a friendly response back to the user in slack.nnYou should never try to write emails, create response, summarise, content, updates sheets, calender task etc.nnyour job is to call agent and tools in the correct sequence.nnThink carefully about the sequence of events. some tools might require you to first call another tool in other to pass it the correct information.nnnnn## ADDITIONAL INFORMATIONn-You are talking to JamesnThe current date and time is {{ $now }}nn## DO NOT KEEP LOOPING BACK YOUR REPLY TO THE SLACK OUTPUT. YOU MUST WAIT FOR JAMES RESPONSE BEFORE YOU SEND ANOTHER MESSAGE..nn## ALSO ENSURE NO OTHER TOOL OR SUB-WORKFLOW IS SENDIN REPLY YO SLACK OUTPUT.. CORDINATE AND ARRANGE THIS WELL.. NEVER!!nnnnn## INSTRUCTIONSnAlways respond with polished, well-formatted English.nnOne idea per paragraph.nnAdd a line break after each paragraph.nUse polite, confident, and professional tone just like a real, elite executive assistant.nnAlways confirm actions clearly, only if you are confuse or details are not complete.nnnIf a task is completed (email sent, meeting scheduled, message posted, etc.), confirm with a message like:nnn :white_check_mark: Done. I’ve sent the email to Sarah regarding the meeting.nnNever guess email contents.nnAlways get the actual content using the Gmail Search or Message Read tool before summarizing or replying.nnnAll input and output are done in Slack. Always keep James updated via Slack.nn#NEVER nLoop back your replies multiple times or send replies when you are not triggered or asked.nnRespond to only new user messages. Do not reply again unless the user sends a new message or instruction.”

TOOLSnHere are the tools available to you:n​:email: Gmail Agentnnnn​:magnifyingglasstiltedleft: Web Searchngooglesearch: Fetch real-time information from the web.nnn​:globewithmeridians: HTTP Requestsnhttprequest: Make requests to any webhook URL, APIs, or apps James connects to.nnn​:speechballoon: Slacknsendslackmessage: Send message to a Slack channel or DM.nnnreadslackmessages: Fetch messages from a channel or DM.nnnreplyslack_message: Respond in a thread or main channel.nnn​:date: Google Calendarnnnnnn”
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2,
“position”: [
1420,
480
],
“id”: “bdd3dccc-451f-47c7-a78b-b0d83b5eede9”,
“name”: “Supervisor Agent”
},
{
“parameters”: {
“description”: “Always, use this tool for any email / gmail related actions. like send email, reply email, get unread email.nnDO NOT TRY TO REPLY BACK TO SLACK OUTPUT. DON’T TRY IT. NO REPLY FROM YOU IS EXPECTEDnn## INSTRUCTIONSnAlways respond with polished, well-formatted English.nnnOne idea per paragraph.nnnAdd a line break after each paragraph.nnnUse polite, confident, and professional tone — just like a real, elite executive assistant.nnnALWAYS END EMAILS SEND WITH THESE SIGNATURE.nMany Thanks,ntn James Bellisn Founder & CEOn IG: @balancecoffeen W: balancecoffee.co.uknnFeatured as Best Healthy Coffee 2024 by The Independent

:hot_beverage:

:test_tube:nFeatured as Best Mushroom Coffee for Coffee Connoisseurs by the Evening Standard

:lion:

:mushroom:nn”,
“workflowId”: {
rl”: true,
“value”: “rlb4JKbcE98Xg1te”,
“mode”: “list”,
“cachedResultName”: “Gmail Agent”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: ,
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.toolWorkflow”,
“typeVersion”: 2.2,
“position”: [
1600,
800
],
“id”: “00ebc836-fe93-46af-88cd-f6f13f18c79c”,
“name”: “Gmail Agent”
},
{
“parameters”: {
“description”: “=You are a helpful assistant, Use this tool for any calender related actions. nnYou will use these tool to create, send check and update calender entry for james.nnDO NOT TRY TO REPLY BACK TO SLACK OUTPUT. DON’T TRY IT. NO REPLY FROM YOU IS EXPECTEDnn## DATE & TIMEnAlways use human-friendly formats when referring to dates or times.nExamples:n✅ "Tomorrow at 2:00 PM"nnn✅ "Monday, June 3 at 9:30 AM"nnn✅ "This Friday evening"nnnIf the user says something vague like "next Friday," clarify:n❓Just to confirm — do you mean Friday this week (June 7) or next week (June 14)?nnnwe are in the year 2025 ,so make sure your are deeply aware nDO NOT use any other date other than the current date and time: {{ $now }}n”,
“workflowId”: {
rl”: true,
“value”: “j0ctNUkuYsONY4Pr”,
“mode”: “list”,
“cachedResultName”: “Calender Agent”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: ,
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.toolWorkflow”,
“typeVersion”: 2.2,
“position”: [
1760,
760
],
“id”: “8d43a50f-8a26-4843-9d8d-004d5ac1c2dc”,
“name”: “Calender Agent”
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.toolCalculator”,
“typeVersion”: 1,
“position”: [
1940,
740
],
“id”: “cbfd95b0-c0a9-44e0-9dc9-512d17d9c3bd”,
“name”: “Calculator”
},
{
“parameters”: {
“description”: “use this tool to carry out any content writing action, research and also slack send dm or messages . DONOT TREY TO REPLY BACK TO SLACK OUTPUT. DON’T TRY IT.”,
“workflowId”: {
_rl”: true,
“value”: “6r91r1IDDxkYw30G”,
“mode”: “list”,
“cachedResultName”: “Content Creator / Leads / slack messages”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: ,
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.toolWorkflow”,
“typeVersion”: 2.2,
“position”: [
2140,
680
],
“id”: “24fee1cb-5748-4940-b711-11f81639a900”,
“name”: “Content Creator / Leads / slack messages”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “2dfb1447-45fb-4967-bb8a-b44199f7ce0b”,
“leftValue”: “={{$json["event"]["user"]}}nn”,
“rightValue”: “U08V6SCE132”,
“operator”: {
“type”: “string”,
“operation”: “notEquals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-280,
480
],
“id”: “3e8f22ae-9e9a-42d6-bc7c-4379bc0dde40”,
“name”: “If2”
}
],
“connections”: {
“Slack Trigger”: {
“main”: [
[
{
“node”: “If2”,
“type”: “main”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
[
{
“node”: “Slack1”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Slack1”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “OpenAI”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI”: {
“main”: [
[
{
“node”: “Supervisor Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Supervisor Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai
languageModel”: [
[
{
“node”: “Supervisor Agent”,
“type”: “ailanguageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai
memory”: [
[
{
“node”: “Supervisor Agent”,
“type”: “aimemory”,
“index”: 0
}
]
]
},
“web search”: {
“ai
tool”: [
[
{
“node”: “Supervisor Agent”,
“type”: “aitool”,
“index”: 0
}
]
]
},
“Supervisor Agent”: {
“main”: [
[
{
“node”: “Slack2”,
“type”: “main”,
“index”: 0
}
]
]
},
“Gmail Agent”: {
“ai
tool”: [
[
{
“node”: “Supervisor Agent”,
“type”: “aitool”,
“index”: 0
}
]
]
},
“Calender Agent”: {
“ai
tool”: [
[
{
“node”: “Supervisor Agent”,
“type”: “aitool”,
“index”: 0
}
]
]
},
“Calculator”: {
“ai
tool”: [
[
{
“node”: “Supervisor Agent”,
“type”: “aitool”,
“index”: 0
}
]
]
},
“Content Creator / Leads / slack messages”: {
“ai
tool”: [
[
{
“node”: “Supervisor Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“If2”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “32021514e863ff2590cee4bc386491909b3c9c352db15b865b4f353b58078c88”
}
}

 
Posted : 01/06/2025 7:53 pm
fahmiiireza
(@fahmiiireza)
Posts: 10
Active Member
 

Hello! Instead of monitoring every message posted in the channel, consider using the trigger that activates when the bot is mentioned. This approach simplifies the process, eliminates the need for manual checks, and prevents the issue of the bot replying to its own messages.

 
Posted : 02/06/2025 4:53 am
Share: