{ "kind": "open-flow-workflow", "version": 1, "name": "Schedule n8n Workflow Activity", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_64f7e53ddec01d47": { "name": "Activate daily at 08:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 8 * * *", "timezone": "UTC" } ] }, "n_1feda6ad7cebf86a": { "name": "Deactivate daily at 20:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 20 * * *", "timezone": "UTC" } ] }, "n_3d87754c512cc910": { "inputs": { "id": { "kind": "unset" } }, "name": "Validate activation target", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "name": "Validate activation target", "moduleId": "n_b5e55afb8a496345", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_17de2b0c39170ad7": { "inputs": { "id": { "kind": "unset" } }, "name": "Validate deactivation target", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "name": "Validate deactivation target", "moduleId": "n_5ed14fafea8011e9", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_549ea16964174f5f": { "inputs": { "workflowId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3d87754c512cc910", "output": "id" } ] } }, "name": "Activate the workflow", "kind": "task", "task": { "inputs": [ { "description": "The n8n workflow identifier.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "nullable": false, "handle": "workflowId" }, { "description": "The specific workflow version ID to activate.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The specific workflow version ID to activate." }, "nullable": true, "handle": "versionId", "value": null }, { "description": "An optional name for the workflow version.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An optional name for the workflow version." }, "nullable": true, "handle": "name", "value": null }, { "description": "An optional description for the workflow version.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An optional description for the workflow version." }, "nullable": true, "handle": "description", "value": null } ], "outputs": [ { "description": "An n8n workflow object returned by the public API.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "output" } ], "name": "Activate the workflow", "executor": { "kind": "connector", "action": "n8n.activate_workflow", "outputMode": "value" } } }, "n_24855a664f917e14": { "inputs": { "workflowId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_17de2b0c39170ad7", "output": "id" } ] } }, "name": "Deactivate the workflow", "kind": "task", "task": { "inputs": [ { "description": "The n8n workflow identifier.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "nullable": false, "handle": "workflowId" } ], "outputs": [ { "description": "An n8n workflow object returned by the public API.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "output" } ], "name": "Deactivate the workflow", "executor": { "kind": "connector", "action": "n8n.deactivate_workflow", "outputMode": "value" } } }, "n_0afeeaabeae5bff8": { "inputs": { "workflow": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_549ea16964174f5f", "output": "output" } ] }, "expectedId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3d87754c512cc910", "output": "id" } ] }, "active": { "kind": "value", "value": true } }, "name": "Confirm activation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "workflow" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "expectedId" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "active" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "workflow" } ], "name": "Confirm activation", "moduleId": "n_1a56ec7febb964b6", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_21fe3bcae005d31e": { "inputs": { "workflow": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_24855a664f917e14", "output": "output" } ] }, "expectedId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_17de2b0c39170ad7", "output": "id" } ] }, "active": { "kind": "value", "value": false } }, "name": "Confirm deactivation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "workflow" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "expectedId" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "active" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "nullable": false, "handle": "workflow" } ], "name": "Confirm deactivation", "moduleId": "n_1f21fb0b6856a4ea", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } } }, "edges": [ { "source": "n_64f7e53ddec01d47", "target": "n_3d87754c512cc910" }, { "source": "n_3d87754c512cc910", "target": "n_549ea16964174f5f" }, { "source": "n_549ea16964174f5f", "target": "n_0afeeaabeae5bff8" }, { "source": "n_1feda6ad7cebf86a", "target": "n_17de2b0c39170ad7" }, { "source": "n_17de2b0c39170ad7", "target": "n_24855a664f917e14" }, { "source": "n_24855a664f917e14", "target": "n_21fe3bcae005d31e" } ] } }, "modules": { "n_b5e55afb8a496345": { "name": "Validate activation target", "imports": [], "source": "export default function target({id}){if(typeof id!=='string'||!id.trim()||id.startsWith('YOUR_'))throw Error('Configure the target workflow ID');return{id}}\n" }, "n_5ed14fafea8011e9": { "name": "Validate deactivation target", "imports": [], "source": "export default function target({id}){if(typeof id!=='string'||!id.trim()||id.startsWith('YOUR_'))throw Error('Configure the target workflow ID');return{id}}\n" }, "n_1a56ec7febb964b6": { "name": "Confirm activation", "imports": [], "source": "export default function confirm({workflow,expectedId,active}){if(!workflow||workflow.id!==expectedId||workflow.active!==active)throw Error('n8n did not confirm the requested workflow status');return{workflow}}\n" }, "n_1f21fb0b6856a4ea": { "name": "Confirm deactivation", "imports": [], "source": "export default function confirm({workflow,expectedId,active}){if(!workflow||workflow.id!==expectedId||workflow.active!==active)throw Error('n8n did not confirm the requested workflow status');return{workflow}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }