diff --git a/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.test.ts b/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.test.ts index fbfbb49b83b3f..5d423028fd144 100644 --- a/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.test.ts +++ b/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.test.ts @@ -336,7 +336,7 @@ describe('executionFinished', () => { expect(trackExecuteAiWorkflow).toHaveBeenCalledWith('error'); }); - it('should track execution of ready-to-run-ai-workflow-v1', async () => { + it('should track execution of ready-to-run-ai-workflow-v5', async () => { const pinia = createTestingPinia(); setActivePinia(pinia); @@ -347,7 +347,7 @@ describe('executionFinished', () => { vi.spyOn(workflowsStore, 'getWorkflowById').mockReturnValue({ id: '1', name: 'Test Workflow', - meta: { templateId: 'ready-to-run-ai-workflow-v1' }, + meta: { templateId: 'ready-to-run-ai-workflow-v5' }, } as IWorkflowDb); const trackExecuteAiWorkflowSuccess = vi.spyOn( @@ -379,7 +379,7 @@ describe('executionFinished', () => { expect(trackExecuteAiWorkflowSuccess).toHaveBeenCalled(); }); - it('should track execution of ready-to-run-ai-workflow-v4', async () => { + it('should track execution of ready-to-run-ai-workflow-v6', async () => { const pinia = createTestingPinia(); setActivePinia(pinia); @@ -390,7 +390,7 @@ describe('executionFinished', () => { vi.spyOn(workflowsStore, 'getWorkflowById').mockReturnValue({ id: '1', name: 'Test Workflow', - meta: { templateId: 'ready-to-run-ai-workflow-v4' }, + meta: { templateId: 'ready-to-run-ai-workflow-v6' }, } as IWorkflowDb); const trackExecuteAiWorkflow = vi.spyOn(readyToRunStore, 'trackExecuteAiWorkflow'); diff --git a/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.ts b/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.ts index 85edd57c04641..12c8fe5a81be5 100644 --- a/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.ts +++ b/packages/frontend/editor-ui/src/app/composables/usePushConnection/handlers/executionFinished.ts @@ -94,10 +94,8 @@ export async function executionFinished( ); } else if ( templateId === 'ready-to-run-ai-workflow' || - templateId === 'ready-to-run-ai-workflow-v1' || - templateId === 'ready-to-run-ai-workflow-v2' || - templateId === 'ready-to-run-ai-workflow-v3' || - templateId === 'ready-to-run-ai-workflow-v4' + templateId === 'ready-to-run-ai-workflow-v5' || + templateId === 'ready-to-run-ai-workflow-v6' ) { if (data.status === 'success') { readyToRunStore.trackExecuteAiWorkflowSuccess(); diff --git a/packages/frontend/editor-ui/src/app/constants/experiments.ts b/packages/frontend/editor-ui/src/app/constants/experiments.ts index a9c53c0658167..fa23fecfb41e8 100644 --- a/packages/frontend/editor-ui/src/app/constants/experiments.ts +++ b/packages/frontend/editor-ui/src/app/constants/experiments.ts @@ -70,11 +70,11 @@ export const READY_TO_RUN_V2_EXPERIMENT = { variant2: 'variant-2-twoboxes', }; -export const READY_TO_RUN_V2_PART2_EXPERIMENT = { - name: '045_ready-to-run-worfklow_v2-2', +export const READY_TO_RUN_V2_P3_EXPERIMENT = { + name: '059_ready-to-run-worfklow_v2-3', control: 'control', - variant3: 'variant-3', - variant4: 'variant-4', + variant5: 'variant-5', + variant6: 'variant-6', }; export const PERSONALIZED_TEMPLATES_V3 = { @@ -108,7 +108,7 @@ export const EXPERIMENTS_TO_TRACK = [ PRE_BUILT_AGENTS_EXPERIMENT.name, TEMPLATE_RECO_V2.name, TEMPLATES_DATA_QUALITY_EXPERIMENT.name, - READY_TO_RUN_V2_PART2_EXPERIMENT.name, + READY_TO_RUN_V2_P3_EXPERIMENT.name, UPGRADE_PLAN_CTA_EXPERIMENT.name, AI_BUILDER_TEMPLATE_EXAMPLES_EXPERIMENT.name, AI_BUILDER_MULTI_AGENT_EXPERIMENT.name, diff --git a/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/stores/readyToRunWorkflowsV2.store.ts b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/stores/readyToRunWorkflowsV2.store.ts index 37d556513beb0..d92bd6da57b04 100644 --- a/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/stores/readyToRunWorkflowsV2.store.ts +++ b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/stores/readyToRunWorkflowsV2.store.ts @@ -1,12 +1,12 @@ -import { READY_TO_RUN_V2_PART2_EXPERIMENT } from '@/app/constants'; +import { READY_TO_RUN_V2_P3_EXPERIMENT } from '@/app/constants'; import { useCloudPlanStore } from '@/app/stores/cloudPlan.store'; import { usePostHog } from '@/app/stores/posthog.store'; import type { WorkflowDataCreate } from '@n8n/rest-api-client'; import { STORES } from '@n8n/stores'; import { defineStore } from 'pinia'; import { computed } from 'vue'; -import { READY_TO_RUN_WORKFLOW_V3 } from '../workflows/ai-workflow-v3'; -import { READY_TO_RUN_WORKFLOW_V4 } from '../workflows/ai-workflow-v4'; +import { READY_TO_RUN_WORKFLOW_V5 } from '../workflows/ai-workflow-v5'; +import { READY_TO_RUN_WORKFLOW_V6 } from '../workflows/ai-workflow-v6'; export const useReadyToRunWorkflowsV2Store = defineStore( STORES.EXPERIMENT_READY_TO_RUN_WORKFLOWS_V2, @@ -15,18 +15,18 @@ export const useReadyToRunWorkflowsV2Store = defineStore( const cloudPlanStore = useCloudPlanStore(); const currentVariant = computed(() => - posthogStore.getVariant(READY_TO_RUN_V2_PART2_EXPERIMENT.name), + posthogStore.getVariant(READY_TO_RUN_V2_P3_EXPERIMENT.name), ); - const isVariant3 = computed( - () => currentVariant.value === READY_TO_RUN_V2_PART2_EXPERIMENT.variant3, + const isVariant5 = computed( + () => currentVariant.value === READY_TO_RUN_V2_P3_EXPERIMENT.variant5, ); - const isVariant4 = computed( - () => currentVariant.value === READY_TO_RUN_V2_PART2_EXPERIMENT.variant4, + const isVariant6 = computed( + () => currentVariant.value === READY_TO_RUN_V2_P3_EXPERIMENT.variant6, ); const isFeatureEnabled = computed( - () => cloudPlanStore.userIsTrialing && (isVariant3.value || isVariant4.value), + () => cloudPlanStore.userIsTrialing && (isVariant5.value || isVariant6.value), ); const getWorkflowForVariant = (): WorkflowDataCreate | undefined => { @@ -34,12 +34,12 @@ export const useReadyToRunWorkflowsV2Store = defineStore( return; } - if (isVariant3.value) { - return READY_TO_RUN_WORKFLOW_V3; + if (isVariant5.value) { + return READY_TO_RUN_WORKFLOW_V5; } - if (isVariant4.value) { - return READY_TO_RUN_WORKFLOW_V4; + if (isVariant6.value) { + return READY_TO_RUN_WORKFLOW_V6; } return; diff --git a/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v5.ts b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v5.ts new file mode 100644 index 0000000000000..292c681535de0 --- /dev/null +++ b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v5.ts @@ -0,0 +1,176 @@ +import type { WorkflowDataCreate } from '@n8n/rest-api-client'; + +export const READY_TO_RUN_WORKFLOW_V5: WorkflowDataCreate = { + name: 'Chat with the news', + meta: { templateId: 'ready-to-run-ai-workflow-v5' }, + settings: { + executionOrder: 'v1', + }, + nodes: [ + { + parameters: { + options: {}, + }, + type: '@n8n/n8n-nodes-langchain.chatTrigger', + typeVersion: 1.4, + position: [288, 0], + id: '261ee04a-4695-4d1a-bec3-9f86b5efd5eb', + name: 'When chat message received', + webhookId: 'b567d98b-aabb-4963-b0f8-6b1e8b5f8959', + }, + { + parameters: { + model: { + __rl: true, + mode: 'list', + value: 'gpt-4.1-mini', + }, + responsesApiEnabled: false, + options: {}, + }, + type: '@n8n/n8n-nodes-langchain.lmChatOpenAi', + typeVersion: 1.3, + position: [400, 288], + id: '201ee441-da46-49fc-befa-312ad4b60479', + name: 'OpenAI Model', + credentials: {}, + }, + { + parameters: {}, + type: '@n8n/n8n-nodes-langchain.memoryBufferWindow', + typeVersion: 1.3, + position: [576, 288], + id: 'aa874554-17b1-41a1-9e1f-8c6c197e7e2f', + name: 'Simple Memory', + }, + { + parameters: { + url: 'https://hnrss.org/frontpage', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [1120, 288], + id: '5788980c-2a63-40ed-a375-c68ca7a3b9c0', + name: 'Hackernews', + }, + { + parameters: { + url: 'https://www.theverge.com/rss/index.xml', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [960, 288], + id: 'f250ef18-d913-4a76-a607-b1eeebcbab23', + name: 'TheVerge', + }, + { + parameters: { + url: 'https://feeds.bbci.co.uk/news/rss.xml', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [800, 288], + id: '0c375d2e-4b2d-4fa6-8b3e-31ac931117cb', + name: 'BBC News', + }, + { + parameters: { + content: + '✅ This AI News agent is ready to use. Chat with it! \n✨ We gave you free OpenAI credits\n💡 Learn [how to build](https://n8n.io/workflows/6270-build-your-first-ai-agent/) your own agent ', + height: 80, + width: 448, + color: 4, + }, + type: 'n8n-nodes-base.stickyNote', + typeVersion: 1, + position: [0, -176], + id: '052068ba-ea50-4521-9946-63ded13b23b0', + name: 'Sticky Note2', + }, + { + parameters: { + options: { + systemMessage: + "=News Agent\n\n# Role\n\nYou are a concise, factual news assistant with access to these RSS tools:\n\n* BBC (Global news)\n* TheVerge (Consumer tech)\n* Hacker News (Tech discussions)\n\nYou always keep replies **short and focused (maximum 100 words total)**.\n\n# Behavior\n\n* On the first message only, greet the user and say you can search recent news.\n* When the user asks for news, always check all RSS tools and combine results from multiple feeds if relevant, but surface only the **top 1 to 5 most relevant items**.\n* Never invent information. Only use content found in the tools.\n\n# Answer Format\n\n* **Maximum 100 words per reply** (including any follow-up sentence).\n* Start with **one short intro sentence**.\n* Then provide **3–5 bullet points**, each a **single short sentence**.\n* Use short, clear sentences.\n* Add a link to the original article or source in at least one bullet.\n* Include a section **“Sources checked:”** listing the feeds used (e.g., “Sources checked: BBC, TheVerge”).\n\n# Edge Cases\n\n* If you find too little information, say so and suggest adding more news sources to the agent.\n* If the user asks you to build workflows or do non-news tasks, say you are only a news agent and point them to n8n’s AI Workflow Builder (✨ icon) and the docs: [https://docs.n8n.io/advanced-ai/ai-workflow-builder/](https://docs.n8n.io/advanced-ai/ai-workflow-builder/)\n* If the user asks for opinions or predictions, stay neutral and summarize facts only.\n* After sharing news results with the user for the first time, mention that they can also get AI-summarized news by email using this template: https://n8n.io/workflows/6270-build-your-first-ai-agent/. Only make this suggestion once in the entire chat history, not after every question (check your previous responses to make sure you don't repeat the suggestion).\n\n# Date\n\nToday is {{ $today }}\n", + }, + }, + type: '@n8n/n8n-nodes-langchain.agent', + typeVersion: 3, + position: [608, 0], + id: 'e481d1a1-3a3d-4583-98ae-87a9b39471a8', + name: 'AI Agent', + }, + ], + pinData: {}, + connections: { + 'When chat message received': { + main: [ + [ + { + node: 'AI Agent', + type: 'main', + index: 0, + }, + ], + ], + }, + 'OpenAI Model': { + ai_languageModel: [ + [ + { + node: 'AI Agent', + type: 'ai_languageModel', + index: 0, + }, + ], + ], + }, + 'Simple Memory': { + ai_memory: [ + [ + { + node: 'AI Agent', + type: 'ai_memory', + index: 0, + }, + ], + ], + }, + Hackernews: { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + TheVerge: { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + 'BBC News': { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + }, +}; diff --git a/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v6.ts b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v6.ts new file mode 100644 index 0000000000000..ecbb08a147753 --- /dev/null +++ b/packages/frontend/editor-ui/src/experiments/readyToRunWorkflowsV2/workflows/ai-workflow-v6.ts @@ -0,0 +1,199 @@ +import type { WorkflowDataCreate } from '@n8n/rest-api-client'; + +export const READY_TO_RUN_WORKFLOW_V6: WorkflowDataCreate = { + name: 'Chat with the news', + meta: { templateId: 'ready-to-run-ai-workflow-v6' }, + settings: { + executionOrder: 'v1', + }, + nodes: [ + { + parameters: { + options: {}, + }, + type: '@n8n/n8n-nodes-langchain.chatTrigger', + typeVersion: 1.4, + position: [-160, 64], + id: '6f4d9435-be4c-48a6-89a2-9a24cdf68d40', + name: 'When chat message received', + webhookId: 'b567d98b-aabb-4963-b0f8-6b1e8b5f8959', + }, + { + parameters: { + model: { + __rl: true, + mode: 'list', + value: 'gpt-4.1-mini', + }, + responsesApiEnabled: false, + options: {}, + }, + type: '@n8n/n8n-nodes-langchain.lmChatOpenAi', + typeVersion: 1.3, + position: [-16, 384], + id: 'f9b6e5c5-36d1-415f-9c5c-79fb79787207', + name: 'OpenAI Model', + credentials: {}, + }, + { + parameters: {}, + type: '@n8n/n8n-nodes-langchain.memoryBufferWindow', + typeVersion: 1.3, + position: [160, 384], + id: '81e7b833-c47b-44f7-950d-8d035fcb2205', + name: 'Simple Memory', + }, + { + parameters: { + url: 'https://hnrss.org/frontpage', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [432, 384], + id: '3677c36a-813b-407b-9fdc-38565c6f73e9', + name: 'Hackernews', + }, + { + parameters: { + url: 'https://www.theverge.com/rss/index.xml', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [592, 384], + id: 'e1eaf4ea-0a02-44fd-b0c8-13505ad5bd22', + name: 'TheVerge', + }, + { + parameters: { + url: 'https://feeds.bbci.co.uk/news/rss.xml', + options: {}, + }, + type: 'n8n-nodes-base.rssFeedReadTool', + typeVersion: 1.2, + position: [752, 384], + id: 'ee0b9c96-e66d-47e3-9122-0ca998caf687', + name: 'BBC News', + }, + { + parameters: { + content: + '✅ This AI News agent is ready to use. Chat with it! \n✨ We gave you free OpenAI credits\n💡 Next: [Connect a Google Sheet](https://n8n.io/workflows/7639-talk-to-your-google-sheets-using-chatgpt-5/) to chat with your data', + height: 80, + width: 448, + color: 4, + }, + type: 'n8n-nodes-base.stickyNote', + typeVersion: 1, + position: [-416, -112], + id: '99944422-2269-4952-bd31-715ec0eb5bb4', + name: 'Sticky Note2', + }, + { + parameters: { + documentId: { + __rl: true, + mode: 'list', + value: '', + }, + sheetName: { + __rl: true, + mode: 'list', + value: '', + }, + }, + type: 'n8n-nodes-base.googleSheetsTool', + typeVersion: 4.7, + position: [896, 384], + id: 'fc10c8a7-6621-4e7d-937f-6cb1e03bc057', + name: 'Google Sheets', + credentials: {}, + }, + { + parameters: { + options: { + systemMessage: + '=News Agent\n\n# Role\n\nYou are a concise, factual news assistant with access to these RSS tools:\n\n* BBC (Global news)\n* TheVerge (Consumer tech)\n* Hacker News (Tech discussions)\n\nYou always keep replies **short and focused (maximum 100 words total)**.\n\n# Behavior\n\n* On the first message only, greet the user and say you can search recent news.\n* When the user asks for news, always check all RSS tools and combine results from multiple feeds if relevant, but surface only the **top 1 - 5 most relevant items**.\n* Never invent information. Only use content found in the tools.\n\n# Answer Format\n\n* **Maximum 100 words per reply** (including any follow-up sentence).\n* Start with **one short intro sentence**.\n* Then provide **3–5 bullet points**, each a **single short sentence**.\n* Use short, clear sentences.\n* Add a link to the original article or source in at least one bullet.\n\n# Edge Cases\n\n* If you find too little information, say so and suggest adding more news sources to the agent.\n* If the user asks you to build workflows or do non-news tasks, say you are only a news agent and point them to n8n’s AI Workflow Builder (✨ icon) and the docs: [https://docs.n8n.io/advanced-ai/ai-workflow-builder/](https://docs.n8n.io/advanced-ai/ai-workflow-builder/)\n* If the user asks for opinions or predictions, stay neutral and summarize facts only.\n* After sharing news results with the user for the first time, ask the user if they want to connect one of their Google Sheets so that they can chat with their own data. Only make this suggestion once in the entire chat history. If they say yes, provide these instructions:\n\n1. Connect the Google Sheets node to the AI Agent in the same way as the RSS nodes.\n2. Open the Google Sheets node and connect your Google account.\n3. Pick your Spreadsheet and Sheet from the dropdowns.\n\n\n# Date\n\nToday is {{ $today }}\n', + }, + }, + type: '@n8n/n8n-nodes-langchain.agent', + typeVersion: 3, + position: [192, 64], + id: 'ce5dd204-b9d3-4455-ab0c-0c2ce314ad52', + name: 'AI Agent', + }, + ], + pinData: {}, + connections: { + 'When chat message received': { + main: [ + [ + { + node: 'AI Agent', + type: 'main', + index: 0, + }, + ], + ], + }, + 'OpenAI Model': { + ai_languageModel: [ + [ + { + node: 'AI Agent', + type: 'ai_languageModel', + index: 0, + }, + ], + ], + }, + 'Simple Memory': { + ai_memory: [ + [ + { + node: 'AI Agent', + type: 'ai_memory', + index: 0, + }, + ], + ], + }, + Hackernews: { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + TheVerge: { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + 'BBC News': { + ai_tool: [ + [ + { + node: 'AI Agent', + type: 'ai_tool', + index: 0, + }, + ], + ], + }, + 'Google Sheets': { + ai_tool: [[]], + }, + }, +};