Skip to content
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): Allow index as top-level item key for Code node #12469

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Jan 6, 2025

Summary

The index key was added to the INodeExecutionData interface by the community, who also added it to Function and FunctionItem. It was then added to Gong, and very recently we added it to ExecuteWorkflowTrigger and ToolWorkflowV2.

Until we can stop using this index key in all nodes, the Code node will need to allowlist this key so that we do not throw during input data validation. This is especially relevant for a Code node run in a subworkflow execution.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-473/task-runner-code-node-fails-when-used-in-sub-workflow

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏🏽

@@ -4,7 +4,19 @@ import type { INodeExecutionData } from 'n8n-workflow';
import { ValidationError } from './errors/validation-error';
import { isObject } from './obj-utils';

export const REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem', 'error']);
export const REQUIRED_N8N_ITEM_KEYS = new Set([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need to setup a @n8n/constants package to reduce duplication like this.

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link

cypress bot commented Jan 6, 2025

n8n    Run #8584

Run Properties:  status check passed Passed #8584  •  git commit 7f78579b05: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review CAT-473-v2
Run status status check passed Passed #8584
Run duration 04m 49s
Commit git commit 7f78579b05: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Committer Iván Ovejero
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 485
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Jan 6, 2025

✅ All Cypress E2E specs passed

@ivov ivov merged commit 1b91000 into master Jan 6, 2025
37 checks passed
@ivov ivov deleted the CAT-473-v2 branch January 6, 2025 14:03
@github-actions github-actions bot mentioned this pull request Jan 8, 2025
@janober
Copy link
Member

janober commented Jan 9, 2025

Got released with n8n@1.74.1

1 similar comment
@janober
Copy link
Member

janober commented Jan 9, 2025

Got released with n8n@1.74.1

@janober
Copy link
Member

janober commented Jan 9, 2025

Got released with n8n@1.74.0

1 similar comment
@janober
Copy link
Member

janober commented Jan 9, 2025

Got released with n8n@1.74.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants