n8n
n8n copied to clipboard
Workflow can not be enabled using command line
Describe the bug
The command line fail to enable workflow using 'update:workflow'.
To Reproduce Steps to reproduce the behavior:
- Create a workflow with a webhook trigger
- Enable this workflow with UI
- Disable workflow with command line :
docker-compose exec n8n n8n update:workflow --all --active=false
(response is : Deactivating all workflows) - Check status in UI : workflow is disabled
- Enable workflow with command line :
docker-compose exec n8n n8n update:workflow --all --active=true
(response is : Deactivating all workflows) - Check status in UI : workflow is still disabled
The result is the same when using --id=1
instead of --all
.
Expected behavior
Workflow should be activated with update:workflow --all --active=true
as done with UI.
Environment (please complete the following information):
- OS: docker
- n8n Version : 0.203.1
- Node.js Version : v16.17.0]
- Database system : SQLite
- Operation mode : own
Additional context Add any other context about the problem here.
Hey @smalot,
I have just given this a go and while the command does come back and say deactiving workflow with ID: xx
it looks like it has enabled the workflow.
In your testing did it fail with all workflows or just ones with certain triggers?
Hi @Joffcom
However I don't care about command line feedback, the workflow is not enabled. Only the disable is applied.
BR
Hey @smalot,
Did it fail with all workflows or just ones with certain triggers? The feedback message didn't matter but I was unable to reproduce.
Hi @Joffcom
Indeed, it works with the --id=[id]
specified, but not with the --all
flag.
Here a sample code to reproduce
version: "3.3"
services:
n8n:
image: n8nio/n8n:0.204.0
environment:
- N8N_ENCRYPTION_KEY=qa
- DB_TYPE=mysqldb
- DB_MYSQLDB_HOST=mysql
- DB_MYSQLDB_USER=root
- DB_MYSQLDB_PASSWORD=root
- DB_MYSQLDB_DATABASE=n8n
ports:
- "5678:5678"
links:
- mysql:mysql
mysql:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=n8n
- MYSQL_PASSWORD=n8n
- MYSQL_DATABASE=n8n
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin:5-apache
environment:
- PMA_HOST=mysql
- PMA_USER=root
- PMA_PASSWORD=root
links:
- mysql:mysql
ports:
- "9000:80"
Step 1 : launch docker
docker-compose up -d mysql
sleep 30
docker-compose up -d
Step 2
create a workflow with the webhook trigger
node
Step 3
docker-compose exec n8n n8n update:workflow --all --active=true
However, if you active the workflow manually using the UI, the following command line works to disable it:
docker-compose exec n8n n8n update:workflow --all --active=false
BR
Hey @smalot,
Perfect, I didn't test with All yet as the initial report mentioned ID as well. Will test this again later today with the all option and see what is going on.
Hi @Joffcom
Any news ?
Hey @smalot,
Not yet, I had a couple of other issues to look into and I noticed there are a couple for the CLI so I want to check them at the same time and get the internal dev tickets created.
Just adding that we have an internal open for this which we are tracking as N8N-3763
Working as expected
+ n8n update:workflow --all --active false
Deactivating all workflows
Done
Workflow activating, but print "Deactivating"
+ n8n update:workflow --id 1 --active true
Deactivating workflow with ID: 1
Done
Not working as expected
+ n8n update:workflow --all '--active=true'
Deactivating all workflows
Done
0.222.3
Hey @grachevko,
Looking at the internal ticket for this it is still in a triage state so I wouldn't expect it to work at the moment. Once this has been fixed we will typically pop a note on this issue to let people know.
Hey @Joffcom
I guess it's not related, but after restarting n8n workflow on console marked as activated. But on call webhook n8n return - workflow not registered. Deactivate/active workflow though CLI not fix this. It started only after deactive/active in web console
This should be fixed in the next release 🚀
See: https://github.com/n8n-io/n8n/pull/8412
Fix got released with [email protected]