n8n-editor-ui 1.91.0 → 1.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/assets/{AnimatedSpinner-fxUUiJkt.js → AnimatedSpinner-CtKKeDrz.js} +1 -1
  2. package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DaejGlee.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DR6h_xsK.js} +1 -1
  3. package/dist/assets/{AuthView-C38evMFm.js → AuthView-mKkzBRxh.js} +2 -2
  4. package/dist/assets/{CanvasChatSwitch-wA9DYH8v.js → CanvasChatSwitch-Bu2VD2kp.js} +22 -10
  5. package/dist/assets/{ChangePasswordView-BhWZeFH0.js → ChangePasswordView-D5UI1v-J.js} +3 -3
  6. package/dist/assets/CollectionParameter-BeCTpZ-q.js +4 -0
  7. package/dist/assets/{CredentialsView-Nqr-i2Pe.js → CredentialsView-B78eNJO5.js} +6 -6
  8. package/dist/assets/{DemoFooter-BWR2cAp9.js → DemoFooter-DP26HpCu.js} +8 -8
  9. package/dist/assets/{ErrorView-CS9OEuyr.js → ErrorView-C3fvEdCg.js} +1 -1
  10. package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-DetKnv65.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-BBpwYdHY.js} +2 -2
  11. package/dist/assets/{ExecutionsView-C9YWPuDj.js → ExecutionsView-BvlDZwIs.js} +8 -8
  12. package/dist/assets/{FileSaver.min-DmkzTNV9.js → FileSaver.min-BzAtcQXX.js} +1 -1
  13. package/dist/assets/{FixedCollectionParameter-B95bmTf5.js → FixedCollectionParameter-CS5zXMAh.js} +1 -1
  14. package/dist/assets/{ForgotMyPasswordView-qiBahYik.js → ForgotMyPasswordView-CVQ7pcIG.js} +3 -3
  15. package/dist/assets/{InsightsChartAverageRuntime-Dxhbd0ns.js → InsightsChartAverageRuntime-Boh0SMb3.js} +4 -4
  16. package/dist/assets/{InsightsChartFailed-BQcqQ0cP.js → InsightsChartFailed-IZ-KYOU9.js} +4 -4
  17. package/dist/assets/{InsightsChartFailureRate-ByRknnji.js → InsightsChartFailureRate-2fWw3p0L.js} +4 -4
  18. package/dist/assets/{InsightsChartTimeSaved-DwWd2CE4.js → InsightsChartTimeSaved-B2pLVys1.js} +4 -4
  19. package/dist/assets/{InsightsChartTotal-ByBJBO5S.js → InsightsChartTotal-2QD4wPLR.js} +4 -4
  20. package/dist/assets/{InsightsDashboard-Bi1pPMYJ.js → InsightsDashboard-CbiFbJ8w.js} +10 -10
  21. package/dist/assets/{InsightsPaywall-BHAFddnZ.js → InsightsPaywall-5d-cSdiS.js} +1 -1
  22. package/dist/assets/{InsightsSummary-BbdmlYGl.js → InsightsSummary-gldDQ9rg.js} +1 -1
  23. package/dist/assets/{InsightsTableWorkflows-06mtfv-r.js → InsightsTableWorkflows-_eTCUNCX.js} +2 -2
  24. package/dist/assets/{Logo-YWli2nsX.js → Logo-Dl2xVRIu.js} +1 -1
  25. package/dist/assets/{LogsPanel-CutVxFbc.js → LogsPanel-JnYirDqa.js} +73 -105
  26. package/dist/assets/{LogsPanel-DLC2TAqh.css → LogsPanel-mTaFEGk_.css} +38 -34
  27. package/dist/assets/{MainHeader-DeD-Rq-o.js → MainHeader-Bk29pgmL.js} +9 -9
  28. package/dist/assets/{MainSidebar-w7XcpgsG.js → MainSidebar-BM5ku_wM.js} +11 -11
  29. package/dist/assets/{MainSidebar-CKMiDGvH.css → MainSidebar-zZpP3qQ0.css} +13 -12
  30. package/dist/assets/{NodeCreation-BPVX4AyM.js → NodeCreation-BEjdAYc_.js} +4 -4
  31. package/dist/assets/{NodeCreator-ORfmLjpf.js → NodeCreator-cEUgbAI9.js} +3 -3
  32. package/dist/assets/{NodeDetailsView-z4dW5CZA.js → NodeDetailsView-D4O9dKTA.js} +62 -47
  33. package/dist/assets/{NodeDetailsView-CGgV4Pn_.css → NodeDetailsView-DsFLtbxi.css} +20 -20
  34. package/dist/assets/{NodeView-DoYUR6zN.js → NodeView-DDSOUm8E.js} +29 -16
  35. package/dist/assets/{ProjectCardBadge-9gGGsnO4.js → ProjectCardBadge-BNn2hiMe.js} +1 -1
  36. package/dist/assets/{ProjectHeader-mP1U8azT.js → ProjectHeader-CaEZ2OPj.js} +1 -1
  37. package/dist/assets/{ProjectSettings-BXv7wHt2.js → ProjectSettings-otA8E-yW.js} +2 -2
  38. package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-Cu81u0g8.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-C3JbZMCk.js} +1 -1
  39. package/dist/assets/{ResourcesListLayout-l12N8elL.js → ResourcesListLayout-1d9Ic6VX.js} +1 -1
  40. package/dist/assets/{RunData-C9dtm1M2.css → RunData-BjlZgIyx.css} +12 -2
  41. package/dist/assets/{RunData-DcTRJlPx.js → RunData-Bx47sNQp.js} +383 -189
  42. package/dist/assets/{RunDataAi-BF2gZZGr.css → RunDataAi-D9VLFXIf.css} +10 -51
  43. package/dist/assets/{RunDataAi-gSq_Xjqe.js → RunDataAi-DOac7nwD.js} +27 -310
  44. package/dist/assets/{RunDataJson-ZWzRQWbP.js → RunDataJson-Pev6yNEV.js} +7 -7
  45. package/dist/assets/{RunDataJsonActions-CLZHKSxo.js → RunDataJsonActions-Co4xgmVq.js} +1 -1
  46. package/dist/assets/RunDataParsedAiContent-9EEUzCKp.css +176 -0
  47. package/dist/assets/RunDataParsedAiContent-D6MNLmT3.js +148 -0
  48. package/dist/assets/{RunDataSearch-DGVT04w4.js → RunDataSearch-C8orcAlP.js} +1 -1
  49. package/dist/assets/{RunDataTable-DXZeWFoe.js → RunDataTable-oi_l8dhA.js} +3 -3
  50. package/dist/assets/{SamlOnboarding-oqY0GJU1.js → SamlOnboarding-CT5J6dx0.js} +3 -3
  51. package/dist/assets/{SettingsApiView-wOjTe5Iz.js → SettingsApiView-CupjcI9v.js} +1 -1
  52. package/dist/assets/{SettingsCommunityNodesView-BferxshR.js → SettingsCommunityNodesView-B5K2VLyJ.js} +4 -4
  53. package/dist/assets/{SettingsExternalSecrets-AVAe3pFB.js → SettingsExternalSecrets-BidJCf_t.js} +1 -1
  54. package/dist/assets/{SettingsLdapView-Dzz0oH8X.js → SettingsLdapView-Cva6akhW.js} +1 -1
  55. package/dist/assets/{SettingsLogStreamingView-7wK5X84p.js → SettingsLogStreamingView-Cy-rAKUO.js} +1 -1
  56. package/dist/assets/{SettingsPersonalView-DFJF_V6T.js → SettingsPersonalView-ZJ1Syok2.js} +14 -13
  57. package/dist/assets/{SettingsSourceControl-CMcBENTO.js → SettingsSourceControl-CMtqqlkO.js} +1 -1
  58. package/dist/assets/{SettingsSso-Z1Q6NEkd.js → SettingsSso-Bi3OpykL.js} +1 -1
  59. package/dist/assets/{SettingsUsageAndPlan-CcRKHQ0-.js → SettingsUsageAndPlan-C5TbwZhP.js} +1 -1
  60. package/dist/assets/{SettingsUsersView-B3WfDCek.js → SettingsUsersView-BHuP5k0A.js} +1 -1
  61. package/dist/assets/{SettingsView-BlwKUaR5.js → SettingsView-DPIIqaKN.js} +1 -1
  62. package/dist/assets/{SetupView-D5lrdUoq.js → SetupView-C4V9j6sh.js} +3 -3
  63. package/dist/assets/{SetupWorkflowCredentialsButton-Bc6VdFCN.js → SetupWorkflowCredentialsButton-BZ9ILQUp.js} +1 -1
  64. package/dist/assets/{SetupWorkflowFromTemplateView-CJD5W1WL.js → SetupWorkflowFromTemplateView-3uV3zSU2.js} +3 -3
  65. package/dist/assets/{SigninView-DH2fyWJ4.js → SigninView-DWZHdCjG.js} +3 -3
  66. package/dist/assets/{SignoutView-CBkwCdXi.js → SignoutView-DbduXAir.js} +1 -1
  67. package/dist/assets/{SignupView-BRMhMcBZ.js → SignupView-DWq6VACk.js} +3 -3
  68. package/dist/assets/{TemplateDetails-D-BdppKN.js → TemplateDetails-BckqE6GK.js} +1 -1
  69. package/dist/assets/{TemplateList-BnoYTtBt.js → TemplateList-Bw0JeBMP.js} +1 -1
  70. package/dist/assets/{TemplatesCollectionView-BjJj8lj5.js → TemplatesCollectionView-CAKT-mpV.js} +5 -5
  71. package/dist/assets/{TemplatesSearchView-EuczA-oB.js → TemplatesSearchView-I2a5us58.js} +3 -3
  72. package/dist/assets/{TemplatesView-lDM12E7u.js → TemplatesView-6EwGFFJK.js} +1 -1
  73. package/dist/assets/{TemplatesWorkflowView-CvyrJnPM.js → TemplatesWorkflowView-C8xYMhwu.js} +5 -5
  74. package/dist/assets/{TestDefinitionEditView-D3rNVRaa.js → TestDefinitionEditView-CNd3Cuzq.js} +7 -7
  75. package/dist/assets/{TestDefinitionListView-m3RGW84j.js → TestDefinitionListView-BwTWIaAM.js} +1 -1
  76. package/dist/assets/{TestDefinitionNewView-BdBvbajQ.js → TestDefinitionNewView-BQas0_G1.js} +2 -2
  77. package/dist/assets/{TestDefinitionRootView-DJnT-m57.js → TestDefinitionRootView-D971MFye.js} +1 -1
  78. package/dist/assets/{VariablesView-C7i_CSj8.js → VariablesView-DcBBuFxh.js} +3 -3
  79. package/dist/assets/{WorkerView-GWMai3R9.js → WorkerView-DSgBNIeb.js} +6 -6
  80. package/dist/assets/{WorkflowActivator-SziK5CNk.js → WorkflowActivator-CPCbgb_n.js} +2 -2
  81. package/dist/assets/{WorkflowExecutionsInfoAccordion-DENHBjmU.js → WorkflowExecutionsInfoAccordion-Bc6vzAZu.js} +1 -1
  82. package/dist/assets/{WorkflowExecutionsLandingPage-BzDiGWu4.js → WorkflowExecutionsLandingPage-BPPS4V9i.js} +2 -2
  83. package/dist/assets/{WorkflowExecutionsPreview-DqdkoKXB.js → WorkflowExecutionsPreview-Bbb5MB8Z.js} +6 -6
  84. package/dist/assets/{WorkflowExecutionsView-AxW7n6yq.js → WorkflowExecutionsView-Pz-7iHJY.js} +11 -9
  85. package/dist/assets/{WorkflowHistory-BVlsuqfI.js → WorkflowHistory-Czo9IuI6.js} +3 -3
  86. package/dist/assets/{WorkflowOnboardingView-fOW1AS_n.js → WorkflowOnboardingView-B8DdkfJ5.js} +1 -1
  87. package/dist/assets/{WorkflowPreview-ChN9npJk.js → WorkflowPreview-eVlO1itk.js} +1 -1
  88. package/dist/assets/{WorkflowsView-s_WHwcWN.js → WorkflowsView-Cr2D0vym.js} +9 -9
  89. package/dist/assets/{chartjs.utils-wOlz1LMy.js → chartjs.utils-Dk1WO3Mr.js} +2 -2
  90. package/dist/assets/{dateFormatter-yaAmYK7_.js → dateFormatter-C8N5khiG.js} +1 -1
  91. package/dist/assets/{easyAiWorkflowUtils-CVW2fylI.js → easyAiWorkflowUtils-CLqHnasO.js} +1 -1
  92. package/dist/assets/{global-link-actions-X1_8ARhd.js → global-link-actions-BvoZh8u9.js} +1 -1
  93. package/dist/assets/{import-curl-DdqJa2Tm.js → import-curl-BpxkGYMX.js} +1 -1
  94. package/dist/assets/{index-B7FgXPOI.js → index-B6eunbxp.js} +2871 -2467
  95. package/dist/assets/{index-CK1EcLzg.js → index-Br8T1Gn6.js} +1 -1
  96. package/dist/assets/{index-sq5ggyEC.css → index-DCpy4nCU.css} +124 -0
  97. package/dist/assets/{pickBy-s5T-2ufr.js → pickBy-8Urz9lDY.js} +1 -1
  98. package/dist/assets/{templateActions-sdO4R-bv.js → templateActions-DzjysjbQ.js} +1 -1
  99. package/dist/assets/{useBeforeUnload-CQPMw1S7.js → useBeforeUnload-DxrN8vOO.js} +1 -1
  100. package/dist/assets/{useCanvasMapping-DRc556sb.js → useCanvasMapping-C2BQB9QB.js} +21 -18
  101. package/dist/assets/{useCanvasOperations-B0S86JW0.js → useCanvasOperations-DaP5jKbH.js} +2 -2
  102. package/dist/assets/{useClearExecutionButtonVisible-C3SJ4iFv.js → useClearExecutionButtonVisible-BV-jMf2m.js} +2 -2
  103. package/dist/assets/{useExecutionDebugging-CJwhg6O9.js → useExecutionDebugging-0pPCimcw.js} +1 -1
  104. package/dist/assets/{useExecutionHelpers-BWNgdgwx.js → useExecutionHelpers-DIvhViMz.js} +2 -2
  105. package/dist/assets/{useImportCurlCommand-DAljDdWP.js → useImportCurlCommand-BWf4R83s.js} +19 -10
  106. package/dist/assets/usePushConnection-Pobjq0U9.js +632 -0
  107. package/dist/assets/{useTestDefinitionForm-CLiOMqSh.js → useTestDefinitionForm-BA3IS_2B.js} +1 -1
  108. package/dist/assets/{useWorkflowActivate-yVdxh8CC.js → useWorkflowActivate-DFqvrpj6.js} +1 -1
  109. package/dist/assets/useWorkflowSaving-BACesUoL.js +66 -0
  110. package/dist/index.html +2 -2
  111. package/package.json +1 -1
  112. package/dist/assets/CollectionParameter-X0kImkTc.js +0 -4
  113. package/dist/assets/usePushConnection-BBpCn7jd.js +0 -537
