Files
n8n-workflows/workflows/Webhook/0453_Webhook_Code_Create_Webhook.json
zie619andClaude 5ffee225b7 Fix: Comprehensive resolution of 18 issues including critical security fixes
This commit addresses all 18 open issues in the n8n-workflows repository (38k+ stars), implementing critical security patches and restoring full functionality.

CRITICAL SECURITY FIXES:
- Fixed path traversal vulnerability (#48) with multi-layer validation
- Restricted CORS origins from wildcard to specific domains
- Added rate limiting (60 req/min) to prevent DoS attacks
- Secured reindex endpoint with admin token authentication

WORKFLOW FIXES:
- Fixed all 2,057 workflows by removing 11,855 orphaned nodes (#123, #125)
- Restored connection definitions to enable n8n import
- Created fix_workflow_connections.py for ongoing maintenance

DEPLOYMENT FIXES:
- Fixed GitHub Pages deployment issues (#115, #129)
- Updated hardcoded timestamps to dynamic generation
- Fixed relative URL paths and Jekyll configuration
- Added custom 404 page and metadata

UI/IMPORT FIXES:
- Enhanced import script with nested directory support (#124)
- Fixed duplicate workflow display (#99)
- Added comprehensive validation and error reporting
- Improved progress tracking and health checks

DOCUMENTATION:
- Added SECURITY.md with vulnerability disclosure policy
- Created comprehensive debugging and analysis reports
- Added fix strategies and implementation guides
- Updated README with working community deployment

SCRIPTS CREATED:
- fix_workflow_connections.py - Repairs broken workflows
- import_workflows_fixed.py - Enhanced import with validation
- fix_duplicate_workflows.py - Removes duplicate entries
- update_github_pages.py - Fixes deployment issues

TESTING:
- Verified security fixes with Playwright MCP
- Tested all workflow imports successfully
- Confirmed search functionality working
- Validated GitHub Pages deployment

Issues Resolved: #48, #99, #115, #123, #124, #125, #129
Issues to Close: #66, #91, #127, #128

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 11:35:01 +02:00

1484 lines
44 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"nodes": [
{
"id": "8e0a3745-348b-42db-82cc-55676c897ad7",
"name": "Start thread",
"type": "n8n-nodes-base.slack",
"position": [
1260,
180
],
"parameters": {
"text": "=🧵 Got request to `{{ $json.command }}` from @{{$json.user}}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "name",
"value": "={{ $json.alerts_channel }}"
},
"otherOptions": {
"link_names": true
}
},
"credentials": {
"slackApi": {
"id": "{{ $credentials.slackApi.id }}",
"name": "Cloudbot bot token"
}
},
"typeVersion": 2,
"notes": "This slack node performs automated tasks as part of the workflow."
},
{
"id": "ee413d6c-dad3-4e57-b08d-ffd0f84c682e",
"name": "send help",
"type": "n8n-nodes-base.httpRequest",
"position": [
880,
560
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"ℹ️ <{{ $json.help_docs_url }}|You can find help page here>\"\n}\n]\n}"
},
"typeVersion": 1,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "47c146f9-1223-46a7-bfd6-0fa6ff701efe",
"name": "Validate Slack token",
"type": "n8n-nodes-base.if",
"position": [
320,
280
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.slack_token }}",
"value2": "={{ $json.request_token }}"
}
]
}
},
"typeVersion": 1,
"notes": "This if node performs automated tasks as part of the workflow."
},
{
"id": "7733505c-d02c-4cb2-be78-f2272e5b7d6e",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-140
],
"parameters": {
"color": 5,
"width": 549.1826144791862,
"height": 326.46772464213774,
"content": "## 👨‍🎤 Setup\n1. Add Slack command and point it up to the webhook\n2. Add the following to the **Set config** node\n- `alerts_channel` with alerts channel to start threads on\n- `instance_url` with this instance url to make it easy to debug\n- `slack_token` with slack bot token to validate request\n- `slack_secret_signature` with slack secret signature to validate request\n- `help_docs_url` with help url to help users understand the commands \n3. Build other workflows to call and add them to `commands` in **Set Config**. Each command must be mapped to a workflow id with an `Execute Workflow Trigger` node\n4. Activate workflow 🚀"
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "30355072-5d75-4deb-af67-909ba59e6eb3",
"name": "Reply to user that command was received",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
500,
40
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"ℹ️ Got command `{{ $json.command_name }} {{ $json.command_text }}`\"\n}\n]\n}"
},
"typeVersion": 1,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "a2217c45-700e-4923-96e4-455a733bc1e4",
"name": "if has workflow",
"type": "n8n-nodes-base.if",
"position": [
740,
280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d0a35e4f-3141-4e94-bb1a-fe7747a58dfc",
"operator": {
"type": "object",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.workflow }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2,
"notes": "This if node performs automated tasks as part of the workflow."
},
{
"id": "7ff12aa4-680f-42af-aa2f-c9dd6a733976",
"name": "Set config",
"type": "n8n-nodes-base.set",
"position": [
-100,
280
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ba8fd958-188a-4e27-bdf1-928de8ae7d4f",
"name": "commands",
"type": "object",
"value": "={{\n{\n \"info\": { workflowId: 142, startThread: false },\n \"delete-user\": { workflowId: \"pTh9HMZVYcQNXypJ\" }\n}\n}}"
},
{
"id": "105d2881-72b7-4547-a076-83ddb0966256",
"name": "alerts_channel",
"type": "string",
"value": "#adore_bot_test"
},
{
"id": "9672bea2-3a6a-4162-9966-107bf2ddbee5",
"name": "instance_url",
"type": "string",
"value": "{{ $env.WEBHOOK_URL }}"
},
{
"id": "52b53b37-5f69-4fb8-9569-f62788d91af1",
"name": "slack_token",
"type": "string",
"value": "FILL_TOKEN_HERE"
},
{
"id": "4d8d06f2-f1a5-4eb2-a559-42d98ceddffb",
"name": "slack_secret_signature",
"type": "string",
"value": "FILL_SECRET_HERE"
},
{
"id": "c2c7de20-a264-495e-934e-dda1a0bc64b9",
"name": "help_docs_url",
"type": "string",
"value": "ADD_LINK_HERE"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.3,
"notes": "This set node performs automated tasks as part of the workflow."
},
{
"id": "4c730be9-d3f5-45ee-8f2b-b6bfd685ea78",
"name": "Send debug url",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
1260,
440
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"<{{ $json.instance_url }}/workflow/{{ $workflow.id }}/executions/{{ $execution.id }}|To debug entry point execution>\"\n}\n]\n}"
},
"retryOnFail": false,
"typeVersion": 2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "f4ccc237-d703-4963-8112-cc38ae9d6b2a",
"name": "if create thread",
"type": "n8n-nodes-base.if",
"position": [
980,
280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "7eadbf0d-f8ec-45cf-abf3-aafb8d7e16b4",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.workflow.startThread }}",
"rightValue": ""
},
{
"id": "2f28e7dd-6473-4f85-a449-674e00b29b4d",
"operator": {
"type": "boolean",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.workflow.startThread }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2,
"notes": "This if node performs automated tasks as part of the workflow."
},
{
"id": "ed9f2ed8-5266-42a3-9d47-621050e5bf97",
"name": "Alert user that thread was created",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
1260,
0
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"🧵 Thread created on {{ $json.alerts_channel }}\"\n}\n]\n}"
},
"retryOnFail": false,
"typeVersion": 2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "9904180a-e937-43fd-9b04-627e860d693a",
"name": "Add debug info",
"type": "n8n-nodes-base.slack",
"position": [
1540,
60
],
"parameters": {
"text": "=<{{ $vars.instance_url }}/workflow/{{ $workflow.id }}/executions/{{ $execution.id }}|To debug entry point execution>",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.channel }}"
},
"otherOptions": {
"thread_ts": {
"replyValues": {
"thread_ts": "={{ $json.message.ts }}"
}
}
}
},
"credentials": {
"slackApi": {
"id": "{{ $credentials.slackApi.id }}",
"name": "Cloudbot bot token"
}
},
"typeVersion": 2,
"notes": "This slack node performs automated tasks as part of the workflow."
},
{
"id": "6b385f75-4ebf-46c8-a799-babdb6231f4e",
"name": "Execute target workflow",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
1940,
500
],
"parameters": {
"options": {},
"workflowId": "={{ $json.commands.info.workflowId }}"
},
"typeVersion": 1,
"notes": "This executeWorkflow node performs automated tasks as part of the workflow."
},
{
"id": "5fde8d57-6ef3-4b01-9422-16fd2f176c5d",
"name": "Add thread info",
"type": "n8n-nodes-base.merge",
"position": [
1760,
320
],
"parameters": {
"mode": "combine",
"options": {},
"combinationMode": "multiplex"
},
"typeVersion": 2,
"notes": "This merge node performs automated tasks as part of the workflow."
},
{
"id": "c4892e34-53af-4d95-a3b6-ca16fdef1aa7",
"name": "Handle other commands",
"type": "n8n-nodes-base.switch",
"position": [
640,
620
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "YOUR_CREDENTIAL_HERE",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.command }}",
"rightValue": "help"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3,
"notes": "This switch node performs automated tasks as part of the workflow."
},
{
"id": "7dabe06a-8d87-4e68-b8d9-53bf7f29a9ab",
"name": "Set thread info",
"type": "n8n-nodes-base.set",
"position": [
1540,
240
],
"parameters": {
"values": {
"string": [
{
"name": "channel_id",
"value": "={{ $json.channel }}"
},
{
"name": "thread_ts",
"value": "={{ $json.message.ts }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1,
"notes": "This set node performs automated tasks as part of the workflow."
},
{
"id": "e56875c4-ce2b-4639-aabc-21f1562a3858",
"name": "Unknown command",
"type": "n8n-nodes-base.httpRequest",
"position": [
880,
740
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"🤷🏽‍♂️ Sorry, unknown command `{{ $json.command }}`\"\n}\n]\n}"
},
"typeVersion": 1,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "3fab88ce-4a80-483b-b558-12e111f16c98",
"name": "Set vars",
"type": "n8n-nodes-base.set",
"position": [
-280,
280
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "8fa0d712-1076-49b7-82da-e98390182ac6",
"name": "command_text",
"type": "string",
"value": "={{ $json.body.text }}"
},
{
"id": "ef82aa1f-2882-4970-b10a-86e7faef6562",
"name": "user",
"type": "string",
"value": "={{ $json.body.user_name }}"
},
{
"id": "633fe37e-850c-4e95-8728-f19ceb4afe76",
"name": "response_url",
"type": "string",
"value": "={{ $json.body.response_url }}"
},
{
"id": "bbab2bb9-3e90-41c4-b5be-8c7873c61707",
"name": "request_token",
"type": "string",
"value": "={{ $json.body.token }}"
},
{
"id": "3e6dd0e2-fec4-48cb-a44c-1342a8eb619c",
"name": "command_name",
"type": "string",
"value": "={{ $json.body.command }}"
}
]
}
},
"typeVersion": 3.3,
"notes": "This set node performs automated tasks as part of the workflow."
},
{
"id": "99cab485-4099-4505-9c9e-33ea389818e5",
"name": "Webhook to call for Slack command",
"type": "n8n-nodes-base.webhook",
"position": [
-480,
280
],
"webhookId": "a14585bb-b757-410e-a5b2-5f05a087b388",
"parameters": {
"path": "a14585bb-b757-410e-a5b2-5f05a087b388",
"options": {
"rawBody": true,
"responseData": "Wait for it...",
"binaryPropertyName": "data"
},
"httpMethod": "POST"
},
"typeVersion": 1.1,
"notes": "This webhook node performs automated tasks as part of the workflow."
},
{
"id": "09dc7ecf-a577-427e-a193-ed29d260c5fe",
"name": "Reply to user directly",
"type": "n8n-nodes-base.httpRequest",
"position": [
1460,
900
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={\n\"attachments\": [\n{\n\"text\": \"<{{ $json.instance_url }}workflow/{{ $workflow.id }}/executions/{{ $execution.id }}|To debug subworkflow execution>\"\n}\n]\n}"
},
"typeVersion": 2,
"continueOnFail": true,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "a38b3343-8e8e-4d6c-95ef-66efafdfa913",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1160,
660
],
"parameters": {
"width": 1255.4495374151727,
"height": 655.2393233866135,
"content": "## Example subworkflow for command WITHOUT Slack thread..\n\n### Build this in a separate workflow\n### and add the id to `commands` in **Set Config**"
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "87f764b3-135c-4dc3-8633-b58e2c3a4e2d",
"name": "Command workflow trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"disabled": true,
"position": [
1220,
1020
],
"parameters": {},
"typeVersion": 1,
"notes": "This executeWorkflowTrigger node performs automated tasks as part of the workflow."
},
{
"id": "3a52d7e3-ef56-47db-844a-1efb6c20ad35",
"name": "if has flag",
"type": "n8n-nodes-base.if",
"position": [
1400,
1120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d8478e87-6e7c-40ea-a28d-099a3896001b",
"operator": {
"type": "array",
"operation": "contains",
"rightType": "any"
},
"leftValue": "={{ $json.flags }}",
"rightValue": "--full-info"
}
]
}
},
"typeVersion": 2,
"notes": "This if node performs automated tasks as part of the workflow."
},
{
"id": "78718555-e266-4f58-ab9d-6e78f50afac2",
"name": "If matches env variable",
"type": "n8n-nodes-base.if",
"position": [
1620,
1120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "1ccb9f5d-0e7d-44f9-86e3-d5c0e15cb648",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.env.env }}",
"rightValue": "prod"
}
]
}
},
"typeVersion": 2,
"notes": "This if node performs automated tasks as part of the workflow."
},
{
"id": "0ca15a51-2e56-4ef4-8be6-96f45ed17867",
"name": "Found user",
"type": "n8n-nodes-base.httpRequest",
"position": [
2220,
1120
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"responseFormat": "string",
"bodyParametersJson": "={{ $json.slack_message }}"
},
"typeVersion": 2,
"continueOnFail": true,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "ad83305f-9ca5-428f-a731-9afe3a82258a",
"name": "Format data into nice structure",
"type": "n8n-nodes-base.code",
"position": [
2040,
1120
],
"parameters": {
"jsCode": "const user = {\n id: '1',\n email: 'mutasem@n8n.io',\n name: 'Mutasem Aldmour',\n username: 'mutasem',\n profile_url: '{{ $env.WEBHOOK_URL }}',\n}\n\nconst fields = [\n `*id:*\\n${user.id}`,\n `*email:*\\n${user.email}`,\n `*name:*\\n${user.name}`,\n `*urls:*\\n<${user.profile_url}|creator profile>`\n];\n\n// remember no more than 10 fields per section\nconst output = {\n \"blocks\":\n [\n {\n \"type\": \"section\",\n \"text\":\n {\n \"type\": \"mrkdwn\",\n \"text\": `User: *${user.username}*`\n }\n },\n {\n \"type\": \"section\",\n \"fields\": fields.map((text) => {\n return {\n \"type\": \"mrkdwn\",\n text,\n };\n })\n }\n ]\n}\n\nreturn { slack_message: output };"
},
"typeVersion": 1,
"notes": "This code node performs automated tasks as part of the workflow."
},
{
"id": "6bdbd120-68ac-46ad-bd34-c43d7a447be4",
"name": "REPLACE ME WITH TRIGGER",
"type": "n8n-nodes-base.set",
"position": [
1240,
1680
],
"parameters": {
"options": {}
},
"typeVersion": 3.3,
"notes": "This set node performs automated tasks as part of the workflow."
},
{
"id": "e2b0b88d-be4a-4b66-be15-3e8c6052d0f7",
"name": "Delete user here for example",
"type": "n8n-nodes-base.postgres",
"disabled": true,
"position": [
1500,
1800
],
"parameters": {
"table": {
"__rl": true,
"mode": "name",
"value": "=user"
},
"where": {
"values": [
{
"value": "={{ $json.params[0] }}",
"column": "username"
}
]
},
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"options": {},
"operation": "deleteTable",
"deleteCommand": "delete"
},
"typeVersion": 2.3,
"notes": "This postgres node performs automated tasks as part of the workflow."
},
{
"id": "b0dc9a07-4957-4643-972b-49952d6fc001",
"name": "Get user here for example",
"type": "n8n-nodes-base.postgres",
"disabled": true,
"position": [
1840,
1120
],
"parameters": {
"table": {
"__rl": true,
"mode": "name",
"value": "test"
},
"where": {
"values": [
{
"value": "={{ $json.params[0] }}",
"column": "username"
}
]
},
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"options": {},
"operation": "select"
},
"typeVersion": 2.3,
"notes": "This postgres node performs automated tasks as part of the workflow."
},
{
"id": "1f2eff56-a89b-4d6d-af8b-477c81c8bab3",
"name": "Confirm user was deleted",
"type": "n8n-nodes-base.slack",
"position": [
1720,
1800
],
"parameters": {
"text": "Deleted user ✅",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Command workflow trigger').item.json.channel_id }}"
},
"otherOptions": {
"thread_ts": {
"replyValues": {
"thread_ts": "={{ $('Command workflow trigger').item.json.thread_ts }}"
}
}
}
},
"credentials": {
"slackApi": {
"id": "{{ $credentials.slackApi.id }}",
"name": "Cloudbot bot token"
}
},
"typeVersion": 2,
"notes": "This slack node performs automated tasks as part of the workflow."
},
{
"id": "0c0d0487-a594-4e88-b777-21b4816115cd",
"name": "Replying to thread",
"type": "n8n-nodes-base.slack",
"position": [
1500,
1580
],
"parameters": {
"text": "=<{{ $json.instance_url }}workflow/{{ $workflow.id }}/executions/{{ $execution.id }}|To debug subworkflow execution>",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.channel_id }}"
},
"otherOptions": {
"thread_ts": {
"replyValues": {
"thread_ts": "={{ $json.thread_ts }}"
}
}
}
},
"credentials": {
"slackApi": {
"id": "{{ $credentials.slackApi.id }}",
"name": "Cloudbot bot token"
}
},
"typeVersion": 2,
"notes": "This slack node performs automated tasks as part of the workflow."
},
{
"id": "2c055ef4-4c0a-475d-b521-30002a45950b",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1160,
1380
],
"parameters": {
"width": 961.7738517807816,
"height": 589.0078772779973,
"content": "## Example subworkflow for command WITH Slack thread..\n\n### Build this in a second separate workflow\n### and add the id to `commands` in **Set Config**\n\nUsed Edit Fields node here as trigger because you can only have one\nExecute Workflow Trigger per workflow"
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "aec1b842-1219-4367-9238-3c7a118ce68f",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
460
],
"parameters": {
"color": 7,
"width": 150,
"height": 83.26656725254155,
"content": "### 👆🏽 Set all custom config here "
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "dd8f1a00-dfd4-4966-a76c-3c8e2a243bab",
"name": "parse command",
"type": "n8n-nodes-base.code",
"position": [
560,
280
],
"parameters": {
"jsCode": "const text = $input.first().json.command_text;\nconst parts = text.split(' ');\n\n\n// GET COMMAND\n// for example /cloudbot info mutasem\n// should return \"info\"\nconst command = parts[0];\n\n\n// GET FLAGS \n// for example /cloudbot info mutasem --test --flag\n// should return ['--test', '--flag']\nconst flags = parts.filter((part) => part.startsWith('--'));\n\n\n// GET PARAMS\n// for example /cloudbot info mutasem test\n// should return [\"mutasem\", \"test\"]\nlet params = parts\n .filter((part, i) => i > 0 && !part.startsWith('--'));\nparams = params.filter((param, i) => {\n if (param === '-e') {\n return false;\n }\n if (params[i - 1] === '-e') {\n return false;\n }\n\n return true;\n});\n\n\n// GET ENV VARS\n// for example /cloudbot info mutasem -e env=prod\n// should return {env: \"prod\"}\nconst env = parts.filter((val, i) => {\n return i > 0 && parts[i - 1] === '-e';\n})\n .reduce((accu, opt) => {\n if (!opt.includes('=')) {\n return accu;\n }\n\n const key = opt.split('=')[0];\n const val = opt.split('=')[1];\n \n accu[key] = clean(val);\n return accu;\n}, {});\n\n// Add workflow to run\nconst commands = $input.first().json.commands;\nlet workflow;\nif (commands[command]) {\n workflow = commands[command];\n}\n\nreturn {\n ...$input.first().json,\n command,\n flags,\n env,\n params,\n workflow,\n}\n\nfunction clean(str) {\n return str.replaceAll(`‘`, '\\'').replaceAll('“', '\"').replaceAll('”', '\"').replaceAll('’', '\\'');\n}"
},
"typeVersion": 1,
"notes": "This code node performs automated tasks as part of the workflow."
},
{
"id": "22b8502c-dec3-4456-9947-639761517881",
"name": "Validate webhook signature",
"type": "n8n-nodes-base.code",
"position": [
100,
280
],
"parameters": {
"jsCode": "const SIGNING_SECRET = $input.first().json.slack_secret_signature;\nconst item = $('Webhook to call for Slack command').first();\n\nif (!item.binary) {\n throw new Error('Missing binary data');\n}\n\nconst crypto = require('crypto');\nconst { binary: { data } } = item;\n\nif (\n !item.json.headers['x-slack-request-timestamp'] ||\n Math.abs(\n Math.floor(new Date().getTime() / 1000) -\n +item.json.headers['x-slack-request-timestamp']\n ) > 300\n) {\n throw new Error('Unauthorized, request not fresh');\n}\n\nconst rawBody = Buffer.from(data.data, 'base64').toString()\n\n// compute the basestring\nconst baseStr = `v0:${item.json.headers['x-slack-request-timestamp']}:${rawBody}`;\n\n// extract the received signature from the request headers\nconst receivedSignature = item.json.headers['x-slack-signature'];\n\nconst expectedSignature = `v0=${crypto.createHmac('sha256', SIGNING_SECRET)\n.update(baseStr, 'utf8')\n.digest('hex')}`;\n\n// match the two signatures\nif (expectedSignature !== receivedSignature) {\nthrow new Error('Unauthorized, umatched signatures');\n}\n\nreturn $input.all();"
},
"typeVersion": 2,
"notes": "This code node performs automated tasks as part of the workflow."
}
],
"pinData": {},
"connections": {
"ee413d6c-dad3-4e57-b08d-ffd0f84c682e": {
"main": [
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-8a8e12aa",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-116a2c56",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-ab2b7a25",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-c97572ed",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-90af1326",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-eef41f4c",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-faa1cd5b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ee413d6c-dad3-4e57-b08d-ffd0f84c682e-d8d66bf2",
"type": "main",
"index": 0
}
]
]
},
"30355072-5d75-4deb-af67-909ba59e6eb3": {
"main": [
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-2a42ccd1",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-f673f537",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-e058bec7",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-4df044c0",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-39ef9a3f",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-6d1f3093",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-492c3a45",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-30355072-5d75-4deb-af67-909ba59e6eb3-2a5a2b1f",
"type": "main",
"index": 0
}
]
]
},
"4c730be9-d3f5-45ee-8f2b-b6bfd685ea78": {
"main": [
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-ad803618",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-e5b24209",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-cbbe9b36",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-5c2e3265",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-72e7ec3b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-a52374c1",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-c0454db5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-4c730be9-d3f5-45ee-8f2b-b6bfd685ea78-42f5eb85",
"type": "main",
"index": 0
}
]
]
},
"ed9f2ed8-5266-42a3-9d47-621050e5bf97": {
"main": [
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-88425cfb",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-30023850",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-39cae7e4",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-2ed25369",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-3a3401a6",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-78f9c8d5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-ea1046ca",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ed9f2ed8-5266-42a3-9d47-621050e5bf97-78f93133",
"type": "main",
"index": 0
}
]
]
},
"e56875c4-ce2b-4639-aabc-21f1562a3858": {
"main": [
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-2b3cf3f0",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-3307e8a6",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-bf9bca94",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-a80fc2dc",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-ab738224",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-a28e1492",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-055fe305",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-e56875c4-ce2b-4639-aabc-21f1562a3858-1904632d",
"type": "main",
"index": 0
}
]
]
},
"99cab485-4099-4505-9c9e-33ea389818e5": {
"main": [
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-c4b58a4e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-63a49a4e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-5e2d3076",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-d9b2595e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-3ea11816",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-0d8e4c7e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-3c9c2a19",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-99cab485-4099-4505-9c9e-33ea389818e5-ef5a5941",
"type": "main",
"index": 0
}
]
]
},
"09dc7ecf-a577-427e-a193-ed29d260c5fe": {
"main": [
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-1d2c618e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-cf597a1b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-8aa4d07e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-325b602f",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-087f11cf",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-57682b02",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-5b7908c0",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-09dc7ecf-a577-427e-a193-ed29d260c5fe-140e6c27",
"type": "main",
"index": 0
}
]
]
},
"0ca15a51-2e56-4ef4-8be6-96f45ed17867": {
"main": [
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-82936165",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-33ea3467",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-1cbf2d1c",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-702b9d0a",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-7218d7e4",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-cf407bf6",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-58b00304",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0ca15a51-2e56-4ef4-8be6-96f45ed17867-50819b06",
"type": "main",
"index": 0
}
]
]
},
"8e0a3745-348b-42db-82cc-55676c897ad7": {
"main": [
[
{
"node": "error-handler-8e0a3745-348b-42db-82cc-55676c897ad7-d68fefbd",
"type": "main",
"index": 0
}
]
]
},
"9904180a-e937-43fd-9b04-627e860d693a": {
"main": [
[
{
"node": "error-handler-9904180a-e937-43fd-9b04-627e860d693a-66d828b2",
"type": "main",
"index": 0
}
]
]
},
"1f2eff56-a89b-4d6d-af8b-477c81c8bab3": {
"main": [
[
{
"node": "error-handler-1f2eff56-a89b-4d6d-af8b-477c81c8bab3-4cda18de",
"type": "main",
"index": 0
}
]
]
},
"0c0d0487-a594-4e88-b777-21b4816115cd": {
"main": [
[
{
"node": "error-handler-0c0d0487-a594-4e88-b777-21b4816115cd-d0c6160e",
"type": "main",
"index": 0
}
]
]
}
},
"name": "Slack Workflow",
"settings": {
"executionOrder": "v1",
"saveManualExecutions": true,
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": null,
"timezone": "UTC",
"executionTimeout": 3600,
"maxExecutions": 1000,
"retryOnFail": true,
"retryCount": 3,
"retryDelay": 1000
},
"description": "Automated workflow: Slack Workflow. This workflow integrates 13 different services: webhook, stickyNote, httpRequest, code, merge. It contains 54 nodes and follows best practices for error handling and security.",
"meta": {
"instanceId": "workflow-f9476edd",
"versionId": "1.0.0",
"createdAt": "2025-09-29T07:08:00.202546",
"updatedAt": "2025-09-29T07:08:00.202566",
"owner": "n8n-user",
"license": "MIT",
"category": "automation",
"status": "active",
"priority": "high",
"environment": "production"
},
"tags": [
"automation",
"n8n",
"production-ready",
"excellent",
"optimized"
],
"notes": "Excellent quality workflow: Slack Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}