Describe the problem/error/question
Before upgrading to newer versions of n8n, I would like to be able to deactivate workflows via API calls and later reactivate them using a specific version — not the latest “named” version, but the exact version that was previously active.
I created 3 workflows to handle this:
- The first retrieves all workflows, filters the active ones, and deactivates them (/workflows/{id}/deactivate), while storing some information such as:
- activeVersionId
- activeVersion.name
- workflow name
- workflow id
- other relevant data
- The second checks whether there are any workflow executions currently running
- The third reactivates the workflows (/workflows/{id}/activate) using the data collected by the first workflow
My questions are:
- Is it possible to reactivate a workflow using a previously published version (not the latest “named version”), by specifying the desired version instead of always defaulting to the latest one?
- Would it be possible to add a property that automatically marks a workflow as a Sub-workflow if it contains the trigger “When executed by another workflow”?
Currently, I am using tags, but this approach requires manually tagging every sub-workflow as “Sub-workflow,” which is error-prone.
This is important because sub-workflows could remain active even when main workflows are deactivated, since they are invoked by them. Also, you cannot have a sub-workflow deactivated while one of its parent workflows is still active.
I checked both GitHub Issues and the forum, but I couldn’t find any existing discussions about these topics.
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: 2.13.3
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main): -
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: -