@@ -0,0 +1,66 @@
1
+ import { H as useUIStore, a3 as useNpsSurveyStore, Q as useWorkflowsStore, a5 as useWorkflowHelpers, ai as useMessage, c as useI18n, cj as MODAL_CLOSE, S as PLACEHOLDER_EMPTY_WORKFLOW_ID, ck as MODAL_CANCEL, aj as MODAL_CONFIRM, V as VIEWS } from "./index-B6eunbxp.js";
2
+ function useWorkflowSaving({ router }) {
3
+ const uiStore = useUIStore();
4
+ const npsSurveyStore = useNpsSurveyStore();
5
+ const message = useMessage();
6
+ const i18n = useI18n();
7
+ const workflowsStore = useWorkflowsStore();
8
+ const { saveCurrentWorkflow } = useWorkflowHelpers({ router });
9
+ async function promptSaveUnsavedWorkflowChanges(next, {
10
+ confirm = async () => true,
11
+ cancel = async () => {
12
+ }
13
+ } = {}) {
14
+ if (!uiStore.stateIsDirty) {
15
+ next();
16
+ return;
17
+ }
18
+ const response = await message.confirm(
19
+ i18n.baseText("generic.unsavedWork.confirmMessage.message"),
20
+ {
21
+ title: i18n.baseText("generic.unsavedWork.confirmMessage.headline"),
22
+ type: "warning",
23
+ confirmButtonText: i18n.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),
24
+ cancelButtonText: i18n.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),
25
+ showClose: true
26
+ }
27
+ );
28
+ switch (response) {
29
+ case MODAL_CONFIRM:
30
+ const saved = await saveCurrentWorkflow({}, false);
31
+ if (saved) {
32
+ await npsSurveyStore.fetchPromptsData();
33
+ uiStore.stateIsDirty = false;
34
+ const goToNext = await confirm();
35
+ next(goToNext);
36
+ } else {
37
+ stayOnCurrentWorkflow(next);
38
+ }
39
+ return;
40
+ case MODAL_CANCEL:
41
+ await cancel();
42
+ uiStore.stateIsDirty = false;
43
+ next();
44
+ return;
45
+ case MODAL_CLOSE:
46
+ if (workflowsStore.workflow.id !== PLACEHOLDER_EMPTY_WORKFLOW_ID) {
47
+ stayOnCurrentWorkflow(next);
48
+ }
49
+ return;
50
+ }
51
+ }
52
+ function stayOnCurrentWorkflow(next) {
53
+ next(
54
+ router.resolve({
55
+ name: VIEWS.WORKFLOW,
56
+ params: { name: workflowsStore.workflow.id }
57
+ })
58
+ );
59
+ }
60
+ return {
61
+ promptSaveUnsavedWorkflowChanges
62
+ };
63
+ }
64
+ export {
65
+ useWorkflowSaving as u
66
+ };
package/dist/index.html CHANGED
@@ -16,8 +16,8 @@
16
16
  <script>!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled getFeatureFlag onFeatureFlags reloadFeatureFlags".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[])</script>
