Using the n8n CLI
-
n8n ships with a n8n CLI (found on Cloudron at
/app/code/node_modules/.bin/n8n
.) When I try to use it to export a workflow, I run into this.../app/code/node_modules/.bin/n8n export:workflow --backup --output=/tmp/n8n/
Error exporting workflows. See log messages for details.
EROFS: read-only file system, mkdir '/root/.n8n'Is there a different way to invoke the command that works on Cloudron?
-
@sparkwise said in Using the n8n CLI:
Is there a different way to invoke the command that works on Cloudron?
I exactly encounter the same error on the same command
Personally I thought to run the command with as user cloudron (1000)
but then I have another issuesu -c '/app/code/node_modules/n8n/bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
/usr/bin/env: βnodeβ: No such file or directory
PS: I also tried your variation but end with the same issue
su -c '/app/code/node_modules/.bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
UPDATE
This work'ish
su -c '/usr/local/node-16.15.0/bin/node /app/code/node_modules/n8n/bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
but it came with the almost with the same error then you
Error exporting workflows. See log messages for details.
EROFS: read-only file system, mkdir '/home/cloudron/.n8n'also it is not really sustainable since the node version is hard-coded in my command.
-
@robi said in Using the n8n CLI:
looks at the command options and see if there's a way to specify the configuration directory, since it seems it is failing trying to create one.
sadly, the command is not very voluble on that information
/app/code/node_modules/.bin/n8n --help n8n Workflow Automation Tool VERSION n8n/0.179.0 linux-x64 node-v16.15.0 USAGE $ n8n [COMMAND] TOPICS db Revert last database migration export Export credentials import Import credentials list update Update workflows user-management COMMANDS execute executeBatch start Starts n8n. Makes Web-UI available and starts active workflows webhook Starts n8n webhook process. Intercepts only production URLs. worker
- I asked them n8n community
-
@JOduMonT @sparkwise the n8n user directory has to be set.
# export N8N_USER_FOLDER="/app/data/user" # export N8N_CONFIG_FILES="/app/data/configs/default.json" # gosu cloudron /app/code/node_modules/.bin/n8n export:workflow --backup --output=/tmp/n8n/ Loading configuration overwrites from: - /app/data/configs/default.json Error exporting workflows. See log messages for details. No workflows found with specified filters.
I will move the env vars into the Dockerfile, so this will work out of the box.
-
@girish said in Using the n8n CLI:
I put this in the docs as well - https://docs.cloudron.io/apps/n8n/#cli
In the docs, it could be helpful to linking "n8n CLI" to the documentation link: https://docs.n8n.io/reference/cli-commands/
-
N nebulon marked this topic as a question on
-
N nebulon has marked this topic as solved on