first commit
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

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,61 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
jest.mock('jsonwebtoken', () => ({
sign: jest.fn().mockReturnValue('signature'),
}));
describe('Test Google BigQuery V2, executeQuery with named parameters', () => {
nock('https://oauth2.googleapis.com')
.persist()
.post(
'/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
)
.reply(200, { access_token: 'token' });
nock('https://bigquery.googleapis.com/bigquery')
.post('/v2/projects/test-project/jobs', {
configuration: {
query: {
queryParameters: [
{
name: 'email',
parameterType: { type: 'STRING' },
parameterValue: { value: 'test@n8n.io' },
},
{
name: 'name',
parameterType: { type: 'STRING' },
parameterValue: { value: 'Test Testerson' },
},
{
name: 'n8n_variable',
parameterType: { type: 'STRING' },
parameterValue: { value: 42 },
},
],
query:
'SELECT * FROM bigquery_node_dev_test_dataset.test_json WHERE email = @email AND name = @name AND n8n_variable = @n8n_variable;',
useLegacySql: false,
parameterMode: 'NAMED',
},
},
})
.reply(200, {
jobReference: {
jobId: 'job_123',
},
status: {
state: 'DONE',
},
})
.get('/v2/projects/test-project/queries/job_123')
.reply(200)
.get('/v2/projects/test-project/queries/job_123?maxResults=1000&timeoutMs=10000')
.reply(200, { rows: [], schema: {} });
new NodeTestHarness().setupTests({
workflowFiles: ['executeQuery.queryParameters.workflow.json'],
});
});
@@ -0,0 +1,79 @@
{
"name": "My workflow 12",
"nodes": [
{
"parameters": {},
"id": "7db7d51a-83c2-4aa0-a736-9c3d1c031b60",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [360, 340]
},
{
"parameters": {
"authentication": "serviceAccount",
"projectId": {
"__rl": true,
"value": "test-project",
"mode": "list",
"cachedResultName": "test-project",
"cachedResultUrl": "https://console.cloud.google.com/bigquery?project=test-project"
},
"sqlQuery": "SELECT * FROM bigquery_node_dev_test_dataset.test_json WHERE email = @email AND name = @name AND n8n_variable = @n8n_variable;",
"options": {
"queryParameters": {
"namedParameters": [
{
"name": "email",
"value": "test@n8n.io"
},
{
"name": "name",
"value": "Test Testerson"
},
{
"name": "n8n_variable",
"value": "={{ 40 + 2 }}"
}
]
}
}
},
"id": "83d00275-0f98-4d5e-a3d6-bbca940ff8ac",
"name": "Google BigQuery",
"type": "n8n-nodes-base.googleBigQuery",
"typeVersion": 2,
"position": [620, 340],
"credentials": {
"googleApi": {
"id": "66",
"name": "Google account 5"
}
}
}
],
"pinData": {
"Google BigQuery": []
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Google BigQuery",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "be2fc126-5d71-4e86-9a4e-eb62ad266860",
"id": "156",
"meta": {
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
},
"tags": []
}
@@ -0,0 +1,42 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
jest.mock('jsonwebtoken', () => ({
sign: jest.fn().mockReturnValue('signature'),
}));
describe('Test Google BigQuery V2, executeQuery', () => {
nock('https://oauth2.googleapis.com')
.persist()
.post(
'/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
)
.reply(200, { access_token: 'token' });
nock('https://bigquery.googleapis.com/bigquery')
.post('/v2/projects/test-project/jobs', {
configuration: {
query: {
query: 'SELECT * FROM bigquery_node_dev_test_dataset.test_json;',
useLegacySql: false,
},
},
})
.reply(200, {
jobReference: {
jobId: 'job_123',
},
status: {
state: 'DONE',
},
})
.get('/v2/projects/test-project/queries/job_123')
.reply(200)
.get('/v2/projects/test-project/queries/job_123?maxResults=1000&timeoutMs=10000')
.reply(200, { rows: [], schema: {} });
new NodeTestHarness().setupTests({
workflowFiles: ['executeQuery.workflow.json'],
});
});
@@ -0,0 +1,62 @@
{
"name": "My workflow 12",
"nodes": [
{
"parameters": {},
"id": "7db7d51a-83c2-4aa0-a736-9c3d1c031b60",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [360, 340]
},
{
"parameters": {
"authentication": "serviceAccount",
"projectId": {
"__rl": true,
"value": "test-project",
"mode": "list",
"cachedResultName": "test-project",
"cachedResultUrl": "https://console.cloud.google.com/bigquery?project=test-project"
},
"sqlQuery": "SELECT * FROM bigquery_node_dev_test_dataset.test_json;",
"options": {}
},
"id": "83d00275-0f98-4d5e-a3d6-bbca940ff8ac",
"name": "Google BigQuery",
"type": "n8n-nodes-base.googleBigQuery",
"typeVersion": 2,
"position": [620, 340],
"credentials": {
"googleApi": {
"id": "66",
"name": "Google account 5"
}
}
}
],
"pinData": {
"Google BigQuery": []
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Google BigQuery",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "be2fc126-5d71-4e86-9a4e-eb62ad266860",
"id": "156",
"meta": {
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
},
"tags": []
}
@@ -0,0 +1,40 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
jest.mock('jsonwebtoken', () => ({
sign: jest.fn().mockReturnValue('signature'),
}));
describe('Test Google BigQuery V2, executeQuery', () => {
nock('https://oauth2.googleapis.com')
.persist()
.post(
'/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
)
.reply(200, { access_token: 'token' });
nock('https://bigquery.googleapis.com/bigquery')
.post('/v2/projects/test-project/jobs', {
configuration: {
query: {
query: 'SELECT * FROM bigquery_node_dev_test_dataset.test_json;',
useLegacySql: false,
},
},
})
.reply(200, {
jobReference: {
jobId: 'job_123',
},
status: {
state: 'RUNNING',
},
})
.get('/v2/projects/test-project/queries/job_123?maxResults=1000&timeoutMs=10000')
.replyWithError('Internal server error');
new NodeTestHarness().setupTests({
workflowFiles: ['executeQueryContinueOnJobFail.workflow.json'],
});
});
@@ -0,0 +1,69 @@
{
"name": "My workflow 12",
"nodes": [
{
"parameters": {},
"id": "7db7d51a-83c2-4aa0-a736-9c3d1c031b60",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [360, 340]
},
{
"parameters": {
"authentication": "serviceAccount",
"projectId": {
"__rl": true,
"value": "test-project",
"mode": "list",
"cachedResultName": "test-project",
"cachedResultUrl": "https://console.cloud.google.com/bigquery?project=test-project"
},
"sqlQuery": "SELECT * FROM bigquery_node_dev_test_dataset.test_json;",
"options": {}
},
"id": "83d00275-0f98-4d5e-a3d6-bbca940ff8ac",
"name": "Google BigQuery",
"type": "n8n-nodes-base.googleBigQuery",
"typeVersion": 2,
"position": [620, 340],
"credentials": {
"googleApi": {
"id": "66",
"name": "Google account 5"
}
},
"onError": "continueRegularOutput"
}
],
"pinData": {
"Google BigQuery": [
{
"json": {
"error": "Internal server error"
}
}
]
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Google BigQuery",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "be2fc126-5d71-4e86-9a4e-eb62ad266860",
"id": "156",
"meta": {
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
},
"tags": []
}
@@ -0,0 +1,47 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
jest.mock('jsonwebtoken', () => ({
sign: jest.fn().mockReturnValue('signature'),
}));
describe('Test Google BigQuery V2, insert auto map', () => {
nock('https://oauth2.googleapis.com')
.persist()
.post(
'/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
)
.reply(200, { access_token: 'token' });
nock('https://bigquery.googleapis.com/bigquery')
.get('/v2/projects/test-project/datasets/bigquery_node_dev_test_dataset/tables/num_text')
.reply(200, {
schema: {
fields: [
{ name: 'id', type: 'INT' },
{ name: 'test', type: 'STRING' },
],
},
})
.post(
'/v2/projects/test-project/datasets/bigquery_node_dev_test_dataset/tables/num_text/insertAll',
{
rows: [
{ json: { id: 1, test: '111' } },
{ json: { id: 2, test: '222' } },
{ json: { id: 3, test: '333' } },
],
traceId: 'trace_id',
},
)
.reply(200, [
{ kind: 'bigquery#tableDataInsertAllResponse' },
{ kind: 'bigquery#tableDataInsertAllResponse' },
{ kind: 'bigquery#tableDataInsertAllResponse' },
]);
new NodeTestHarness().setupTests({
workflowFiles: ['insert.autoMapMode.workflow.json'],
});
});
@@ -0,0 +1,146 @@
{
"name": "My workflow 12",
"nodes": [
{
"parameters": {},
"id": "7db7d51a-83c2-4aa0-a736-9c3d1c031b60",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [20, 340]
},
{
"parameters": {
"authentication": "serviceAccount",
"operation": "insert",
"projectId": {
"__rl": true,
"value": "test-project",
"mode": "list",
"cachedResultName": "test-project",
"cachedResultUrl": "https://console.cloud.google.com/bigquery?project=test-project"
},
"datasetId": {
"__rl": true,
"value": "bigquery_node_dev_test_dataset",
"mode": "list",
"cachedResultName": "bigquery_node_dev_test_dataset"
},
"tableId": {
"__rl": true,
"value": "num_text",
"mode": "list",
"cachedResultName": "num_text"
},
"options": {
"traceId": "trace_id"
}
},
"id": "83d00275-0f98-4d5e-a3d6-bbca940ff8ac",
"name": "Google BigQuery",
"type": "n8n-nodes-base.googleBigQuery",
"typeVersion": 2,
"position": [500, 340],
"credentials": {
"googleApi": {
"id": "66",
"name": "Google account 5"
}
}
},
{
"parameters": {
"data": [
{
"id": 1,
"test": "111"
},
{
"id": 2,
"test": "222"
},
{
"id": 3,
"test": "333"
}
]
},
"id": "11d06660-cbd3-4bd2-9619-68e82438a0e3",
"name": "Code",
"type": "n8n-nodes-testing.testData",
"typeVersion": 1,
"position": [240, 340]
}
],
"pinData": {
"Code": [
{
"json": {
"id": 1,
"test": "111"
}
},
{
"json": {
"id": 2,
"test": "222"
}
},
{
"json": {
"id": 3,
"test": "333"
}
}
],
"Google BigQuery": [
{
"json": {
"kind": "bigquery#tableDataInsertAllResponse"
}
},
{
"json": {
"kind": "bigquery#tableDataInsertAllResponse"
}
},
{
"json": {
"kind": "bigquery#tableDataInsertAllResponse"
}
}
]
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Google BigQuery",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "30d3e38a-b5a4-4999-816d-7c05a68f31c8",
"id": "156",
"meta": {
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
},
"tags": []
}
@@ -0,0 +1,40 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
jest.mock('jsonwebtoken', () => ({
sign: jest.fn().mockReturnValue('signature'),
}));
describe('Test Google BigQuery V2, insert define manually', () => {
nock('https://oauth2.googleapis.com')
.persist()
.post(
'/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
)
.reply(200, { access_token: 'token' });
nock('https://bigquery.googleapis.com/bigquery')
.get('/v2/projects/test-project/datasets/bigquery_node_dev_test_dataset/tables/test_json')
.reply(200, {
schema: {
fields: [
{ name: 'json', type: 'JSON' },
{ name: 'name with space', type: 'STRING' },
{ name: 'active', type: 'BOOLEAN' },
],
},
})
.post(
'/v2/projects/test-project/datasets/bigquery_node_dev_test_dataset/tables/test_json/insertAll',
{
rows: [{ json: { active: 'true', json: '{"test": 1}', 'name with space': 'some name' } }],
traceId: 'trace_id',
},
)
.reply(200, [{ kind: 'bigquery#tableDataInsertAllResponse' }]);
new NodeTestHarness().setupTests({
workflowFiles: ['insert.manualMode.workflow.json'],
});
});
@@ -0,0 +1,99 @@
{
"name": "My workflow 12",
"nodes": [
{
"parameters": {},
"id": "7db7d51a-83c2-4aa0-a736-9c3d1c031b60",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [360, 340]
},
{
"parameters": {
"authentication": "serviceAccount",
"operation": "insert",
"projectId": {
"__rl": true,
"value": "test-project",
"mode": "list",
"cachedResultName": "test-project",
"cachedResultUrl": "https://console.cloud.google.com/bigquery?project=test-project"
},
"datasetId": {
"__rl": true,
"value": "bigquery_node_dev_test_dataset",
"mode": "list",
"cachedResultName": "bigquery_node_dev_test_dataset"
},
"tableId": {
"__rl": true,
"value": "test_json",
"mode": "list",
"cachedResultName": "test_json"
},
"dataMode": "define",
"fieldsUi": {
"values": [
{
"fieldId": "active",
"fieldValue": "true"
},
{
"fieldId": "name with space",
"fieldValue": "some name"
},
{
"fieldId": "json",
"fieldValue": "{\"test\": 1}"
}
]
},
"options": {
"traceId": "trace_id"
}
},
"id": "83d00275-0f98-4d5e-a3d6-bbca940ff8ac",
"name": "Google BigQuery",
"type": "n8n-nodes-base.googleBigQuery",
"typeVersion": 2,
"position": [620, 340],
"credentials": {
"googleApi": {
"id": "66",
"name": "Google account 5"
}
}
}
],
"pinData": {
"Google BigQuery": [
{
"json": {
"kind": "bigquery#tableDataInsertAllResponse"
}
}
]
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Google BigQuery",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "abd49f26-184d-4f9b-95f0-389ea20df809",
"id": "156",
"meta": {
"instanceId": "36203ea1ce3cef713fa25999bd9874ae26b9e4c2c3a90a365f2882a154d031d0"
},
"tags": []
}
@@ -0,0 +1,272 @@
import { mock } from 'jest-mock-extended';
import { constructExecutionMetaData } from 'n8n-core';
import type { IDataObject, IExecuteFunctions, INode } from 'n8n-workflow';
import { prepareOutput } from '../../../v2/helpers/utils';
describe('Google BigQuery v2 Utils', () => {
it('should prepareOutput', () => {
const thisArg = mock<IExecuteFunctions>({
getNode: () => ({ typeVersion: 2.1 }) as INode,
helpers: mock({ constructExecutionMetaData }),
});
const response: IDataObject = {
kind: 'bigquery#getQueryResultsResponse',
etag: 'e_tag',
schema: {
fields: [
{
name: 'nodes',
type: 'RECORD',
mode: 'REPEATED',
fields: [
{
name: 'webhookId',
type: 'STRING',
mode: 'NULLABLE',
},
{
name: 'position',
type: 'INTEGER',
mode: 'REPEATED',
},
{
name: 'name',
type: 'STRING',
mode: 'NULLABLE',
},
{
name: 'typeVersion',
type: 'INTEGER',
mode: 'NULLABLE',
},
{
name: 'credentials',
type: 'RECORD',
mode: 'NULLABLE',
fields: [
{
name: 'zendeskApi',
type: 'RECORD',
mode: 'NULLABLE',
fields: [
{
name: 'name',
type: 'STRING',
mode: 'NULLABLE',
},
{
name: 'id',
type: 'INTEGER',
mode: 'NULLABLE',
},
],
},
],
},
{
name: 'type',
type: 'STRING',
mode: 'NULLABLE',
},
{
name: 'parameters',
type: 'RECORD',
mode: 'NULLABLE',
fields: [
{
name: 'conditions',
type: 'RECORD',
mode: 'NULLABLE',
fields: [
{
name: 'all',
type: 'RECORD',
mode: 'REPEATED',
fields: [
{
name: 'value',
type: 'STRING',
mode: 'NULLABLE',
},
],
},
],
},
{
name: 'options',
type: 'RECORD',
mode: 'NULLABLE',
fields: [
{
name: 'fields',
type: 'STRING',
mode: 'REPEATED',
},
],
},
],
},
],
},
],
},
jobReference: {
projectId: 'project_id',
jobId: 'job_ref',
location: 'US',
},
totalRows: '1',
rows: [
{
f: [
{
v: [
{
v: {
f: [
{
v: 'web_hook_id',
},
{
v: [
{
v: '100',
},
{
v: '100',
},
],
},
{
v: 'Zendesk Trigger',
},
{
v: '1',
},
{
v: {
f: [
{
v: {
f: [
{
v: 'Zendesk account',
},
{
v: '8',
},
],
},
},
],
},
},
{
v: 'n8n-nodes-base.zendeskTrigger',
},
{
v: {
f: [
{
v: {
f: [
{
v: [
{
v: {
f: [
{
v: 'closed',
},
],
},
},
],
},
],
},
},
{
v: {
f: [
{
v: [
{
v: 'ticket.title',
},
{
v: 'ticket.description',
},
],
},
],
},
},
],
},
},
],
},
},
],
},
],
},
],
totalBytesProcessed: '0',
jobComplete: true,
cacheHit: true,
};
const returnData = prepareOutput.call(thisArg, response, 0, false, false);
expect(returnData).toBeDefined();
// expect(returnData).toHaveProperty('nodes');
expect(returnData).toEqual([
{
json: {
nodes: [
{
webhookId: 'web_hook_id',
position: ['100', '100'],
name: 'Zendesk Trigger',
typeVersion: '1',
credentials: [
{
zendeskApi: [
{
name: 'Zendesk account',
id: '8',
},
],
},
],
type: 'n8n-nodes-base.zendeskTrigger',
parameters: [
{
conditions: [
{
all: [
{
value: 'closed',
},
],
},
],
options: [
{
fields: ['ticket.title', 'ticket.description'],
},
],
},
],
},
],
},
pairedItem: {
item: 0,
},
},
]);
});
});