diff --git a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/__tests__/built-ins-parser.test.ts b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/__tests__/built-ins-parser.test.ts index 366a9188de..d64c154884 100644 --- a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/__tests__/built-ins-parser.test.ts +++ b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/__tests__/built-ins-parser.test.ts @@ -62,6 +62,15 @@ describe('BuiltInsParser', () => { expect(state).toEqual(new BuiltInsParserState({ needs$input: true })); }); + + test.each([['items'], ['item']])( + 'should mark input as needed when %s is used', + (identifier) => { + const state = parseAndExpectOk(`return ${identifier};`); + + expect(state).toEqual(new BuiltInsParserState({ needs$input: true })); + }, + ); }); describe('$(...)', () => { diff --git a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts index dd2d849c6a..7bdfff8240 100644 --- a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts +++ b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts @@ -131,6 +131,9 @@ export class BuiltInsParser { state.markExecutionAsNeeded(); } else if (node.name === '$prevNode') { state.markPrevNodeAsNeeded(); + } else if (node.name === 'items' || node.name === 'item') { + // item is deprecated but we still need to support it + state.markInputAsNeeded(); } };