I did now manage to reproduce the problem you have described on Windows when trying to import files via n8n import:workflow --separate --input=test that were previously exported via n8n export:workflow --all --separate --output=test:
The same command works fine on Linux:
Based on this I suspect this could be a problem with the CLI not looking in the right path here. I’ll take a closer look this afternoon and see if I can come up with a workaround here.
Thanks a lot @Jon, I was looking at this on a native machine running Windows 11 and was actually throwing a bunch of console.logs around that statement in the first step. At the moment I am struggling to build n8n and some other applications (working fine in WSL, not on the host OS). I think there’s with the Windows build tools not liking my machine.
This will probably take a while to sort so I might need to revisit this tomorrow
To be honest I installed through NPM then looked in the NPM package files and edited it that way so I didn’t need to recompile, Did the same thing with the console.log() to see what was going on.
(ignore the lines above “Succesfully imported 2 workflows.”, that’s just my console.log)
Though such a replacement might have other implications, not sure if any file systems allow backslashes in path names. I’ll think some more about this tomorrow and will either propose a PR or hand this over as a bug in more capable hands depending on how that thought process ends
still not working
I have only one json file
{“id”:23,“name”:“my”,“active”:false,“nodes”:[{“parameters”:{},“name”:“Start”,“type”:“n8n-nodes-base.start”,“typeVersion”:1,“position”:[240,300]}],“connections”:{},“createdAt”:“2021-11-28T08:26:16.330Z”,“updatedAt”:“2021-11-28T08:26:16.330Z”,“settings”:{},“staticData”:null}
My first thought would that you might not be calling the right binary when typing n8n (at least in my PowerShell instance, typing n8n would refer to the n8n desktop app’s script or the global npm installation of n8n).
@Asaf_Shay when inside your repository folder, could you try calling the import logic like in the PR example? E.g. .\packages\cli\bin\n8n import:workflow --separate --input=C:\Users\Tom\Desktop\test (so with the path to the binary you want to run and also the full input path)?