Activate workflow CLI command not activating web hooks

Describe the problem/error/question

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?

Any help would be appreciated!

Information on your n8n setup

  • n8n version: 1.28.0
  • Database: PostGres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @dingo-dev,

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.

Hi @Jon

Unfortunately restarting n8n also doesn’t do the trick.

We manually need to de-activate and then re-activate a workflow in order to make the webhooks available.

Is there any other way we could get the webhooks to correctly register when the workflow is active?

Hey @dingo-dev,

I would have expected a restart to force the webhook to register again :thinking: What about using the API to just toggle it?

1 Like

Thanks @Jon, let me give that a try.

@Jon Using the API to toggle it on and off using a script was the answer!

Thanks for the suggestion.

1 Like

That is good to hear, Thanks for the update.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.