-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): Fix expression with paired item with multi-input node #7424
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
cypress/fixtures/expression_with_paired_item_in_multi_input_node.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"meta": { | ||
"instanceId": "abc" | ||
}, | ||
"nodes": [ | ||
{ | ||
"parameters": {}, | ||
"id": "bcb6abdf-d34b-4ea7-a8ed-58155b708c43", | ||
"name": "When clicking \"Execute Workflow\"", | ||
"type": "n8n-nodes-base.manualTrigger", | ||
"typeVersion": 1, | ||
"position": [ | ||
20, | ||
260 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"jsCode": "// Loop over input items and add a new field\n// called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\nitem.json.message_count = Math.min(item.json.messages.length, 3);\n}\n\nreturn $input.all();" | ||
}, | ||
"id": "59c3889c-3671-4f49-b258-6131df8587d8", | ||
"name": "Set thread properties1", | ||
"type": "n8n-nodes-base.code", | ||
"typeVersion": 1, | ||
"position": [ | ||
500, | ||
520 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"resource": "thread", | ||
"operation": "get", | ||
"threadId": "={{ $json.id }}", | ||
"options": {} | ||
}, | ||
"id": "e102b72e-1e47-4004-a6b9-38cef75f44a1", | ||
"name": "Get thread details1", | ||
"type": "n8n-nodes-base.gmail", | ||
"typeVersion": 2, | ||
"position": [ | ||
300, | ||
520 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"mode": "expression", | ||
"output": "={{ $('Set thread properties1').item.json.message_count }}" | ||
}, | ||
"id": "f3e42f07-df82-42ba-8e99-97cda707a9d9", | ||
"name": "Switch1", | ||
"type": "n8n-nodes-base.switch", | ||
"typeVersion": 1, | ||
"position": [ | ||
1220, | ||
540 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"conditions": { | ||
"boolean": [ | ||
{ | ||
"value1": true, | ||
"value2": true | ||
} | ||
] | ||
} | ||
}, | ||
"id": "c7fe521e-8c02-44bf-8a14-482b39749508", | ||
"name": "IF", | ||
"type": "n8n-nodes-base.if", | ||
"typeVersion": 1, | ||
"position": [ | ||
720, | ||
520 | ||
] | ||
}, | ||
{ | ||
"parameters": {}, | ||
"id": "3b9f6a05-7f19-46c5-95d1-5dec732f00ae", | ||
"name": "No Operation, do nothing", | ||
"type": "n8n-nodes-base.noOp", | ||
"typeVersion": 1, | ||
"position": [ | ||
960, | ||
400 | ||
] | ||
} | ||
], | ||
"connections": { | ||
"When clicking \"Execute Workflow\"": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Get thread details1", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"Set thread properties1": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "IF", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"Get thread details1": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Set thread properties1", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"IF": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "No Operation, do nothing", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
], | ||
[ | ||
{ | ||
"node": "Switch1", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"No Operation, do nothing": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Switch1", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't that the same as
itemInput
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemInput
is not in scope at L1048?