-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retain workflow status #18
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about to add a flag "--activate, -a" here https://github.com/digital-boss/n8n-manager/blob/main/src/cli/workflows.ts#L168 ? Also it could have a default value = true, if you think that it would be more convenient in usage.
src/cli/workflows.ts
Outdated
if (opts.dry === false) { | ||
await wf.publish(...args) | ||
await wf.deactivate(wfFilter) // Deactivate to avoid conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please clarify why we need to deactivate workflows before publishing? The comment, BTW, doesn't do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We deactivate the workflow before publishing to avoid conflicts that can arise when activating a workflow that might already have active triggers or schedules, which n8n doesn’t handle well. More details about this issue can be found here: Workflow could not be activated.
src/lib/Workflows.ts
Outdated
console.error(`Failed to activate ${wf.id}:`, error); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already activate
method in this class. This one duplicates the existing one logic. Use existing one instead.
Remove activate flag.
Both |
if (opts.dry === false) { | ||
await wf.deactivate(wfFilter) // Deactivate to avoid conflict | ||
await wf.publish(...args); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it was correct to place deactivate inside that if
. We making changes only if it is not dry run. Same below.
No description provided.