Maybe I missed out, but is there a way to activate a specific workflow by any trigger f.e webhook.
Almost like the “Workflow” Node only difference that I want to activate a workflow from disabled to “active” to run a workflow just using an interval trigger or cron Job.
Same other way around to disable a whole flow would be a great function for my usecase too.
There is currently no official node for that. What you can however do is to use the the API the editor-UI uses to achieve that.
Here an example how you can active the workflow with the ID 100:
But be aware that the way that API behaves can change in the future and so maybe break. So make sure to test whenever you upgrade n8n to a new version.
Is it possible to do a workflow timeout via api? (the function from workflow settings // timeout) It would be very helpful in batch workflows to kill the workflow before restarting it via a cron for example.
It depends on what you are looking for exactly. There is no way to stop all active tasks via the API with one call. What you can do, is to query all active executions and then execute a stop call for each of them.
You can define a timeout for each workflow in its workflow settings. It is also possible to set that value via the API (as everything that can be changed via the editor-UI). Anyway, changes to that value will not change the behaviour of already running workflows.
I need to monitor a website for a certain value, every 17 minutes by cron. when i find this value i trigger a telegram message. After that i can disable the flow.
i managed this manually but an official way would be nicer.
Yes, it is planned. We want to create an n8n-Node that will be able to control n8n itself. It will be identical to other nodes which control external services will this node be able to controle the n8n instance itself. Sadly do have no eta at the moment.
I realize this is an old thread but I am having issues doing this as well. I created a test request within Postman following the details in your example http node, however I receive this as a response
{
"code": 404,
"message": "The requested webhook \"GET v1/workflows/9/deactivate\" 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)"
}
My url is structured exactly as yours, and I have the same body parameters. I can confirm that this workflow is indeed active. What am I missing?
It is probably easier to just use the n8n node, If you check out the thread below I shared an example on how you can toggle a workflow from a telegram message.