Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/n8n-io/n8n into vertica-c…
Browse files Browse the repository at this point in the history
…redentials
  • Loading branch information
adina-hub committed Dec 17, 2024
2 parents 247bd11 + dc4261a commit a6489ee
Show file tree
Hide file tree
Showing 240 changed files with 9,094 additions and 1,257 deletions.
103 changes: 0 additions & 103 deletions .github/scripts/check-tests.mjs

This file was deleted.

3 changes: 1 addition & 2 deletions .github/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"p-limit": "3.1.0",
"picocolors": "1.0.1",
"semver": "7.5.4",
"tempfile": "5.0.0",
"typescript": "*"
"tempfile": "5.0.0"
}
}
30 changes: 0 additions & 30 deletions .github/workflows/check-tests.yml

This file was deleted.

8 changes: 3 additions & 5 deletions cypress/e2e/29-templates.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ describe('Workflow templates', () => {
workflowPage.actions.shouldHaveWorkflowName('Demo: ' + OnboardingWorkflow.name);
workflowPage.getters.canvasNodes().should('have.length', 4);
workflowPage.getters.stickies().should('have.length', 1);
workflowPage.getters.canvasNodes().first().should('have.descendants', '.node-pin-data-icon');
});

it('can import template', () => {
Expand All @@ -142,6 +141,7 @@ describe('Workflow templates', () => {
});

it('should save template id with the workflow', () => {
cy.intercept('POST', '/rest/workflows').as('saveWorkflow');
templatesPage.actions.importTemplate();

cy.visit(templatesPage.url);
Expand All @@ -159,10 +159,8 @@ describe('Workflow templates', () => {
workflowPage.actions.hitSelectAll();
workflowPage.actions.hitCopy();

cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite');
// Check workflow JSON by copying it to clipboard
cy.readClipboard().then((workflowJSON) => {
expect(workflowJSON).to.contain('"templateId": "1"');
cy.wait('@saveWorkflow').then((interception) => {
expect(interception.request.body.meta.templateId).to.equal('1');
});
});

Expand Down
14 changes: 14 additions & 0 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,4 +862,18 @@ describe('NDV', () => {
.contains('To search field contents rather than just names, use Table or JSON view')
.should('exist');
});

it('ADO-2931 - should handle multiple branches of the same input with the first branch empty correctly', () => {
cy.createFixtureWorkflow('Test_ndv_two_branches_of_same_parent_false_populated.json');
workflowPage.actions.zoomToFit();
workflowPage.actions.openNode('DebugHelper');
ndv.getters.inputPanel().should('be.visible');
ndv.getters.outputPanel().should('be.visible');
ndv.actions.execute();
// This ensures we rendered the inputPanel
ndv.getters
.inputPanel()
.find('[data-test-id=run-data-schema-item]')
.should('contain.text', 'a1');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"nodes": [
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "6f0cf983-824b-4339-a5de-6b374a23b4b0",
"leftValue": "={{ $json.a }}",
"rightValue": 3,
"operator": {
"type": "number",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [220, 0],
"id": "1755282a-ec4a-4d02-a833-0316ca413cc4",
"name": "If"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [0, 0],
"id": "de1e7acf-12d8-4e56-ba42-709ffb397db2",
"name": "When clicking ‘Test workflow’"
},
{
"parameters": {
"category": "randomData"
},
"type": "n8n-nodes-base.debugHelper",
"typeVersion": 1,
"position": [580, 0],
"id": "86440d33-f833-453c-bcaa-fff7e0083501",
"name": "DebugHelper",
"alwaysOutputData": true
}
],
"connections": {
"If": {
"main": [
[
{
"node": "DebugHelper",
"type": "main",
"index": 0
}
],
[
{
"node": "DebugHelper",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {
"When clicking ‘Test workflow’": [
{
"a": 1
},
{
"a": 2
}
]
}
}
6 changes: 5 additions & 1 deletion cypress/pages/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export class WorkflowPage extends BasePage {
canvasNodes: () =>
cy.ifCanvasVersion(
() => cy.getByTestId('canvas-node'),
() => cy.getByTestId('canvas-node').not('[data-node-type="n8n-nodes-internal.addNodes"]'),
() =>
cy
.getByTestId('canvas-node')
.not('[data-node-type="n8n-nodes-internal.addNodes"]')
.not('[data-node-type="n8n-nodes-base.stickyNote"]'),
),
canvasNodeByName: (nodeName: string) =>
this.getters.canvasNodes().filter(`:contains(${nodeName})`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import type {
INodeProperties,
} from 'n8n-workflow';

import { promptTypeOptions, textFromPreviousNode, textInput } from '@utils/descriptions';

import { conversationalAgentProperties } from './agents/ConversationalAgent/description';
import { conversationalAgentExecute } from './agents/ConversationalAgent/execute';
import { openAiFunctionsAgentProperties } from './agents/OpenAiFunctionsAgent/description';
Expand All @@ -21,7 +23,6 @@ import { sqlAgentAgentProperties } from './agents/SqlAgent/description';
import { sqlAgentAgentExecute } from './agents/SqlAgent/execute';
import { toolsAgentProperties } from './agents/ToolsAgent/description';
import { toolsAgentExecute } from './agents/ToolsAgent/execute';
import { promptTypeOptions, textFromPreviousNode, textInput } from '../../../utils/descriptions';

// Function used in the inputs expression to figure out which inputs to
// display based on the agent type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';

import { SYSTEM_MESSAGE, HUMAN_MESSAGE } from './prompt';

export const conversationalAgentProperties: INodeProperties[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import { CombiningOutputParser } from 'langchain/output_parsers';
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';

import {
isChatInstance,
getPromptInputByType,
getConnectedTools,
} from '../../../../../utils/helpers';
import { getOptionalOutputParsers } from '../../../../../utils/output_parsers/N8nOutputParser';
import { throwIfToolSchema } from '../../../../../utils/schemaParsing';
import { getTracingConfig } from '../../../../../utils/tracing';
import { isChatInstance, getPromptInputByType, getConnectedTools } from '@utils/helpers';
import { getOptionalOutputParsers } from '@utils/output_parsers/N8nOutputParser';
import { throwIfToolSchema } from '@utils/schemaParsing';
import { getTracingConfig } from '@utils/tracing';

import { checkForStructuredTools, extractParsedOutput } from '../utils';

export async function conversationalAgentExecute(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';

import { SYSTEM_MESSAGE } from './prompt';

export const openAiFunctionsAgentProperties: INodeProperties[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {
NodeOperationError,
} from 'n8n-workflow';

import { getConnectedTools, getPromptInputByType } from '../../../../../utils/helpers';
import { getOptionalOutputParsers } from '../../../../../utils/output_parsers/N8nOutputParser';
import { getTracingConfig } from '../../../../../utils/tracing';
import { getConnectedTools, getPromptInputByType } from '@utils/helpers';
import { getOptionalOutputParsers } from '@utils/output_parsers/N8nOutputParser';
import { getTracingConfig } from '@utils/tracing';

import { extractParsedOutput } from '../utils';

export async function openAiFunctionsAgentExecute(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';

import { DEFAULT_STEP_EXECUTOR_HUMAN_CHAT_MESSAGE_TEMPLATE } from './prompt';

export const planAndExecuteAgentProperties: INodeProperties[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import {
NodeOperationError,
} from 'n8n-workflow';

import { getConnectedTools, getPromptInputByType } from '../../../../../utils/helpers';
import { getOptionalOutputParsers } from '../../../../../utils/output_parsers/N8nOutputParser';
import { throwIfToolSchema } from '../../../../../utils/schemaParsing';
import { getTracingConfig } from '../../../../../utils/tracing';
import { getConnectedTools, getPromptInputByType } from '@utils/helpers';
import { getOptionalOutputParsers } from '@utils/output_parsers/N8nOutputParser';
import { throwIfToolSchema } from '@utils/schemaParsing';
import { getTracingConfig } from '@utils/tracing';

import { checkForStructuredTools, extractParsedOutput } from '../utils';

export async function planAndExecuteAgentExecute(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';

import { HUMAN_MESSAGE_TEMPLATE, PREFIX, SUFFIX, SUFFIX_CHAT } from './prompt';

export const reActAgentAgentProperties: INodeProperties[] = [
Expand Down
Loading

0 comments on commit a6489ee

Please sign in to comment.