n8n-editor-ui 1.91.1 → 1.93.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.
- package/dist/assets/{AnimatedSpinner-BrkRvAXQ.js → AnimatedSpinner-hbTZDd93.js} +1 -1
- package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DRamY8Fo.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-CYzc5StE.js} +1 -1
- package/dist/assets/{AuthView-ehh7NFh5.js → AuthView-8SLMP0H_.js} +2 -2
- package/dist/assets/{CanvasChatSwitch-DUBgoMXw.js → CanvasChatSwitch-Dt8TgNJg.js} +22 -10
- package/dist/assets/{ChangePasswordView-BLFb7_-o.js → ChangePasswordView-DIRyDp89.js} +3 -3
- package/dist/assets/CollectionParameter-Cj4t6-hd.js +4 -0
- package/dist/assets/{CredentialsView-1uYUpp0G.js → CredentialsView-B6-VxAJ6.js} +26 -11
- package/dist/assets/{DemoFooter-CNfkqkRC.js → DemoFooter-CIHwH5PG.js} +8 -8
- package/dist/assets/{ErrorView-CmYweWFA.js → ErrorView-C7i0TZwT.js} +1 -1
- package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-DAWTDTON.js → ExecutionsTime.vue_vue_type_script_setup_true_lang--2G21NNR.js} +2 -2
- package/dist/assets/{ExecutionsView-fotg1R4V.js → ExecutionsView-C_YtciAr.js} +10 -9
- package/dist/assets/{FileSaver.min-CcnqpaV-.js → FileSaver.min-bgn7Q9Gt.js} +1 -1
- package/dist/assets/{FixedCollectionParameter-BYR4RzWw.js → FixedCollectionParameter-BPCJ5aaq.js} +1 -1
- package/dist/assets/{ForgotMyPasswordView-CQMKtpr-.js → ForgotMyPasswordView-DyUaGd6Z.js} +3 -3
- package/dist/assets/{InsightsChartAverageRuntime-B-9BU5qw.js → InsightsChartAverageRuntime-BB2I2vpV.js} +4 -4
- package/dist/assets/{InsightsChartFailed-Bd1BlFEm.js → InsightsChartFailed-CN_Rl3Bl.js} +4 -4
- package/dist/assets/{InsightsChartFailureRate-DPTCueAp.js → InsightsChartFailureRate-CHKlg6tg.js} +4 -4
- package/dist/assets/{InsightsChartTimeSaved-CSVKB08W.js → InsightsChartTimeSaved-Cd05cM8q.js} +4 -4
- package/dist/assets/{InsightsChartTotal-Bxjmisao.js → InsightsChartTotal-ChAO7myf.js} +4 -4
- package/dist/assets/{InsightsDashboard-5cOORj5z.js → InsightsDashboard-BeCfBVUz.js} +10 -10
- package/dist/assets/{InsightsPaywall-Bdo_3Ic_.js → InsightsPaywall-Chz8CDc3.js} +1 -1
- package/dist/assets/{InsightsSummary-DB62HhNM.js → InsightsSummary-MECenLJQ.js} +1 -1
- package/dist/assets/{InsightsTableWorkflows-BEC5Yh0b.js → InsightsTableWorkflows-5rpYY7YT.js} +2 -2
- package/dist/assets/{Logo-CK8euEWT.js → Logo-DUDCllkm.js} +1 -1
- package/dist/assets/{LogsPanel-CrGEYFLo.js → LogsPanel-D9r5AcQH.js} +75 -106
- package/dist/assets/{LogsPanel-DLC2TAqh.css → LogsPanel-mTaFEGk_.css} +38 -34
- package/dist/assets/{MainHeader-CEPLiR-5.css → MainHeader-CEMGASqv.css} +18 -11
- package/dist/assets/{MainHeader-C7XOaZKu.js → MainHeader-DkKOOZ_D.js} +145 -79
- package/dist/assets/{MainSidebar-CKMiDGvH.css → MainSidebar-D1_1YFQZ.css} +13 -12
- package/dist/assets/{MainSidebar-DD_ugRL3.js → MainSidebar-ZUBIWeXm.js} +36 -19
- package/dist/assets/{NodeCreation-S2FoBcnW.js → NodeCreation-DCfAFuL5.js} +10 -5
- package/dist/assets/{NodeCreator-D9fmPdS2.css → NodeCreator-D18StsVZ.css} +1021 -174
- package/dist/assets/{NodeCreator-D6TKVgLu.js → NodeCreator-a0YVv1IE.js} +863 -418
- package/dist/assets/{NodeDetailsView-DtvMtBqp.js → NodeDetailsView-C5_hVJzj.js} +60 -47
- package/dist/assets/{NodeDetailsView-CGgV4Pn_.css → NodeDetailsView-pYP-34nS.css} +20 -20
- package/dist/assets/{NodeView-BPhaaoWK.js → NodeView-Bk9h8GYy.js} +49 -25
- package/dist/assets/{ProjectCardBadge-C_L_pqWA.js → ProjectCardBadge-DRlDZx3d.js} +38 -2
- package/dist/assets/{ProjectHeader-C0FZTxjm.js → ProjectHeader-DNm605Kk.js} +106 -64
- package/dist/assets/{ProjectSettings-DlggJ6Ti.js → ProjectSettings-Dge_6KaR.js} +3 -2
- package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-BNtCDFSj.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-CUf0LkWR.js} +1 -1
- package/dist/assets/{ResourcesListLayout-HzoSFUaj.js → ResourcesListLayout-Bbl-1i4l.js} +156 -53
- package/dist/assets/{ResourcesListLayout-CtGME7aU.css → ResourcesListLayout-DuNjbsMn.css} +8 -8
- package/dist/assets/{RunData-C9dtm1M2.css → RunData-DQeENuzG.css} +12 -2
- package/dist/assets/{RunData-D8Eax0cQ.js → RunData-b0RE2JWc.js} +418 -207
- package/dist/assets/{RunDataAi-BF2gZZGr.css → RunDataAi-D9VLFXIf.css} +10 -51
- package/dist/assets/{RunDataAi-BUnCQIRN.js → RunDataAi-DnWcCR_0.js} +27 -310
- package/dist/assets/{RunDataJson-DXd3nZxI.js → RunDataJson-CptVuHuA.js} +7 -7
- package/dist/assets/{RunDataJsonActions-aivOaol2.js → RunDataJsonActions-3jjDztw7.js} +1 -1
- package/dist/assets/RunDataParsedAiContent-9EEUzCKp.css +176 -0
- package/dist/assets/RunDataParsedAiContent-BbXv-NPD.js +148 -0
- package/dist/assets/{RunDataSearch-DJ9BZGTu.js → RunDataSearch-B90wjsDA.js} +1 -1
- package/dist/assets/{RunDataTable-vEPCwbcC.js → RunDataTable-CpS78GlT.js} +3 -3
- package/dist/assets/{SamlOnboarding--OTxMEws.js → SamlOnboarding-Ch9K5rRW.js} +3 -3
- package/dist/assets/{SettingsApiView-BulxWyyY.js → SettingsApiView-9GU5n_rm.js} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-4wwPXFO2.js → SettingsCommunityNodesView-CPnVRzNX.js} +24 -11
- package/dist/assets/{SettingsExternalSecrets-zt7dxBKK.js → SettingsExternalSecrets-D7xTMV9h.js} +1 -1
- package/dist/assets/{SettingsLdapView-xneO6UIv.js → SettingsLdapView-OfrjGKkt.js} +1 -1
- package/dist/assets/{SettingsLogStreamingView-_h8wUzum.js → SettingsLogStreamingView-C_VnOaeX.js} +1 -1
- package/dist/assets/{SettingsPersonalView-CwYMP4sk.js → SettingsPersonalView-Dm24akPV.js} +14 -13
- package/dist/assets/{SettingsSourceControl-B9Tg93u3.js → SettingsSourceControl-DDCmL82j.js} +1 -1
- package/dist/assets/{SettingsSso-XaL1PzfW.js → SettingsSso-BGGQ0Cpg.js} +14 -1
- package/dist/assets/{SettingsUsageAndPlan-Ci15FW81.js → SettingsUsageAndPlan-BzO_zdkH.js} +1 -1
- package/dist/assets/{SettingsUsersView-DBJV4vSK.js → SettingsUsersView-DHQUqhqB.js} +1 -1
- package/dist/assets/{SettingsView-DMzdPF-1.js → SettingsView-CbtAqjOX.js} +1 -1
- package/dist/assets/{SetupView-BqWgdvDq.js → SetupView-BME1OE6U.js} +3 -3
- package/dist/assets/{SetupWorkflowCredentialsButton-B2wnuUnF.js → SetupWorkflowCredentialsButton-DZr4TCPC.js} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-BwC_wFSc.js → SetupWorkflowFromTemplateView-CPkKEY04.js} +3 -3
- package/dist/assets/{SigninView-DpTLJJwD.js → SigninView-DUeRvOiY.js} +3 -3
- package/dist/assets/{SignoutView-dkTtOCo1.js → SignoutView-BC7SBunZ.js} +1 -1
- package/dist/assets/{SignupView-CJFJJO3L.js → SignupView-B5ecYJ2q.js} +3 -3
- package/dist/assets/{TemplateDetails-84YElIBA.js → TemplateDetails-DjanZgC1.js} +1 -1
- package/dist/assets/{TemplateList-CGsfKuVA.js → TemplateList-8TyNGxY-.js} +1 -1
- package/dist/assets/{TemplatesCollectionView-2y8KZk0I.js → TemplatesCollectionView-BkH4pJCv.js} +5 -5
- package/dist/assets/{TemplatesSearchView-DgosiOzl.js → TemplatesSearchView-Bcdhi1SL.js} +3 -3
- package/dist/assets/{TemplatesView-CgQSZO4a.js → TemplatesView-De2XB6We.js} +1 -1
- package/dist/assets/{TemplatesWorkflowView-2pSUmAbX.js → TemplatesWorkflowView-BVnwtrMa.js} +5 -5
- package/dist/assets/{TestDefinitionEditView-C26sWE7p.js → TestDefinitionEditView-DjmPnrTk.js} +7 -7
- package/dist/assets/{TestDefinitionListView-Cyl6bsLP.js → TestDefinitionListView-BL2s_qBZ.js} +1 -1
- package/dist/assets/{TestDefinitionNewView-CfIZ0atk.js → TestDefinitionNewView-B9BqJZST.js} +2 -2
- package/dist/assets/{TestDefinitionRootView-CYg7HBL-.js → TestDefinitionRootView-AlWyxbc0.js} +1 -1
- package/dist/assets/{VariablesView-BFE9B0_b.js → VariablesView-BZCvPfan.js} +4 -3
- package/dist/assets/{WorkerView-BUMCMS_B.js → WorkerView-CigxqnWi.js} +6 -6
- package/dist/assets/{WorkflowActivator-BDLto9c0.js → WorkflowActivator-B7jRy4L1.js} +8 -4
- package/dist/assets/{WorkflowActivator-DAyH7N29.css → WorkflowActivator-DrMTmuTZ.css} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-manN-WIj.js → WorkflowExecutionsInfoAccordion-C_ZycbsF.js} +1 -1
- package/dist/assets/{WorkflowExecutionsLandingPage-BzGmpGvf.js → WorkflowExecutionsLandingPage-DOqrfKlC.js} +2 -2
- package/dist/assets/{WorkflowExecutionsPreview-CNEV2lom.js → WorkflowExecutionsPreview-B4Cj2gXW.js} +6 -6
- package/dist/assets/{WorkflowExecutionsView-WiNvtAmD.js → WorkflowExecutionsView-RXfP7zkJ.js} +11 -9
- package/dist/assets/{WorkflowHistory-6uJJqB4x.js → WorkflowHistory-DrXrRwIS.js} +37 -19
- package/dist/assets/{WorkflowOnboardingView-CPt_AUR-.js → WorkflowOnboardingView-CXH1vCW2.js} +1 -1
- package/dist/assets/{WorkflowPreview-CHUEX6H6.js → WorkflowPreview-B_MuFEV8.js} +1 -1
- package/dist/assets/{WorkflowsView-B2_HJCJ5.css → WorkflowsView-CQvTAWQ0.css} +24 -13
- package/dist/assets/{WorkflowsView-DbGBRbfc.js → WorkflowsView-D90hfJ35.js} +300 -158
- package/dist/assets/{chartjs.utils-C--HONKb.js → chartjs.utils-DalQn9bk.js} +2 -2
- package/dist/assets/{dateFormatter-DbKqmK4w.js → dateFormatter-BPfJSa6q.js} +1 -1
- package/dist/assets/{easyAiWorkflowUtils-BWgfZ0am.js → easyAiWorkflowUtils-kgtpBx2h.js} +1 -1
- package/dist/assets/{global-link-actions-COf-9vBh.js → global-link-actions-CnWOMvqA.js} +1 -1
- package/dist/assets/{import-curl-BiXaU2jk.js → import-curl-BvX_O56D.js} +1 -1
- package/dist/assets/{index-B6xE9gZ1.js → index-Bb2NNknG.js} +1 -1
- package/dist/assets/{index-BLAboPd2.js → index-DZ6VpjNj.js} +4635 -2824
- package/dist/assets/{index-sq5ggyEC.css → index-yNaoC3fo.css} +363 -97
- package/dist/assets/{pickBy-gZHb6vZ2.js → pickBy-B_HGYyxS.js} +1 -1
- package/dist/assets/{templateActions-DCx74tPa.js → templateActions-DQfZ3ni5.js} +1 -1
- package/dist/assets/{useBeforeUnload-DbfysOS-.js → useBeforeUnload-Cu0LPVWe.js} +1 -1
- package/dist/assets/{useCanvasMapping-CSuq_dYj.js → useCanvasMapping-CTTq6x8X.js} +62 -40
- package/dist/assets/{useCanvasMapping-cuXLM-h-.css → useCanvasMapping-VtpW_QZA.css} +6 -5
- package/dist/assets/{useCanvasOperations-C0pQBHW3.js → useCanvasOperations-u8oSDa_u.js} +96 -445
- package/dist/assets/{useClearExecutionButtonVisible-Cvfxw8xC.js → useClearExecutionButtonVisible-Dwc1_eG9.js} +2 -2
- package/dist/assets/{useExecutionDebugging-D2H5O6fT.js → useExecutionDebugging-rc72wLIp.js} +1 -1
- package/dist/assets/{useExecutionHelpers-C--m0pTQ.js → useExecutionHelpers-DqwMonFW.js} +2 -2
- package/dist/assets/{useImportCurlCommand-XFn6Ezp2.js → useImportCurlCommand-D_onuFvo.js} +19 -10
- package/dist/assets/useProjectPages-e8b03-5_.js +17 -0
- package/dist/assets/usePushConnection-wm-7Id6Q.js +629 -0
- package/dist/assets/{useTestDefinitionForm-2YP-8pAN.js → useTestDefinitionForm-DlUOnNC0.js} +1 -1
- package/dist/assets/{useWorkflowActivate-CvmIpy5T.js → useWorkflowActivate-65xML23U.js} +1 -1
- package/dist/assets/useWorkflowSaving-CUel20JA.js +66 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/CollectionParameter-BaH_a73u.js +0 -4
- package/dist/assets/usePushConnection-x0iF1Axz.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, cl as MODAL_CLOSE, S as PLACEHOLDER_EMPTY_WORKFLOW_ID, cm as MODAL_CANCEL, aj as MODAL_CONFIRM, V as VIEWS } from "./index-DZ6VpjNj.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 || workflowsStore.workflow.isArchived) {
|
|
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-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/{{BASE_PATH}}/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/{{BASE_PATH}}/assets/index-DZ6VpjNj.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/{{BASE_PATH}}/assets/index-yNaoC3fo.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<noscript>
|
package/package.json
CHANGED
|
@@ -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-BLAboPd2.js";
|
|
2
|
-
import { g as globalLinkActionsEventBus } from "./global-link-actions-COf-9vBh.js";
|
|
3
|
-
import { g as getEasyAiWorkflowJson } from "./easyAiWorkflowUtils-BWgfZ0am.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
|
-
};
|