Workflows show 404 permission errors after new owner account was created

Describe the problem/error/question

Hi everyone,
I was running n8n locally on Windows and when I opened it, it asked me
to set up a new owner account even though I did nothing different.
My workflows were already gone at that point.
I can see these errors in my command prompt:
“User attempted to access a workflow without permissions”
“404 Could not load the workflow - you can only access workflows owned by you”
This tells me my workflows are still in the database but tied to an old
user account.
My setup:

  • Windows 10
  • n8n version 2.1.2
  • Running locally on localhost:5678
  • Database file at C:\Users\sstri.n8n\database.sqlite (4.7MB)
    When I ran “n8n export:workflow --all” it said no workflows found,
    but the 404 errors prove they are still in there.
    How do I reassign the workflows to my new owner account?
    Thank you!

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Matt3 Welcome!
this can happen when your flows are tied to the old user as they are present in the database possibly, try opening the database.sqlite file using any tool and in there find your owner’s ID in the user list/database and just update the shared_workflow table to reassign all of your old flows to that new user. Let me know if that works.

1 Like

Your workflows are still in the DB — they just need to be reassigned to the new user. Open the database.sqlite file with DB Browser for SQLite (free tool), then run: SELECT id, email FROM user; to get both user IDs, and then UPDATE shared_workflow SET userId = '<new-user-id>' WHERE userId = '<old-user-id>';. After saving and restarting n8n, your workflows should be visible under the new account.

1 Like