-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(core): Allow transferring workflows from any project to any team project #9534
Conversation
NotFoundError.isDefinedAndNotNull( | ||
workflow, | ||
`Could not find workflow with the id "${workflowId}". Make sure you have the permission to delete 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.
I find type guards / assertion functions easier to read than conditional logic and creating an error.
But I don't feel strongly about it, so it's up for debate.
@Put('/:workflowId/transfer') | ||
@Licensed('feat:advancedPermissions') | ||
async transfer(req: WorkflowRequest.Transfer) { | ||
const body = z.object({ toProject: z.string() }).parse(req.body); |
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.
I'm also happy to use just typeof
here and wait until we have a proper proposal for input validation.
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
toJSON?(): any { |
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.
Not sure why we have to disable the return type inference here.
@despairblue this one probably needs docs - can you create a ticket and link relevant info/dev tickets etc. |
@@ -460,4 +470,16 @@ export class WorkflowsController { | |||
workflow, | |||
}); | |||
} | |||
|
|||
@Put('/:workflowId/transfer') | |||
@Licensed('feat:advancedPermissions') |
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.
No sure about this, we've put lots of other endpoints behind the admin feature flag.
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.
It was decided that this endpoint is not behind a license flag.
For now this is only the internal API side. But I can create a doc ticket and link the notion page with the mock-ups, sure thing! |
abfbe78
to
fa87bac
Compare
packages/cli/test/integration/workflows/workflows.controller.ee.test.ts
Outdated
Show resolved
Hide resolved
packages/cli/test/integration/workflows/workflows.controller.ee.test.ts
Outdated
Show resolved
Hide resolved
42a1e29
to
81ad4d3
Compare
|
1 flaky test on run #5290 ↗︎
Details:
cypress/e2e/5-ndv.cy.ts • 1 flaky test
Review all test suite changes for PR #9534 ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
Summary
This allows transferring workflows from any personal or team project to any other team project.
The user needs to have the permissions/scopes of
workflow:move
for the workflow andworkflow:create
for the destination project.Workflows cannot be moved into their current home project.
Workflows cannot be moved into any personal project.
Workflows can only be moved out of personal and team projects. (For now there are only personal and team projects, but there are plans for other kinds of projects.)
Related tickets and issues
https://www.notion.so/n8n/Move-resources-workflow-credentials-between-projects-e737365c6ff446ce9e396df03e7a1255
https://linear.app/n8n/issue/DOC-886/feature-transfer-workflows-and-credentials-from-project-to-project
https://linear.app/n8n/issue/PAY-1428/move-resources-between-projects
Review / Merge checklist
(no-changelog)
otherwise. (conventions)