From 058ae5d3f6256df527941c7db0ae163c77080c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 9 Jul 2024 14:15:08 +0200 Subject: [PATCH] fix(editor): Use `workflowHelpers.getWebhookUrl` to determine webhook/form test URL (no-changelog) (#9977) --- .../editor-ui/src/composables/useRunWorkflow.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/editor-ui/src/composables/useRunWorkflow.ts b/packages/editor-ui/src/composables/useRunWorkflow.ts index 2b3115bdf4..c124fcb404 100644 --- a/packages/editor-ui/src/composables/useRunWorkflow.ts +++ b/packages/editor-ui/src/composables/useRunWorkflow.ts @@ -15,7 +15,7 @@ import type { StartNodeData, IRun, } from 'n8n-workflow'; -import { NodeConnectionType, FORM_TRIGGER_PATH_IDENTIFIER } from 'n8n-workflow'; +import { NodeConnectionType } from 'n8n-workflow'; import { useToast } from '@/composables/useToast'; import { useNodeHelpers } from '@/composables/useNodeHelpers'; @@ -29,6 +29,7 @@ import { import { useTitleChange } from '@/composables/useTitleChange'; import { useRootStore } from '@/stores/root.store'; import { useUIStore } from '@/stores/ui.store'; +import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { openPopUpWindow } from '@/utils/executionUtils'; import { useExternalHooks } from '@/composables/useExternalHooks'; @@ -48,6 +49,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType 1) { - const webhookPath = (node.parameters.path as string) || node.webhookId; - testUrl = `${rootStore.formTestUrl}/${webhookPath}`; + const nodeType = nodeTypesStore.getNodeType(node.type, node.typeVersion); + if (nodeType?.webhooks?.length) { + testUrl = workflowHelpers.getWebhookUrl(nodeType.webhooks[0], node, 'test'); } if (