Save on new workflow executions with webhook (#2231)

* save on new workflow executions

* only save if webhook node
This commit is contained in:
Mutasem Aldmour 2021-10-06 19:06:33 +02:00 committed by GitHub
parent f7148bdd77
commit 7159181345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -140,6 +140,12 @@ export const workflowRun = mixins(
startNodes.push(nodeName);
}
const isNewWorkflow = this.$store.getters.isNewWorkflow;
const hasWebhookNode = this.$store.getters.currentWorkflowHasWebhookNode;
if (isNewWorkflow && hasWebhookNode) {
await this.saveCurrentWorkflow();
}
const workflowData = await this.getWorkflowDataToSave();
const startRunData: IStartRunData = {

View file

@ -606,6 +606,10 @@ export const store = new Vuex.Store({
return state.workflow.id === PLACEHOLDER_EMPTY_WORKFLOW_ID;
},
currentWorkflowHasWebhookNode: (state: IRootState): boolean => {
return !!state.workflow.nodes.find((node: INodeUi) => !!node.webhookId);
},
getActiveExecutions: (state): IExecutionsCurrentSummaryExtended[] => {
return state.activeExecutions;
},
@ -790,6 +794,7 @@ export const store = new Vuex.Store({
workflowId: (state): string => {
return state.workflow.id;
},
workflowSettings: (state): IWorkflowSettings => {
if (state.workflow.settings === undefined) {
return {};