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 →
{
"nodes": [
{
"id": "ec2683b4-06ae-4255-bf20-b6c5850f4fc5",
"name": "Parse Webhook",
"type": "n8n-nodes-base.set",
"position": [
-480,
1100
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e63f9299-a19d-4ba1-93b0-59f458769fb2",
"name": "response",
"type": "object",
"value": "={{ $json.body.payload }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "bb178ce9-3177-433e-a877-3635be7c3705",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-820,
740
],
"parameters": {
"color": 7,
"width": 466.8168310000617,
"height": 567.6433222116042,
"content": "\n## Events Webhook Trigger\nThe first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by [clicking here](https://api.slack.com/apis/connections/events-api). \n\nThe second node extracts the payload from slack into an object that n8n can understand. "
},
"typeVersion": 1
},
{
"id": "04d35926-1c7d-406b-90f1-9641680cb3b7",
"name": "Sticky Note15",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
420
],
"parameters": {
"color": 7,
"width": 566.0553219408072,
"height": 1390.6748140207737,
"content": "\n## Efficient Slack Interaction Handling with n8n\n\nThis section of the workflow is designed to efficiently manage and route messages and submissions from Slack based on specific triggers and conditions. When a Slack interaction occurs\u2014such as a user triggering a vulnerability scan or generating a report through a modal\u2014the workflow intelligently routes the message to the appropriate action:\n\n- **Dynamic Routing**: Uses conditions to determine the nature of the Slack interaction, whether it's a direct command to initiate a scan or a request to generate a report.\n- **Modal Management**: Differentiates actions based on modal titles and `callback_id`s, ensuring that each type of submission is processed according to its context.\n- **Streamlined Responses**: After routing, the workflow promptly handles the necessary responses or actions, including closing modal popups and responding to Slack with appropriate confirmation or data.\n\n**Purpose**: This mechanism ensures that all interactions within Slack are handled quickly and accurately, automating responses and actions in real-time to enhance user experience and workflow efficiency."
},
"typeVersion": 1
},
{
"id": "e6a046b1-1c8b-4585-b257-117f562dd30f",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
520
],
"parameters": {
"color": 7,
"width": 396.6025898621133,
"height": 1553.6713675640199,
"content": "\n## Display Modal Popup\nThis section pops open a modal window that is later used to send data into TheHive. \n\nModals can be customized to perform all sorts of actions. And they are natively mobile! You can see a screenshot of the Slack Modals on the right. \n\nLearn more about them by [clicking here](https://api.slack.com/surfaces/modals)"
},
"typeVersion": 1
},
{
"id": "93b094eb-4a0a-4639-b343-932b7f261b0d",
"name": "Close Modal Popup",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
-320,
2180
],
"parameters": {
"options": {},
"respondWith": "json",
"responseBody": "{\n \"response_action\": \"clear\"\n}"
},
"typeVersion": 1.1
},
{
"id": "6d67a6f5-9966-40a9-a9ad-db514027257b",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
860
],
"parameters": {
"color": 5,
"width": 376.26546828439086,
"height": 113.6416448104651,
"content": "### \ud83d\ude4b Don't forget your slack credentials!\nThankfully n8n makes it easy, as long as you've added credentials to a normal slack node, these http nodes are a snap to change via the drop down. "
},
"typeVersion": 1
},
{
"id": "3222f63e-036f-43b6-9d60-a9d1a19bafa5",
"name": "Idea Selector Modal",
"type": "n8n-nodes-base.httpRequest",
"position": [
320,
1000
],
"parameters": {
"url": "https://slack.com/api/views.open",
"method": "POST",
"options": {},
"jsonBody": "= {\n \"trigger_id\": \"{{ $('Parse Webhook').item.json['response']['trigger_id'] }}\",\n \"external_id\": \"Image Uploader\",\n \"view\": {\n\t\"title\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"File Upload - Select\",\n\t\t\"emoji\": true\n\t},\n\t\"type\": \"modal\",\n\t\"external_id\": \"file_upload_selector\",\n\t\"close\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Cancel\",\n\t\t\"emoji\": true\n\t},\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"block_id\": \"greeting_section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \":wave: Hey {{ $('Route Message').item.json.response.user.username }}!\\n\\nNeed to upload an image to a public repository? If so, you've come to the right place. Use the form below to upload your images to our public S3 CDN. You will get a message with the link to the file after submission. This tool only accepts .jpg, .png, and .pdf uploads.\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\",\n\t\t\t\"block_id\": \"divider_1\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"actions\",\n\t\t\t\"block_id\": \"folder_type_selection\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"radio_buttons\",\n\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"text\": {\n\t\t\t\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\t\t\t\"text\": \"Create New Folder\",\n\t\t\t\t\t\t\t\t\"emoji\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"value\": \"createfolder\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"text\": {\n\t\t\t\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\t\t\t\"text\": \"Use Existing Folder\",\n\t\t\t\t\t\t\t\t\"emoji\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"value\": \"selectfolder\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"action_id\": \"folder-type\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n}",
"sendBody": true,
"jsonQuery": "{\n \"Content-type\": \"application/json\"\n}",
"sendQuery": true,
"specifyBody": "json",
"specifyQuery": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "slackApi"
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "a23e7c3b-7f20-4832-a4f0-a696e661accf",
"name": "Route Message",
"type": "n8n-nodes-base.switch",
"position": [
-300,
1100
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Idea Selector",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.response.callback_id }}",
"rightValue": "idea_selector"
}
]
},
"renameOutput": true
},
{
"outputKey": "Block Action",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a0374196-2553-4916-bc55-c2ea663a7c1f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.response.type }}",
"rightValue": "block_actions"
}
]
},
"renameOutput": true
},
{
"outputKey": "Submit Data",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "65daa75f-2e17-4ba0-8fd8-2ac2159399e3",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.response.type }}",
"rightValue": "view_submission"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "none"
}
},
"typeVersion": 3
},
{
"id": "91cde8d3-2eca-4a00-a2cc-61a4f2d3280f",
"name": "Route Message1",
"type": "n8n-nodes-base.switch",
"position": [
40,
1400
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Create Folder",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "02868fd8-2577-4c6d-af5e-a1963cb2f786",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.response.view.state.values.folder_type_selection['folder-type'].selected_option.value }}",
"rightValue": "createfolder"
}
]
},
"renameOutput": true
},
{
"outputKey": "Select Folder",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "211e13e8-3433-42d3-8884-ad89f2fee5d0",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.response.view.state.values.folder_type_selection['folder-type'].selected_option.value }}",
"rightValue": "selectfolder"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "none"
}
},
"typeVersion": 3
},
{
"id": "0dd0e945-8a1d-4ba8-b711-e8ccc4a98ec1",
"name": "Create Folder",
"type": "n8n-nodes-base.httpRequest",
"position": [
320,
1320
],
"parameters": {
"url": "https://slack.com/api/views.push",
"method": "POST",
"options": {},
"jsonBody": "= {\n \"trigger_id\": \"{{ $('Parse Webhook').item.json['response']['trigger_id'] }}\",\n \"view\": {\n\t\"title\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"File Upload - New Folder\",\n\t\t\"emoji\": true\n\t},\n\t\"submit\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Upload\",\n\t\t\"emoji\": true\n\t},\n\t\"type\": \"modal\",\n\t\"external_id\": \"file_upload_new_folder\",\n\t\"close\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Cancel\",\n\t\t\"emoji\": true\n\t},\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"block_id\": \"greeting_section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \":wave: Hey there!\\n\\nNeed to upload an image to a public repository? If so, you've come to the right place. Use the form below to upload your images to our public S3 CDN. You will get a message with the link to the file after submission. This tool only accepts .jpg, .png, and .pdf uploads.\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\",\n\t\t\t\"block_id\": \"divider_1\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"folder_name_block\",\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"plain_text_input\",\n\t\t\t\t\"action_id\": \"folder_name_input_action\",\n\t\t\t\t\"placeholder\": {\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"example_folder_name\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"Folder Name\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"context\",\n\t\t\t\"block_id\": \"folder_creation_context\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"This will create a new folder in the CDN.\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"input_block_file\",\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"Image File Binary\"\n\t\t\t},\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"file_input\",\n\t\t\t\t\"action_id\": \"file_input_action\",\n\t\t\t\t\"filetypes\": [\n\t\t\t\t\t\"jpg\",\n\t\t\t\t\t\"png\",\n\t\t\t\t\t\"pdf\"\n\t\t\t\t],\n\t\t\t\t\"max_files\": 10\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"context\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"You can upload up to 10 files at a time.\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n}",
"sendBody": true,
"jsonQuery": "{\n \"Content-type\": \"application/json\"\n}",
"sendQuery": true,
"specifyBody": "json",
"specifyQuery": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "slackApi"
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "d4cdcd35-b28e-4d01-a35f-20d239f92fca",
"name": "Select Folder",
"type": "n8n-nodes-base.httpRequest",
"position": [
320,
1560
],
"parameters": {
"url": "https://slack.com/api/views.push",
"method": "POST",
"options": {},
"jsonBody": "= {\n \"trigger_id\": \"{{ $('Parse Webhook').item.json['response']['trigger_id'] }}\",\n \"view\": {\n\t\"title\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"File Upload - Old Folder\",\n\t\t\"emoji\": true\n\t},\n\t\"submit\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Upload\",\n\t\t\"emoji\": true\n\t},\n\t\"type\": \"modal\",\n\t\"external_id\": \"file_upload_old_folder\",\n\t\"close\": {\n\t\t\"type\": \"plain_text\",\n\t\t\"text\": \"Cancel\",\n\t\t\"emoji\": true\n\t},\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"block_id\": \"greeting_section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \":wave: Hey there!\\n\\nNeed to upload an image to a public repository? If so, you've come to the right place. Use the form below to upload your images to our public S3 CDN. You will get a message with the link to the file after submission. This tool only accepts .jpg, .png, and .pdf uploads.\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\",\n\t\t\t\"block_id\": \"divider_1\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"tool_selector\",\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"external_select\",\n\t\t\t\t\"placeholder\": {\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"Search For Existing Folder Name\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t},\n\t\t\t\t\"action_id\": \"folder_selector\"\n\t\t\t},\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"Folder Selector\",\n\t\t\t\t\"emoji\": true\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"context\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"To see all folders, type in 'all'\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"type\": \"input\",\n\t\t\t\"block_id\": \"input_block_file\",\n\t\t\t\"label\": {\n\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\"text\": \"Image File Binary\"\n\t\t\t},\n\t\t\t\"element\": {\n\t\t\t\t\"type\": \"file_input\",\n\t\t\t\t\"action_id\": \"file_input_action\",\n\t\t\t\t\"filetypes\": [\n\t\t\t\t\t\"jpg\",\n\t\t\t\t\t\"png\",\n\t\t\t\t\t\"pdf\"\n\t\t\t\t],\n\t\t\t\t\"max_files\": 10\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"context\",\n\t\t\t\"elements\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"plain_text\",\n\t\t\t\t\t\"text\": \"You can upload up to 10 files at a time.\",\n\t\t\t\t\t\"emoji\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}\n}",
"sendBody": true,
"jsonQuery": "{\n \"Content-type\": \"application/json\"\n}",
"sendQuery": true,
"specifyBody": "json",
"specifyQuery": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "slackApi"
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "997821dc-c8e8-45f5-87e9-d006fe6b5de7",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
460,
2140
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "e7ae5827-2fe3-411b-9689-f0f6b2d9dfc0",
"name": "Success Response",
"type": "n8n-nodes-base.set",
"position": [
1440,
2360
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "bd5f7054-0259-45a4-b01e-11c63b76c18e",
"name": "link",
"type": "string",
"value": "=https://uploads.n8n.io/{{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}/{{ $('Split Out Files').item.json.name.replace(/\\s+/g, '_') }}"
},
{
"id": "2ed40d88-8ca5-4fe6-9387-3b021fe00dcf",
"name": "slackresponse",
"type": "string",
"value": "={\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"`https://uploads.n8n.io/{{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}/{{ $('Split Out Files').item.json.name.replace(/\\s+/g, '_') }}`\"}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "72f1af25-faef-4556-8b71-97deb03b7755",
"name": "Check if uploaded successfully",
"type": "n8n-nodes-base.if",
"position": [
1160,
2420
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8b51d4d6-feb6-4e1a-9077-9bd88207d3b7",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.success }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "912e8689-53e0-4919-a664-b9025b4618b6",
"name": "move on to next",
"type": "n8n-nodes-base.noOp",
"position": [
1800,
2360
],
"parameters": {},
"typeVersion": 1
},
{
"id": "69d94e2e-9ff8-42ae-8969-bbe4b11976d2",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
760,
1940
],
"parameters": {},
"typeVersion": 1
},
{
"id": "8c43201b-97ee-419a-81a3-5cd9c204022a",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
980,
1940
],
"parameters": {
"options": {
"mergeLists": false
},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "slackresponse"
}
]
}
},
"typeVersion": 1
},
{
"id": "792eaa0e-e281-451a-b582-4e3ecef9cb20",
"name": "Route Action",
"type": "n8n-nodes-base.switch",
"position": [
-80,
2180
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "File Upload",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "54f7e9ca-23d5-428c-8148-41f27cafffd8",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "t",
"rightValue": "f"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": 0
}
},
"typeVersion": 3
},
{
"id": "3877766c-dc3f-4e4e-9921-5ef36c7ae787",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-720,
1100
],
"parameters": {
"path": "slack-image-upload-bot",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "b2ee67cb-dd60-4775-aa1a-8d52e192991a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-320,
2080
],
"parameters": {
"color": 7,
"width": 940,
"height": 300,
"content": "## Split Files out for processing\nTakes the single response from Slack and splits out the file objects to loop across them."
},
"typeVersion": 1
},
{
"id": "c28de034-b4d6-4f78-a91b-0667830a7632",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
2180
],
"parameters": {
"color": 7,
"width": 1360,
"height": 540,
"content": "## Loop through files to upload to S3 Cloudflare Bucket\nThe success and failure path report back to slack once all files are uploaded. "
},
"typeVersion": 1
},
{
"id": "141cb7dc-d9a3-4440-b60f-7a3b3dd8f831",
"name": "Failure Response",
"type": "n8n-nodes-base.set",
"position": [
1460,
2560
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "bd5f7054-0259-45a4-b01e-11c63b76c18e",
"name": "link",
"type": "string",
"value": "=Unable to upload {{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}/{{ $('Split Out Files').item.json.name.replace(/\\s+/g, '_') }}"
},
{
"id": "39bbddba-e7a4-44cf-aab4-a90669548454",
"name": "slackresponse",
"type": "string",
"value": "={\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":warning:Unable to upload: `https://uploads.n8n.io/{{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}/{{ $('Split Out Files').item.json.name.replace(/\\s+/g, '_') }}`\"}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e947e3b4-a016-4d9e-a647-53a666d4c1b9",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
1780
],
"parameters": {
"color": 7,
"width": 1080,
"height": 380,
"content": "## Combine Success and failure responses in final message\nAllows for the workflow to fail gracefully. "
},
"typeVersion": 1
},
{
"id": "7e7275c8-976b-493d-bfd8-7180517bac53",
"name": "Respond to Slack Webhook - Success",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
40,
1000
],
"parameters": {
"options": {},
"respondWith": "noData"
},
"typeVersion": 1.1
},
{
"id": "d508c32d-414d-4316-8fdc-e1c8687f6fa8",
"name": "Respond to Slack Webhook - No Action",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
-140,
1400
],
"parameters": {
"options": {},
"respondWith": "noData"
},
"typeVersion": 1.1
},
{
"id": "b2a06a70-4ec6-4d10-94e6-0467009af01e",
"name": "Download File Binary",
"type": "n8n-nodes-base.httpRequest",
"position": [
760,
2420
],
"parameters": {
"url": "={{ $json.url_private_download }}",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "slackApi"
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "3ea9d291-233b-4f25-8538-f9427e55001b",
"name": "Upload to S3 Bucket",
"type": "n8n-nodes-base.s3",
"position": [
960,
2420
],
"parameters": {
"fileName": "={{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}/{{ $('Split Out Files').item.json.name.replace(/\\s+/g, '_') }}",
"operation": "upload",
"bucketName": "n8n-uploads",
"additionalFields": {}
},
"credentials": {
"s3": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "e1182b20-d90d-4f53-96e7-90b36aff7053",
"name": "Post Image to Channel",
"type": "n8n-nodes-base.slack",
"position": [
1420,
1940
],
"parameters": {
"text": "New Files Uploaded",
"select": "channel",
"blocksUi": "={\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \":file_folder: *{{ $('Parse Webhook').item.json.response.view.state.values.folder_name_block?.folder_name_input_action?.value ? $('Parse Webhook').item.json.response.view.state.values.folder_name_block.folder_name_input_action.value.replace(/\\s+/g, '_') : $('Parse Webhook').item.json.response.view.state.values.tool_selector.folder_selector.selected_option.value }}*\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"*Here are the file URLs you uploaded:*\"\n\t\t\t}\n\t\t},\n\t\t{{ $('Aggregate').item.json.slackresponse }}\n\t]\n}",
"channelId": {
"__rl": true,
"mode": "id",
"value": "C081EHWKKH6"
},
"messageType": "block",
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "39814189-fbc3-46c0-992a-41623d7d0e7b",
"name": "Split Out Files",
"type": "n8n-nodes-base.splitOut",
"position": [
140,
2180
],
"parameters": {
"options": {},
"fieldToSplitOut": "response.view.state.values.input_block_file.file_input_action.files"
},
"typeVersion": 1
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Parse Webhook",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Post Image to Channel",
"type": "main",
"index": 0
}
]
]
},
"Route Action": {
"main": [
[
{
"node": "Split Out Files",
"type": "main",
"index": 0
}
]
]
},
"Parse Webhook": {
"main": [
[
{
"node": "Route Message",
"type": "main",
"index": 0
}
]
]
},
"Route Message": {
"main": [
[
{
"node": "Respond to Slack Webhook - Success",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond to Slack Webhook - No Action",
"type": "main",
"index": 0
}
],
[
{
"node": "Close Modal Popup",
"type": "main",
"index": 0
}
]
]
},
"Route Message1": {
"main": [
[
{
"node": "Create Folder",
"type": "main",
"index": 0
}
],
[
{
"node": "Select Folder",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
],
[
{
"node": "Download File Binary",
"type": "main",
"index": 0
}
]
]
},
"Split Out Files": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"move on to next": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Failure Response": {
"main": [
[
{
"node": "move on to next",
"type": "main",
"index": 0
}
]
]
},
"Success Response": {
"main": [
[
{
"node": "move on to next",
"type": "main",
"index": 0
}
]
]
},
"Close Modal Popup": {
"main": [
[
{
"node": "Route Action",
"type": "main",
"index": 0
}
]
]
},
"Upload to S3 Bucket": {
"main": [
[
{
"node": "Check if uploaded successfully",
"type": "main",
"index": 0
}
]
]
},
"Download File Binary": {
"main": [
[
{
"node": "Upload to S3 Bucket",
"type": "main",
"index": 0
}
]
]
},
"No Operation, do nothing": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Check if uploaded successfully": {
"main": [
[
{
"node": "Success Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Failure Response",
"type": "main",
"index": 0
}
]
]
},
"Respond to Slack Webhook - Success": {
"main": [
[
{
"node": "Idea Selector Modal",
"type": "main",
"index": 0
}
]
]
},
"Respond to Slack Webhook - No Action": {
"main": [
[
{
"node": "Route Message1",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
s3slackApi
About this workflow
Splitout. Uses stickyNote, respondToWebhook, httpRequest, splitInBatches. Webhook trigger; 29 nodes.
Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →