Code node not connected to Telegram node

Hi guys, I made my first n8n workflow that scrapes through Uniqlo’s job posting and picks up certain roles, within a certain location, and within a specific job post time range (e.g, “posted now”, “posted a day ago”. Once it gets those jobs filtered out, it sends it to me via Telegram text.

The issue is that everything works, but the connection between the Code Node and the Telegram Node is grey. I’ve tried to find the solution by testing the Telegram node by itself, and I found that the Telegram Node works perfectly and sends me dummy messages, but for some reason, I can’t seem to get the connection between the Code Node and the Telegram Node to be green.

The workflow execution works perfectly without any error, but it just stops at the Code Node.

Hi welcome to n8n community :clap:

Are you sure the code node output exist? because it seems not generate any output so thats why your telegram not trigger. can you share your workflow?

1 Like

Please share this workflow in a code block

1 Like
const locationKeywords = ["Regent Street", "Oxford Street", "Stratford"];
const daysLimit = ["Now", "1 Day", "2 Days", "6 Days", "7 Days"];
const roleKeyword = "Sales Assistant";

let results = [];

for (const job of items[0].json.jobs) {
  const isSalesAssistant = job.title.includes(roleKeyword);
  const matchesLocation = locationKeywords.some(keyword => job.title.includes(keyword));
  const recentlyPosted = daysLimit.some(day => job.postedOn.includes(day));

  if (isSalesAssistant && matchesLocation && recentlyPosted) {
    results.push({ json: job });
  }
}

return results;

this is the Code Node

Please share the entire workflow in code block.

From the code here you’re likely returning an empty array, for which n8n will not continue processing the rest of the nodes. That is why you have a grey unexecuted line. You’re looping over something called “items[0]” which if not referenced from actual data in the workflow will be null, so you’re always returning an empty result.

Either you need to make sure the code node returns some value or you need to go to the code node settings and toggle this setting to force it to continue processing if the output of the node is null or empty:

So, how do I search my entire workflow? I also tried your suggestion, and it finally connected it and it is now green.

The output from the Code Node was empty, but it did send me the Telegram message, which was a location pin emoji with no location, a clock emoji (for when it was posted), which was empty and an empty link.

To read the result from previous nodes, for example from the telegram node you want to read data from the HTTP node, you would use {{ $('HTTP Request3').first().json }} or from the code node you need to reference it like $('HTTP Request3').first().json

So in your code node to populate the items variable you would maybe do something like

const items = $('HTTP Request3').first().json.someItemArray;