In the n8n, when you click on Create workflow, you will get url that looks something like this — /workflow/V1StGXR8_Z5jdHi6B-myT.
Here the id is generated using generateNanoId, but this happens inside the beforeEnter method in the editor-ui/router.ts.
beforeEnter: (to) => { // Generate a unique workflow ID using 16-character nanoid and redirect to it // Preserve existing query params (e.g., templateId, projectId) and add new=true const newWorkflowId = generateNanoId(); return { name: VIEWS.WORKFLOW, params: { workflowId: newWorkflowId }, query: { ...to.query, new: 'true' }, }; }, },
Technically when you click on Create workflow button in the workflows route, the code indicates that it redirects to /workflow/new but because of this check — beforeEnter, nanoId replaces the new with an actual nano id.
I spent 3+ years studying OSS codebases and wrote 400+ articles on what makes the production-grade. Now I'm putting that into practice differently - instead of writing every fix myself, I run coding agents that do it.
How it works? Register your machine as a Runtime, point it at your repo. Agents pick up issues. write the fix, open the PR. You just review, they execute.