17
17
 
18
18
  <title>n8n.io - Workflow Automation</title>
19
- <script type="module" crossorigin src="/{{BASE_PATH}}/assets/index-B7FgXPOI.js"></script>
20
- <link rel="stylesheet" crossorigin href="/{{BASE_PATH}}/assets/index-sq5ggyEC.css">
19
+ <script type="module" crossorigin src="/{{BASE_PATH}}/assets/index-B6eunbxp.js"></script>
20
+ <link rel="stylesheet" crossorigin href="/{{BASE_PATH}}/assets/index-DCpy4nCU.css">
21
21
  </head>
22
22
  <body>
23
23
  <noscript>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-editor-ui",
3
- "version": "1.91.0",
3
+ "version": "1.92.0",
4
4
  "description": "Workflow Editor UI for n8n",
5
5
  "main": "index.js",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -1,4 +0,0 @@
1
- import { hp as _sfc_main } from "./index-B7FgXPOI.js";
2
- export {
3
- _sfc_main as default
4
- };
@@ -1,537 +0,0 @@
1
- import { dq as makeRestApiRequest, O as defineStore, Z as useRootStore, d as defineComponent, ch as resolveDirective, i as createElementBlock, g as openBlock, aA as withDirectives, k as createBaseVNode, t as toDisplayString, m as unref, c as useI18n, a5 as useWorkflowHelpers, bA as useNodeHelpers, a as useToast, bR as useCredentialsStore, bz as useNodeTypesStore, P as usePushConnectionStore, p as useSettingsStore, H as useUIStore, Q as useWorkflowsStore, dr as useAssistantStore, r as ref, ds as clearPopupWindowState, ag as useTelemetry, dt as parse, du as hasTrimmedItem, dv as codeNodeEditorEventBus, ak as WORKFLOW_SETTINGS_MODAL_KEY, dw as generateNodesGraph, aq as h, dx as getTriggerNodeServiceName, dy as hasTrimmedData, aP as useExternalHooks, dz as useSchemaPreviewStore } from "./index-B7FgXPOI.js";
2
- import { g as globalLinkActionsEventBus } from "./global-link-actions-X1_8ARhd.js";
3
- import { g as getEasyAiWorkflowJson } from "./easyAiWorkflowUtils-CVW2fylI.js";
4
- const GET_STATUS_ENDPOINT = "/orchestration/worker/status";
5
- const sendGetWorkerStatus = async (context) => {
6
- await makeRestApiRequest(context, "POST", GET_STATUS_ENDPOINT);
7
- };
8
- const WORKER_HISTORY_LENGTH = 100;
9
- const STALE_SECONDS = 120 * 1e3;
10
- const useOrchestrationStore = defineStore("orchestrationManager", {
11
- state: () => ({
12
- initialStatusReceived: false,
13
- workers: {},
14
- workersHistory: {},
15
- workersLastUpdated: {},
16
- statusInterval: null
17
- }),
18
- actions: {
19
- updateWorkerStatus(data) {
20
- this.workers[data.senderId] = data;
21
- if (!this.workersHistory[data.senderId]) {
22
- this.workersHistory[data.senderId] = [];
23
- }
24
- this.workersHistory[data.senderId].push({ data, timestamp: Date.now() });
25
- if (this.workersHistory[data.senderId].length > WORKER_HISTORY_LENGTH) {
26
- this.workersHistory[data.senderId].shift();
27
- }
28
- this.workersLastUpdated[data.senderId] = Date.now();
29
- this.initialStatusReceived = true;
30
- },
31
- removeStaleWorkers() {
32
- for (const id in this.workersLastUpdated) {
33
- if (this.workersLastUpdated[id] + STALE_SECONDS < Date.now()) {
34
- delete this.workers[id];
35
- delete this.workersHistory[id];
36
- delete this.workersLastUpdated[id];
37
- }
38
- }
39
- },
40
- startWorkerStatusPolling() {
41
- const rootStore = useRootStore();
42
- if (!this.statusInterval) {
43
- this.statusInterval = setInterval(async () => {
44
- await sendGetWorkerStatus(rootStore.restApiContext);
45
- this.removeStaleWorkers();
46
- }, 1e3);
47
- }
48
- },
49
- stopWorkerStatusPolling() {
50
- if (this.statusInterval) {
51
- clearInterval(this.statusInterval);
52
- this.statusInterval = null;
53
- }
54
- },
55
- getWorkerLastUpdated(workerId) {
56
- return this.workersLastUpdated[workerId] ?? 0;
57
- },
58
- getWorkerStatus(workerId) {
59
- return this.workers[workerId];
60
- },
61
- getWorkerStatusHistory(workerId) {
62
- return this.workersHistory[workerId] ?? [];
63
- }
64
- }
65
- });
66
- const _hoisted_1 = { "data-test-id": "sanitized-error-message" };
67
- const _hoisted_2 = ["data-action-parameter-node"];
68
- const _sfc_main = /* @__PURE__ */ defineComponent({
69
- __name: "NodeExecutionErrorMessage",
70
- props: {
71
- nodeName: {},
72
- errorMessage: {}
73
- },
74
- setup(__props) {
75
- const i18n = useI18n();
76
- return (_ctx, _cache) => {
77
- const _directive_n8n_html = resolveDirective("n8n-html");
78
- return openBlock(), createElementBlock("div", null, [
79
- withDirectives(createBaseVNode("span", _hoisted_1, null, 512), [
80
- [_directive_n8n_html, _ctx.errorMessage]
81
- ]),
82
- _cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1)),
83
- createBaseVNode("a", {
84
- "data-action": "openNodeDetail",
85
- "data-action-parameter-node": _ctx.nodeName
86
- }, toDisplayString(unref(i18n).baseText("node.executionError.openNode")), 9, _hoisted_2)
87
- ]);
88
- };
89
- }
90
- });
91
- function usePushConnection({ router }) {
92
- const workflowHelpers = useWorkflowHelpers({ router });
93
- const nodeHelpers = useNodeHelpers();
94
- const toast = useToast();
95
- const i18n = useI18n();
96
- const telemetry = useTelemetry();
97
- const credentialsStore = useCredentialsStore();
98
- const nodeTypesStore = useNodeTypesStore();
99
- const orchestrationManagerStore = useOrchestrationStore();
100
- const pushStore = usePushConnectionStore();
101
- const settingsStore = useSettingsStore();
102
- const uiStore = useUIStore();
103
- const workflowsStore = useWorkflowsStore();
104
- const assistantStore = useAssistantStore();
105
- const retryTimeout = ref(null);
106
- const pushMessageQueue = ref([]);
107
- const removeEventListener = ref(null);
108
- function initialize() {
109
- removeEventListener.value = pushStore.addEventListener((message) => {
110
- void pushMessageReceived(message);
111
- });
112
- }
113
- function terminate() {
114
- if (typeof removeEventListener.value === "function") {
115
- removeEventListener.value();
116
- }
117
- }
118
- function queuePushMessage(event, retryAttempts) {
119
- pushMessageQueue.value.push({ message: event, retriesLeft: retryAttempts });
120
- if (retryTimeout.value === null) {
121
- retryTimeout.value = setTimeout(processWaitingPushMessages, 20);
122
- }
123
- }
124
- async function processWaitingPushMessages() {
125
- if (retryTimeout.value !== null) {
126
- clearTimeout(retryTimeout.value);
127
- retryTimeout.value = null;
128
- }
129
- const queueLength = pushMessageQueue.value.length;
130
- for (let i = 0; i < queueLength; i++) {
131
- const messageData = pushMessageQueue.value.shift();
132
- const result = await pushMessageReceived(messageData.message, true);
133
- if (!result) {
134
- messageData.retriesLeft -= 1;
135
- if (messageData.retriesLeft > 0) {
136
- pushMessageQueue.value.unshift(messageData);
137
- }
138
- break;
139
- }
140
- }
141
- if (pushMessageQueue.value.length !== 0 && retryTimeout.value === null) {
142
- retryTimeout.value = setTimeout(processWaitingPushMessages, 25);
143
- }
144
- }
145
- async function pushMessageReceived(receivedData, isRetry) {
146
- const retryAttempts = 5;
147
- if (receivedData.type === "sendWorkerStatusMessage") {
148
- const pushData = receivedData.data;
149
- orchestrationManagerStore.updateWorkerStatus(pushData.status);
150
- return true;
151
- }
152
- if (receivedData.type === "sendConsoleMessage") {
153
- const pushData = receivedData.data;
154
- console.log(pushData.source, ...pushData.messages);
155
- return true;
156
- }
157
- if (!["testWebhookReceived"].includes(receivedData.type) && isRetry !== true && pushMessageQueue.value.length) {
158
- queuePushMessage(receivedData, retryAttempts);
159
- return false;
160
- }
161
- if (receivedData.type === "executionStarted") {
162
- if (!workflowsStore.activeExecutionId) {
163
- workflowsStore.setActiveExecutionId(receivedData.data.executionId);
164
- }
165
- }
166
- if (receivedData.type === "nodeExecuteAfter" || receivedData.type === "nodeExecuteBefore" || receivedData.type === "executionStarted") {
167
- if (!uiStore.isActionActive.workflowRunning) {
168
- return false;
169
- }
170
- const pushData = receivedData.data;
171
- if (workflowsStore.activeExecutionId !== pushData.executionId) {
172
- if (isRetry !== true) {
173
- queuePushMessage(receivedData, retryAttempts);
174
- }
175
- return false;
176
- }
177
- }
178
- if (receivedData.type === "workflowFailedToActivate" && workflowsStore.workflowId === receivedData.data.workflowId) {
179
- workflowsStore.setWorkflowInactive(receivedData.data.workflowId);
180
- workflowsStore.setActive(false);
181
- toast.showError(
182
- new Error(receivedData.data.errorMessage),
183
- i18n.baseText("workflowActivator.showError.title", {
184
- interpolate: { newStateName: "activated" }
185
- }) + ":"
186
- );
187
- return true;
188
- }
189
- if (receivedData.type === "workflowActivated") {
190
- workflowsStore.setWorkflowActive(receivedData.data.workflowId);
191
- return true;
192
- }
193
- if (receivedData.type === "workflowDeactivated") {
194
- workflowsStore.setWorkflowInactive(receivedData.data.workflowId);
195
- return true;
196
- }
197
- if (receivedData.type === "executionFinished" || receivedData.type === "executionRecovered") {
198
- if (!uiStore.isActionActive.workflowRunning) {
199
- return false;
200
- }
201
- if (receivedData.type === "executionFinished") {
202
- clearPopupWindowState();
203
- const workflow2 = workflowsStore.getWorkflowById(receivedData.data.workflowId);
204
- if (workflow2?.meta?.templateId) {
205
- const easyAiWorkflowJson = getEasyAiWorkflowJson();
206
- const isEasyAIWorkflow = workflow2.meta.templateId === easyAiWorkflowJson.meta.templateId;
207
- if (isEasyAIWorkflow) {
208
- telemetry.track(
209
- "User executed test AI workflow",
210
- {
211
- status: receivedData.data.status
212
- },
213
- { withPostHog: true }
214
- );
215
- }
216
- }
217
- }
218
- const { executionId } = receivedData.data;
219
- if (executionId !== workflowsStore.activeExecutionId) {
220
- if (isRetry !== true) {
221
- queuePushMessage(receivedData, retryAttempts);
222
- }
223
- return false;
224
- }
225
- let showedSuccessToast = false;
226
- let executionData;
227
- if (receivedData.type === "executionFinished" && receivedData.data.rawData) {
228
- const { workflowId, status, rawData } = receivedData.data;
229
- executionData = {
230
- workflowId,
231
- workflowData: workflowsStore.workflow,
232
- data: parse(rawData),
233
- status,
234
- startedAt: workflowsStore.workflowExecutionData?.startedAt ?? /* @__PURE__ */ new Date(),
235
- stoppedAt: /* @__PURE__ */ new Date()
236
- };
237
- } else {
238
- uiStore.setProcessingExecutionResults(true);
239
- if (receivedData.type === "executionFinished" && receivedData.data.status === "success") {
240
- workflowHelpers.setDocumentTitle(
241
- workflowsStore.getWorkflowById(receivedData.data.workflowId)?.name,
242
- "IDLE"
243
- );
244
- uiStore.removeActiveAction("workflowRunning");
245
- toast.showMessage({
246
- title: i18n.baseText("pushConnection.workflowExecutedSuccessfully"),
247
- type: "success"
248
- });
249
- showedSuccessToast = true;
250
- }
251
- let execution;
252
- try {
253
- execution = await workflowsStore.fetchExecutionDataById(executionId);
254
- if (!execution?.data) {
255
- uiStore.setProcessingExecutionResults(false);
256
- return false;
257
- }
258
- executionData = {
259
- workflowId: execution.workflowId,
260
- workflowData: workflowsStore.workflow,
261
- data: parse(execution.data),
262
- status: execution.status,
263
- startedAt: workflowsStore.workflowExecutionData?.startedAt,
264
- stoppedAt: receivedData.type === "executionFinished" ? /* @__PURE__ */ new Date() : void 0
265
- };
266
- } catch {
267
- uiStore.setProcessingExecutionResults(false);
268
- return false;
269
- }
270
- }
271
- const iRunExecutionData = {
272
- startData: executionData.data?.startData,
273
- resultData: executionData.data?.resultData ?? { runData: {} },
274
- executionData: executionData.data?.executionData
275
- };
276
- if (workflowsStore.workflowExecutionData?.workflowId === executionData.workflowId) {
277
- const activeRunData = workflowsStore.workflowExecutionData?.data?.resultData?.runData;
278
- if (activeRunData) {
279
- for (const key of Object.keys(activeRunData)) {
280
- if (hasTrimmedItem(activeRunData[key])) continue;
281
- iRunExecutionData.resultData.runData[key] = activeRunData[key];
282
- }
283
- }
284
- }
285
- uiStore.setProcessingExecutionResults(false);
286
- let runDataExecutedErrorMessage = getExecutionError(iRunExecutionData);
287
- if (executionData.status === "crashed") {
288
- runDataExecutedErrorMessage = i18n.baseText("pushConnection.executionFailed.message");
289
- } else if (executionData.status === "canceled") {
290
- runDataExecutedErrorMessage = i18n.baseText(
291
- "executionsList.showMessage.stopExecution.message",
292
- {
293
- interpolate: { activeExecutionId: workflowsStore.activeExecutionId }
294
- }
295
- );
296
- }
297
- const lineNumber = iRunExecutionData.resultData?.error?.lineNumber;
298
- codeNodeEditorEventBus.emit("highlightLine", lineNumber ?? "last");
299
- const workflow = workflowHelpers.getCurrentWorkflow();
300
- if (executionData.data?.waitTill !== void 0) {
301
- const workflowSettings = workflowsStore.workflowSettings;
302
- const saveManualExecutions = settingsStore.saveManualExecutions;
303
- const isSavingExecutions = workflowSettings.saveManualExecutions === void 0 ? saveManualExecutions : workflowSettings.saveManualExecutions;
304
- if (!isSavingExecutions) {
305
- globalLinkActionsEventBus.emit("registerGlobalLinkAction", {
306
- key: "open-settings",
307
- action: async () => {
308
- if (workflowsStore.isNewWorkflow) await workflowHelpers.saveAsNewWorkflow();
309
- uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);
310
- }
311
- });
312
- }
313
- workflowHelpers.setDocumentTitle(workflow.name, "IDLE");
314
- } else if (executionData.status === "error" || executionData.status === "canceled") {
315
- workflowHelpers.setDocumentTitle(workflow.name, "ERROR");
316
- if (iRunExecutionData.resultData.error?.name === "ExpressionError" && iRunExecutionData.resultData.error.functionality === "pairedItem") {
317
- const error = iRunExecutionData.resultData.error;
318
- void workflowHelpers.getWorkflowDataToSave().then((workflowData) => {
319
- const eventData = {
320
- caused_by_credential: false,
321
- error_message: error.description,
322
- error_title: error.message,
323
- error_type: error.context.type,
324
- node_graph_string: JSON.stringify(
325
- generateNodesGraph(
326
- workflowData,
327
- workflowHelpers.getNodeTypes()
328
- ).nodeGraph
329
- ),
330
- workflow_id: workflowsStore.workflowId
331
- };
332
- if (error.context.nodeCause && ["paired_item_no_info", "paired_item_invalid_info"].includes(
333
- error.context.type
334
- )) {
335
- const node = workflow.getNode(error.context.nodeCause);
336
- if (node) {
337
- eventData.is_pinned = !!workflow.getPinDataOfNode(node.name);
338
- eventData.mode = node.parameters.mode;
339
- eventData.node_type = node.type;
340
- eventData.operation = node.parameters.operation;
341
- eventData.resource = node.parameters.resource;
342
- }
343
- }
344
- telemetry.track("Instance FE emitted paired item error", eventData, {
345
- withPostHog: true
346
- });
347
- });
348
- }
349
- if (iRunExecutionData.resultData.error?.name === "SubworkflowOperationError") {
350
- const error = iRunExecutionData.resultData.error;
351
- workflowsStore.subWorkflowExecutionError = error;
352
- toast.showMessage({
353
- title: error.message,
354
- message: error.description,
355
- type: "error",
356
- duration: 0
357
- });
358
- } else if ((iRunExecutionData.resultData.error?.name === "NodeOperationError" || iRunExecutionData.resultData.error?.name === "NodeApiError") && iRunExecutionData.resultData.error.functionality === "configuration-node") {
359
- let title;
360
- const nodeError = iRunExecutionData.resultData.error;
361
- if (nodeError.node.name) {
362
- title = `Error in sub-node ‘${nodeError.node.name}‘`;
363
- } else {
364
- title = "Problem executing workflow";
365
- }
366
- toast.showMessage({
367
- title,
368
- message: h(_sfc_main, {
369
- errorMessage: nodeError?.description ?? runDataExecutedErrorMessage,
370
- nodeName: nodeError.node.name
371
- }),
372
- type: "error",
373
- duration: 0
374
- });
375
- } else {
376
- if (executionData.status === "canceled") {
377
- toast.showMessage({
378
- title: i18n.baseText("nodeView.showMessage.stopExecutionTry.title"),
379
- type: "success"
380
- });
381
- } else {
382
- let title;
383
- if (iRunExecutionData.resultData.lastNodeExecuted) {
384
- title = `Problem in node ‘${iRunExecutionData.resultData.lastNodeExecuted}‘`;
385
- } else {
386
- title = "Problem executing workflow";
387
- }
388
- toast.showMessage({
389
- title,
390
- message: runDataExecutedErrorMessage,
391
- type: "error",
392
- duration: 0
393
- });
394
- }
395
- }
396
- } else {
397
- workflowHelpers.setDocumentTitle(workflow.name, "IDLE");
398
- const execution = workflowsStore.getWorkflowExecution;
399
- if (execution?.executedNode) {
400
- const node = workflowsStore.getNodeByName(execution.executedNode);
401
- const nodeType = node && nodeTypesStore.getNodeType(node.type, node.typeVersion);
402
- const nodeOutput = execution && execution.executedNode && execution.data?.resultData?.runData?.[execution.executedNode];
403
- if (nodeType?.polling && !nodeOutput) {
404
- toast.showMessage({
405
- title: i18n.baseText("pushConnection.pollingNode.dataNotFound", {
406
- interpolate: {
407
- service: getTriggerNodeServiceName(nodeType)
408
- }
409
- }),
410
- message: i18n.baseText("pushConnection.pollingNode.dataNotFound.message", {
411
- interpolate: {
412
- service: getTriggerNodeServiceName(nodeType)
413
- }
414
- }),
415
- type: "success"
416
- });
417
- } else {
418
- toast.showMessage({
419
- title: i18n.baseText("pushConnection.nodeExecutedSuccessfully"),
420
- type: "success"
421
- });
422
- }
423
- } else if (!showedSuccessToast) {
424
- toast.showMessage({
425
- title: i18n.baseText("pushConnection.workflowExecutedSuccessfully"),
426
- type: "success"
427
- });
428
- }
429
- }
430
- if (workflowsStore.getWorkflowRunData && !hasTrimmedData(workflowsStore.getWorkflowRunData)) {
431
- iRunExecutionData.resultData.runData = workflowsStore.getWorkflowRunData;
432
- }
433
- workflowsStore.executingNode.length = 0;
434
- workflowsStore.setWorkflowExecutionData(executionData);
435
- uiStore.removeActiveAction("workflowRunning");
436
- nodeHelpers.updateNodesExecutionIssues();
437
- const lastNodeExecuted = iRunExecutionData.resultData.lastNodeExecuted;
438
- let itemsCount = 0;
439
- if (lastNodeExecuted && iRunExecutionData.resultData.runData[lastNodeExecuted] && !runDataExecutedErrorMessage) {
440
- itemsCount = iRunExecutionData.resultData.runData[lastNodeExecuted][0].data.main[0].length;
441
- }
442
- workflowsStore.setActiveExecutionId(null);
443
- void useExternalHooks().run("pushConnection.executionFinished", {
444
- itemsCount,
445
- nodeName: iRunExecutionData.resultData.lastNodeExecuted,
446
- errorMessage: runDataExecutedErrorMessage,
447
- runDataExecutedStartData: iRunExecutionData.startData,
448
- resultDataError: iRunExecutionData.resultData.error
449
- });
450
- } else if (receivedData.type === "executionWaiting") ;
451
- else if (receivedData.type === "executionStarted") {
452
- if (workflowsStore.workflowExecutionData?.data && receivedData.data.flattedRunData) {
453
- workflowsStore.workflowExecutionData.data.resultData.runData = parse(
454
- receivedData.data.flattedRunData
455
- );
456
- }
457
- } else if (receivedData.type === "nodeExecuteAfter") {
458
- const pushData = receivedData.data;
459
- if (pushData.itemCount && pushData.data?.data?.main && Array.isArray(pushData.data.data.main[0]) && pushData.data.data.main[0].length < pushData.itemCount) {
460
- pushData.data.data.main[0]?.push(...new Array(pushData.itemCount - 1).fill({ json: {} }));
461
- }
462
- workflowsStore.updateNodeExecutionData(pushData);
463
- void assistantStore.onNodeExecution(pushData);
464
- void useSchemaPreviewStore().trackSchemaPreviewExecution(pushData);
465
- } else if (receivedData.type === "nodeExecuteBefore") {
466
- workflowsStore.setNodeExecuting(receivedData.data);
467
- } else if (receivedData.type === "testWebhookDeleted") {
468
- const pushData = receivedData.data;
469
- if (pushData.workflowId === workflowsStore.workflowId) {
470
- workflowsStore.executionWaitingForWebhook = false;
471
- uiStore.removeActiveAction("workflowRunning");
472
- }
473
- } else if (receivedData.type === "testWebhookReceived") {
474
- const pushData = receivedData.data;
475
- if (pushData.workflowId === workflowsStore.workflowId) {
476
- workflowsStore.executionWaitingForWebhook = false;
477
- workflowsStore.setActiveExecutionId(pushData.executionId);
478
- }
479
- void processWaitingPushMessages();
480
- } else if (receivedData.type === "reloadNodeType") {
481
- await nodeTypesStore.getNodeTypes();
482
- await nodeTypesStore.getFullNodesProperties([receivedData.data]);
483
- } else if (receivedData.type === "removeNodeType") {
484
- const pushData = receivedData.data;
485
- const nodesToBeRemoved = [pushData];
486
- await credentialsStore.fetchCredentialTypes(false).then(() => {
487
- nodeTypesStore.removeNodeTypes(nodesToBeRemoved);
488
- });
489
- } else if (receivedData.type === "nodeDescriptionUpdated") {
490
- await nodeTypesStore.getNodeTypes();
491
- await credentialsStore.fetchCredentialTypes(true);
492
- }
493
- return true;
494
- }
495
- function getExecutionError(data) {
496
- const error = data.resultData.error;
497
- let errorMessage;
498
- if (data.resultData.lastNodeExecuted && error) {
499
- errorMessage = error.message || error.description;
500
- } else {
501
- errorMessage = i18n.baseText("pushConnection.executionError", {
502
- interpolate: { error: "!" }
503
- });
504
- if (error?.message) {
505
- let nodeName;
506
- if ("node" in error) {
507
- nodeName = typeof error.node === "string" ? error.node : error.node.name;
508
- }
509
- const receivedError = nodeName ? `${nodeName}: ${error.message}` : error.message;
510
- errorMessage = i18n.baseText("pushConnection.executionError", {
511
- interpolate: {
512
- error: `.${i18n.baseText("pushConnection.executionError.details", {
513
- interpolate: {
514
- details: receivedError
515
- }
516
- })}`
517
- }
518
- });
519
- }
520
- }
521
- return errorMessage;
522
- }
523
- return {
524
- initialize,
525
- terminate,
526
- pushMessageReceived,
527
- queuePushMessage,
528
- processWaitingPushMessages,
529
- pushMessageQueue,
530
- retryTimeout
531
- };
532
- }
533
- export {
534
- WORKER_HISTORY_LENGTH as W,
535
- useOrchestrationStore as a,
536
- usePushConnection as u
537
- };