Code node stucked and not working

Code node not working on my all workflows

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

Hi @Farooq_Akh,

Is your issue with the Create search URL?

It seems that your loop is stuck on this node hence it cannot end and proceed to the Code node on the most top branch of your workflow.

Please review why the Create search URL is stuck.

Kind regards,

João Paixão

Can you send the json file of the flow? Sorry for my bad English.

code node is not working on my all workflows, not just this one

Can you share please the code node here?

And provide the version and installing option of n8n.

Running version [email protected]

Please can u share your code node?

Select the node, Ctrl+A → Ctrl+C , then here in post put that Ctrl+V insidise Markdown marks .

‘<{
“nodes”: [
{
“parameters”: {
“url”: “={{ $json.url }}”,
“options”: {}
},
“type”: “n8n-nodes-base.rssFeedRead”,
“typeVersion”: 1.2,
“position”: [
-352,
672
],
“id”: “38163922-f226-41fd-915d-d8c117779fea”,
“name”: “RSS Read”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=You are an information-extraction assistant. Read the text in {{ $(‘Filter1’).item.json.content }} carefully and return exactly one valid JSON object (no extra text, no markdown) with these fields:\n- “company”: the company or organization the article is primarily about (short string). If none found, use an empty string “”.\n- “signals”: an array of strings containing the exact names of any triggered signals found explicitly in the text. If no signals are present, return an empty array .\n\nSignals to detect (exact names to appear in the output array):\n- “Lease”\n- “CEO_Appointed”\n- “CEO_Resigned”\n- “Merger”\n- “Hiring”\n- “New_Contract”\n\nMatching rules:\n- Only include a signal when the text explicitly states the event (e.g., “appointed”, “named”, “resigned”, “merger announced”, “acquired”, “hired 50 staff”, “signed a contract”, “lease agreement signed”).\n- Treat CEO appointment as a signal: include “CEO_Appointed” when the text explicitly states someone was appointed/named/installed as CEO (including interim).\n- Include “CEO_Resigned” when the text explicitly states a CEO resigned or departed.\n- For “Merger” include only when the text explicitly mentions a merger, acquisition, takeover, buyout, or consolidation.\n- For “Hiring” include only for explicit hiring/recruitment language (e.g., “hired”, “recruited”, “recruitment drive”, “new hires”).\n- For “New_Contract” include when the text explicitly mentions a new contract award, contract signing, procurement win, or contract extension.\n- For “Lease” include only when the text explicitly mentions a lease agreement for property or equipment.\n- Do not infer events from context, searches, speculation, or related mentions — require explicit wording.\n\nOutput requirements:\n- Return exactly one JSON object and nothing else.\n- The “signals” array must contain only the exact signal name strings listed above, in any order, with no duplicates.\n- Preserve company names as they appear in the text when possible.\n- If the input text is empty, unreadable, or missing, return this exact JSON:\n{\n “company”: “”,\n “signals”: \n}”,
“hasOutputParser”: true,
“messages”: {
“messageValues”: [
{
“message”: “you are helping assistant for news evaluation and give me signal”
}
]
},
“batching”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chainLlm”,
“typeVersion”: 1.7,
“position”: [
672,
544
],
“id”: “666d0305-37a3-4e3d-bcd7-f73888e46d14”,
“name”: “Basic LLM Chain2”
},
{
“parameters”: {
“jsonSchemaExample”: “{\n “company”: “”,\n “signals”: \n}”
},
“type”: “@n8n/n8n-nodes-langchain.outputParserStructured”,
“typeVersion”: 1.3,
“position”: [
816,
768
],
“id”: “a13aea29-542b-411c-991f-6889616a4a0e”,
“name”: “Structured Output Parser2”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4.1-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
688,
768
],
“id”: “2daa95a3-d311-4df1-9b17-40105460e538”,
“name”: “OpenAI Chat Model2”,
“credentials”: {
“openAiApi”: {
“id”: “8q1Z1fI36FGoGzNd”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “9451a65b-d35b-490f-be75-e23788b11491”,
“leftValue”: “={{ $json.output.signals[0] }}”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “exists”,
“singleValue”: true
}
},
{
“id”: “4b16ef3d-8cdb-44d0-aa5f-af3d1c07927a”,
“leftValue”: “={{ $(‘RSS Read’).item.json.link }}”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “exists”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
1024,
544
],
“id”: “3222af7a-5525-44fe-85b9-d464b64328a7”,
“name”: “If1”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “120609b9-2865-4752-86dc-825c9453c38d”,
“leftValue”: “={{ $json.pubDate }}”,
“rightValue”: “={{ $today.minus({ days: 1 }).toISODate() }}”,
“operator”: {
“type”: “dateTime”,
“operation”: “after”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.2,
“position”: [
-128,
672
],
“id”: “af441607-2159-46cb-ae23-b299551edc0d”,
“name”: “Filter1”,
“alwaysOutputData”: true
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=I have this url, {{ $json.link }} please evaluate the company mentioning in the URL and give me the company employee size and sector and location and give me the output like this format:\n{ \n “sector”: “Banking”, \n “companySize”: “60-100”,\n “location”: “Stockholm”\n} \n”,
“hasOutputParser”: true,
“batching”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chainLlm”,
“typeVersion”: 1.7,
“position”: [
320,
544
],
“id”: “914cc904-73f6-4098-a128-31342218b37b”,
“name”: “Basic LLM Chain3”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4.1-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
336,
768
],
“id”: “d31056b1-adb7-4e59-b1d6-db129bfc9033”,
“name”: “OpenAI Chat Model3”,
“credentials”: {
“openAiApi”: {
“id”: “8q1Z1fI36FGoGzNd”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“jsonSchemaExample”: “{ \n “sector”: “Banking”, \n “companySize”: “60-100”,\n “location”: “Stockholm”\n}”
},
“type”: “@n8n/n8n-nodes-langchain.outputParserStructured”,
“typeVersion”: 1.3,
“position”: [
464,
768
],
“id”: “7dcb3b78-6ed3-44ef-b6bb-a516dc5dde7a”,
“name”: “Structured Output Parser3”
},
{
“parameters”: {
“operation”: “appendOrUpdate”,
“documentId”: {
“__rl”: true,
“value”: “1Uk7GhF5UMfOI-7hsP8bOV75DKh6OPgBTO-Rf6Z5W0tk”,
“mode”: “list”,
“cachedResultName”: “Signal Monitoring & Scraping”,
“cachedResultUrl”: “Signal Monitoring & Scraping - Google Sheets
},
“sheetName”: {
“__rl”: true,
“value”: “gid=0”,
“mode”: “list”,
“cachedResultName”: “Results”,
“cachedResultUrl”: “Signal Monitoring & Scraping - Google Sheets
},
“columns”: {
“mappingMode”: “defineBelow”,
“value”: {
“Source link”: “={{ $(‘Filter1’).item.json.link }}”,
“Company name”: “={{ $(‘Basic LLM Chain2’).item.json.output.company }}”,
“Signal detected (e.g., “New CEO appointed”)”: “={{ $(‘Basic LLM Chain2’).item.json.output.signals[0] }}, {{ $json.output.signals[1] }}”,
“Date of signal”: “={{ $(‘Filter1’).item.json.pubDate }}”,
“Sector”: “={{ $(‘Basic LLM Chain3’).item.json.output.sector }}”,
“Basic company profile (size)”: “={{ $(‘Basic LLM Chain3’).item.json.output.companySize }}”,
“Location”: “={{ $(‘Basic LLM Chain3’).item.json.output.location }}”
},
“matchingColumns”: [
“Source link”
],
“schema”: [
{
“id”: “Company name”,
“displayName”: “Company name”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Signal detected (e.g., “New CEO appointed”)”,
“displayName”: “Signal detected (e.g., “New CEO appointed”)”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Source link”,
“displayName”: “Source link”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Date of signal”,
“displayName”: “Date of signal”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Sector”,
“displayName”: “Sector”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Basic company profile (size)”,
“displayName”: “Basic company profile (size)”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Location”,
“displayName”: “Location”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
}
],
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.7,
“position”: [
1248,
544
],
“id”: “9320f1d0-3993-4c46-a5e6-6d85b4a2534e”,
“name”: “Append or update row in sheet2”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “bsUrqSrl4QFx2gVF”,
“name”: “Google Sheets account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “2b0ee355-19a3-49e3-a3d0-55c513f221bb”,
“name”: “URL 1”,
“value”: “https://www.fastighetsnytt.se/rss.xml”,
“type”: “string”
},
{
“id”: “cf24c41a-ab9b-4311-a534-fce93abf1d32”,
“name”: “URL 2”,
“value”: “https://www.byggindustrin.se/rss.xml”,
“type”: “string”
},
{
“id”: “f09812d1-8604-4f6b-ba86-4c730cf08fcc”,
“name”: “URL 3”,
“value”: “https://www.nordicpropertynews.com/feed”,
“type”: “string”
},
{
“id”: “78bf3890-fb8b-4d59-9c38-4f15a9a344a3”,
“name”: “URL 4”,
“value”: “Fastighetsnyheter – Transaktion Uthyrning Projekt | Fastighetsvärlden,
“type”: “string”
},
{
“id”: “f2054790-c7dc-491d-8a20-e1c4739a8d58”,
“name”: “URL 5”,
“value”: “https://www.lokalnytt.se/artiklar/kategori/Näringsliv/”,
“type”: “string”
},
{
“id”: “c2c0a0b1-ca5e-4ed8-8bd3-687de34d9a80”,
“name”: “URL 6”,
“value”: “https://www.property-magazine.eu/news/people/”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
-1456,
864
],
“id”: “d61e31ed-99bc-4eaf-8832-9f861e1a3397”,
“name”: “Edit Fields”
},
{
“parameters”: {
“options”: {}
},
“type”: “n8n-nodes-base.splitInBatches”,
“typeVersion”: 3,
“position”: [
-576,
864
],
“id”: “47cab6e9-910e-4768-b0a1-5613b6d79bf4”,
“name”: “Loop Over Items”
},
{
“parameters”: {
“jsCode”: “console.log()”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
-1024,
864
],
“id”: “86a9833f-f27d-4e81-b8f6-c52baba58efd”,
“name”: “Code”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“leftValue”: “={{ $json.url }}”,
“rightValue”: “/”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
},
“id”: “dff46acc-2c36-4d4d-ab22-613370131cb3”
}
],
“combinator”: “and”
}
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “664e93ff-43d8-44ef-9488-b0fc64c4693b”,
“leftValue”: “={{ $json.url }}”,
“rightValue”: “http”,
“operator”: {
“type”: “string”,
“operation”: “startsWith”
}
}
],
“combinator”: “and”
}
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.2,
“position”: [
-800,
864
],
“id”: “d2b97b09-b5c1-4ae3-8fd0-7dbc420aec3b”,
“name”: “Switch”
},
{
“parameters”: {
“rule”: {
“interval”: [
{
“triggerAtHour”: 10,
“triggerAtMinute”: 30
}
]
}
},
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
-1680,
864
],
“id”: “e0fc78fa-2849-4a89-b913-d7bf9874dd7c”,
“name”: “Schedule Trigger”
},
{
“parameters”: {
“authentication”: “oAuth2”,
“select”: “channel”,
“channelId”: {
“__rl”: true,
“value”: “C09EHTTSACA”,
“mode”: “list”,
“cachedResultName”: “news-alerts-rss”
},
“text”: “Signal Monitoring & Scraping workflow has run successfully. \nResults are available here: https://docs.google.com/spreadsheets/d/1Uk7GhF5UMfOI-7hsP8bOV75DKh6OPgBTO-Rf6Z5W0tk/\\n\\nAutomated with the Eloize Systems”,
“otherOptions”: {
“includeLinkToWorkflow”: false
}
},
“type”: “n8n-nodes-base.slack”,
“typeVersion”: 2.3,
“position”: [
-128,
864
],
“id”: “5ef67533-7e30-4e9a-86e9-19ca231b77b5”,
“name”: “Send a message”,
“webhookId”: “ed423f8c-435c-44fa-8260-b215a1a05c0c”,
“credentials”: {
“slackOAuth2Api”: {
“id”: “NExJ9RUrU4riYxXD”,
“name”: “Eloize Tech Support”
}
}
},
{
“parameters”: {
“fieldsToAggregate”: {
“fieldToAggregate”: [
{
“fieldToAggregate”: “Company name”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.aggregate”,
“typeVersion”: 1,
“position”: [
-352,
864
],
“id”: “dfb0e078-d895-4fdb-b9ef-8668f5b802f1”,
“name”: “Aggregate”
},
{
“parameters”: {},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.2,
“position”: [
1472,
800
],
“id”: “e79b3766-4e34-44e2-bd7f-47aa94b62a56”,
“name”: “Merge”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “dc4b4680-a2ee-4127-a3c2-8721b6c39449”,
“leftValue”: “”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “exists”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
96,
672
],
“id”: “891092aa-f2fa-4fea-b17f-16c8d6426192”,
“name”: “If2”
}
],
“connections”: {
“RSS Read”: {
“main”: [
[
{
“node”: “Filter1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Basic LLM Chain2”: {
“main”: [
[
{
“node”: “If1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Structured Output Parser2”: {
“ai_outputParser”: [
[
{
“node”: “Basic LLM Chain2”,
“type”: “ai_outputParser”,
“index”: 0
}
]
]
},
“OpenAI Chat Model2”: {
“ai_languageModel”: [
[
{
“node”: “Basic LLM Chain2”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“If1”: {
“main”: [
[
{
“node”: “Append or update row in sheet2”,
“type”: “main”,
“index”: 0
}
]
]
},
“Filter1”: {
“main”: [
[
{
“node”: “If2”,
“type”: “main”,
“index”: 0
}
]
]
},
“Basic LLM Chain3”: {
“main”: [
[
{
“node”: “Basic LLM Chain2”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model3”: {
“ai_languageModel”: [
[
{
“node”: “Basic LLM Chain3”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Structured Output Parser3”: {
“ai_outputParser”: [
[
{
“node”: “Basic LLM Chain3”,
“type”: “ai_outputParser”,
“index”: 0
}
]
]
},
“Append or update row in sheet2”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Code”,
“type”: “main”,
“index”: 0
}
]
]
},
“Loop Over Items”: {
“main”: [
[
{
“node”: “Aggregate”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “RSS Read”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code”: {
“main”: [
[
{
“node”: “Switch”,
“type”: “main”,
“index”: 0
}
]
]
},
“Switch”: {
“main”: [
,
[
{
“node”: “Loop Over Items”,
“type”: “main”,
“index”: 0
}
]
]
},
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Aggregate”: {
“main”: [
[
{
“node”: “Send a message”,
“type”: “main”,
“index”: 0
}
]
]
},
“Merge”: {
“main”: [
[
{
“node”: “Loop Over Items”,
“type”: “main”,
“index”: 0
}
]
]
},
“If2”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 1
}
],
[
{
“node”: “Basic LLM Chain3”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “976166b2cc5aa497ed0d667e1c449546c1bd48a4dc3b137e2aa69e45681b519c”
}
} >’

1 Like