Symptom
n8n Assistant fails to save edits to an existing workflow. build-workflow returns Default export is not a workflow. Make sure your file has: export default workflow(...). The workspace .workflow.ts file is then 0 bytes.
Evidence what you'll see
- The captured
build-workflowcalls included a validfilePathandsourceCode: "". After a failed build, the referenced source file was 0 bytes. - SDK validation had succeeded with no issues found. The Assistant retried the same call, including after stating it would omit
sourceCode. The live workflow was unchanged. - n8n
2.43.4, Docker self-hosted, Node.js26.7.0, SQLite, Windows 11 client.
Why it happens
When sourceCode is set, build-workflow writes it to the file before it builds. A blank string was treated as set, so the tool overwrote the file with nothing. Pull request 41201 treats a blank sourceCode as omitted and builds the file as it is.
Affected versions
n8n 2.43.4, Docker self-hosted, Node.js 26.7.0, SQLite, execution mode regular, Windows 11. The report used the Assistant against an existing workflow exported to a .workflow.ts workspace file.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- Asking the Assistant to change an existing workflow completes the save. The workspace file is not emptied, and the build does not print
Default export is not a workflow.
If it still fails
- No published release tag contains pull request 41201. Tags
n8n@2.43.8andn8n@2.44.4were compared against mergeb78913f75d2eand do not contain it. - The same pull request also refuses a
workspaceolderThanHoursvalue of 0 or less before deleting anything; that is a separate path.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it