I am setting up a development instance of n8n on demand as part of my CI/CD process, using docker compose. Importantly, the instance is stopped and started often. On startup I have a script to import all workflows into n8n using the CLI.
As this disables the newly imported workflows, I also have a script to re-activate workflows based on the ‘active’ key-value in the workflow’s JSON file. To activate them, I use the CLI with the --active=true argument.
The issue I’m running into is that the webhooks for these workflows are not available until I manually de-activate and activate them via the UI. I would imagine that the webhooks would become available once I activate the workflow via the CLI?
I do notice that I am told that n8n will not reflect the changes unless it is restarted - however, the workflows are set as active once I enter the UI. I am also only running the n8n start command once the import and reactivation scripts have executed. Is there a CLI command that I could run to restart n8n?
I remember there being a reason why webhook workflows were not actually activated properly from the CLI, You could restart n8n like you have found but there isn’t a cli option to restart it other than restarting your container.