Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
1.6 KiB
1.6 KiB
Disallow usage of deprecated functions and types from n8n-workflow package (@n8n/community-nodes/no-deprecated-workflow-functions)
💼 This rule is enabled in the following configs: ✅ recommended, ☑️ recommendedWithoutN8nCloudSupport.
💡 This rule is manually fixable by editor suggestions.
Rule Details
Prevents usage of deprecated functions from n8n-workflow package and suggests modern alternatives.
Examples
❌ Incorrect
import { IRequestOptions } from 'n8n-workflow';
export class MyNode implements INodeType {
async execute(this: IExecuteFunctions) {
// Using deprecated request helper function
const response = await this.helpers.request({
method: 'GET',
url: 'https://api.example.com/data',
});
// Using deprecated type
const options: IRequestOptions = {
method: 'POST',
url: 'https://api.example.com/data',
};
return [this.helpers.returnJsonArray([response])];
}
}
✅ Correct
import { IHttpRequestOptions } from 'n8n-workflow';
export class MyNode implements INodeType {
async execute(this: IExecuteFunctions) {
// Using modern httpRequest helper function
const response = await this.helpers.httpRequest({
method: 'GET',
url: 'https://api.example.com/data',
});
// Using modern type
const options: IHttpRequestOptions = {
method: 'POST',
url: 'https://api.example.com/data',
};
return [this.helpers.returnJsonArray([response])];
}
}