Function Null output

Hey Guys, ive been trying to migrate to different host and i deployed latest n8n docker.

I realized function was replaced with code, i was using this in my function node :

const staticData = getWorkflowStaticData('global');
const newTweetIds = => item.json["Tweet ID"]);
const oldTweetIds = staticData.oldTweetIds; 

if (!oldTweetIds) {
  staticData.oldTweetIds = newTweetIds;
  return items;

const actualNewTweetIds = newTweetIds.filter((id) => !oldTweetIds.includes(id));
const actualNewTweets = items.filter((data) => actualNewTweetIds.includes(data.json['Tweet ID']));
staticData.oldTweetIds = [...actualNewTweetIds, ...oldTweetIds];

return actualNewTweets;

its giving me null output, i moved the code to code but its not working giving me item error.

could someone help me updating this? its supposed to fetch only latest tweets after trigger


Hey @marcondy,

My first thought is probably needs to become $input.all().map, Generally anywhere you were using items it would need to become $input.all().

I would start with that and maybe add in a few console.log() lines to test your variables. Don’t forget Static Data is also not populated when you are running a workflow in the UI.