I have a problem importing workflows with webhooks triggers in a self-hosted environment. The workflows are imported properly, but the webhooks doesn’t work.
How to reproduce it:
From a local n8n create a workflow with a webhook trigger.
Activate the workflow, clicking on the UI switch.
Export the workflow using the command n8n export:workflow --backup --pretty --output /output/path
Import the workflow in a self-hosted environment, using the command: n8n import:workflow --separate --input=/input/path
The workflow appears active on the n8n UI, however the webhook is not registered and when you call it, returns this error:
"message": "The requested webhook \"GET testActive2\" is not registered.",
"hint": "The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)"
I take this opportunity to congratulate you on the product. I like it a lot.
Information on your n8n setup
n8n version: 0.212.0
Database you’re using (default: SQLite): SQLite in local, MySQL in the self-hosted environment.
Running n8n with the execution process [own(default), main]: Own
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker
It is with one of the core teams at the moment, The internal reference is PAY-206 if you need it.
Because of how the CLI works actually activating workflows would involve a lot of changes and potentially would need an instance restart as well which is not ideal.
The likely outcome for this one will be a documentation update to mention that workflows imported from the CLI will need to be manually activated, We will also set the active option to false so that it doesn’t cause any confusion.
Thanks for the response and detailed information. I understand the difficulty of the solution.
I would like to share with you one approach that solves the problem (at least, yes for me). Although maybe it isn’t the ideal solution. It consists in a workflow that foreach workflow in n8n deactivates and activates (or the opposite) the status, and that makes the webhooks work again.
Maybe it could be a quick solution until you can fix the issue with a proper solution.
the solution here will probably be to disable active workflows during CLI import just like as if they were imported through the UI. This unifies the behaviour and also prevents imported workflows that have not been checked from just being turning on by themselves, purely through being imported. This should make it into one of the next releases…