Activate and deactivate workflows via another workflow or api

Is it possible to activate and deactivate a workflow via node in a another workflow or via an API call?

Kind regards
Mattias

As discussed here yesterday:

1 Like

Hello team, I have a CI/CD pipeline that imports and activates a workflow via the public API. While those requests all succeed, I am not able to invoke my workflow through the webhook node (configured to accept POST requests). I am getting the error:

{ “code”: 0, “message”: “Cannot read properties of undefined (reading ‘node’)”, “stacktrace”: “TypeError: Cannot read properties of undefined (reading ‘node’)\n at LiveWebhooks.executeWebhook (/usr/local/lib/node_modules/n8n/src/webhooks/live-webhooks.ts:123:58)\n at WebhookRequestHandler.handleRequest (/usr/local/lib/node_modules/n8n/src/webhooks/webhook-request-handler.ts:48:21)\n at /usr/local/lib/node_modules/n8n/src/webhooks/webhook-request-handler.ts:143:3” }

I also noticed that importing and activating a workflow through the public API does not create entries in the webhook_entity table. As a workaround I am inserting the entry on db level.

Any idea what I am missing here to successfully create, activate and run a workflow via http requests?