ReferenceError: $setWorkflowStaticData is not defined on version 1.111.0

const staticData = $getWorkflowStaticData(‘global’);

let authenticatedUsers = staticData.authenticatedUsers || ;

const chatId = $input.item.json.message.chat.id.toString();

if (!authenticatedUsers.includes(chatId)) {
authenticatedUsers.push(chatId);
}

$setWorkflowStaticData(‘global’, { authenticatedUsers: authenticatedUsers });

return $input.item;

Note: $getWorkflowStaticData works but $setWorkflowStaticData does not

hello @Rey_Buban

n8n doesn’t have a $setWorkflowStaticDatamethod and never had. All properties will be updated automatically when you will modify the staticData object

getWorkflowStaticData | n8n Docs

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.