The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Docker Service Control via Webhooks",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "service/start",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook - Start Service",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "service/stop",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook - Stop Service",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
500
]
},
{
"parameters": {
"functionCode": "// Extract service name from webhook body\nconst serviceName = $json.body.service;\nconst validServices = [\n 'salem-kasm-workspace',\n 'salem-librechat',\n 'salem-mongo',\n 'salem-open-webui',\n 'salem-ollama',\n 'salem-browserless',\n 'salem-playwright'\n];\n\nif (!validServices.includes(serviceName)) {\n throw new Error(`Invalid service: ${serviceName}`);\n}\n\nreturn {\n json: {\n service: serviceName,\n action: 'start'\n }\n};"
},
"name": "Validate Start Request",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
450,
300
]
},
{
"parameters": {
"functionCode": "// Extract service name from webhook body\nconst serviceName = $json.body.service;\nconst validServices = [\n 'salem-kasm-workspace',\n 'salem-librechat',\n 'salem-mongo',\n 'salem-open-webui',\n 'salem-ollama',\n 'salem-browserless',\n 'salem-playwright'\n];\n\nif (!validServices.includes(serviceName)) {\n throw new Error(`Invalid service: ${serviceName}`);\n}\n\nreturn {\n json: {\n service: serviceName,\n action: 'stop'\n }\n};"
},
"name": "Validate Stop Request",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
450,
500
]
},
{
"parameters": {
"command": "docker start {{ $json.service }}"
},
"name": "Start Docker Container",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
650,
300
]
},
{
"parameters": {
"command": "docker stop {{ $json.service }}"
},
"name": "Stop Docker Container",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
650,
500
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ { \"success\": true, \"service\": $json.service, \"action\": \"started\", \"timestamp\": new Date().toISOString() } }}"
},
"name": "Respond - Started",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
850,
300
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ { \"success\": true, \"service\": $json.service, \"action\": \"stopped\", \"timestamp\": new Date().toISOString() } }}"
},
"name": "Respond - Stopped",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
850,
500
]
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 9 * * 1-5"
}
]
}
},
"name": "Schedule - Start Kasm (9am weekdays)",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [
250,
700
]
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 18 * * 1-5"
}
]
}
},
"name": "Schedule - Stop Kasm (6pm weekdays)",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [
250,
900
]
},
{
"parameters": {
"functionCode": "return {\n json: {\n service: 'salem-kasm-workspace',\n action: 'start'\n }\n};"
},
"name": "Set Kasm Start",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
450,
700
]
},
{
"parameters": {
"functionCode": "return {\n json: {\n service: 'salem-kasm-workspace',\n action: 'stop'\n }\n};"
},
"name": "Set Kasm Stop",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
450,
900
]
},
{
"parameters": {
"command": "docker start salem-kasm-workspace"
},
"name": "Start Kasm (Scheduled)",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
650,
700
]
},
{
"parameters": {
"command": "docker stop salem-kasm-workspace"
},
"name": "Stop Kasm (Scheduled)",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
650,
900
]
}
],
"connections": {
"Webhook - Start Service": {
"main": [
[
{
"node": "Validate Start Request",
"type": "main",
"index": 0
}
]
]
},
"Webhook - Stop Service": {
"main": [
[
{
"node": "Validate Stop Request",
"type": "main",
"index": 0
}
]
]
},
"Validate Start Request": {
"main": [
[
{
"node": "Start Docker Container",
"type": "main",
"index": 0
}
]
]
},
"Validate Stop Request": {
"main": [
[
{
"node": "Stop Docker Container",
"type": "main",
"index": 0
}
]
]
},
"Start Docker Container": {
"main": [
[
{
"node": "Respond - Started",
"type": "main",
"index": 0
}
]
]
},
"Stop Docker Container": {
"main": [
[
{
"node": "Respond - Stopped",
"type": "main",
"index": 0
}
]
]
},
"Schedule - Start Kasm (9am weekdays)": {
"main": [
[
{
"node": "Set Kasm Start",
"type": "main",
"index": 0
}
]
]
},
"Schedule - Stop Kasm (6pm weekdays)": {
"main": [
[
{
"node": "Set Kasm Stop",
"type": "main",
"index": 0
}
]
]
},
"Set Kasm Start": {
"main": [
[
{
"node": "Start Kasm (Scheduled)",
"type": "main",
"index": 0
}
]
]
},
"Set Kasm Stop": {
"main": [
[
{
"node": "Stop Kasm (Scheduled)",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {},
"staticData": null,
"tags": [],
"triggerCount": 0,
"updatedAt": "2025-01-06T00:00:00.000Z",
"versionId": "1"
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Docker Service Control via Webhooks. Uses executeCommand. Webhook trigger; 14 nodes.
Source: https://github.com/Cursedpotential/mcp-tool-platform/blob/4f10dfcfc88553af7b340e4746605894bc377168/n8n-workflows/service-control.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
v3.7. Uses executeCommand, gitlab, stickyNote. Webhook trigger; 19 nodes.
v3.6. Uses executeCommand, gitlab, stickyNote. Webhook trigger; 17 nodes.
Claude Comment Handler v2. Uses executeCommand, gitlab. Webhook trigger; 15 nodes.
Claude Comment Handler v3 - Happy Path. Uses executeCommand, gitlab. Webhook trigger; 13 nodes.
Claude Comment Handler. Uses executeCommand, gitlab. Webhook trigger; 13 nodes.