{
  "name": "Upload images to an S3 bucket via a Slack bot",
  "nodes": [
    {
      "id": "ec2683b4-06ae-4255-bf20-b6c5850f4fc5",
      "name": "Parse Webhook",
      "type": "n8n-nodes-base.set",
      "position": [
        -480,
        1100
      ]
    },
    {
      "id": "bb178ce9-3177-433e-a877-3635be7c3705",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        740
      ],
      "parameters": {
        "width": 466.8168310000617,
        "height": 567.6433222116042,
        "content": "![Imgur](https://i.imgur.com/iKyMV0N.png)\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 "
      }
    },
    {
      "id": "04d35926-1c7d-406b-90f1-9641680cb3b7",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        420
      ],
      "parameters": {
        "width": 566.0553219408072,
        "height": 1390.6748140207737,
        "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\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 b"
      }
    },
    {
      "id": "e6a046b1-1c8b-4585-b257-117f562dd30f",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        520
      ],
      "parameters": {
        "width": 396.6025898621133,
        "height": 1553.6713675640199,
        "content": "![Imgur](https://i.imgur.com/iKyMV0N.png)\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 "
      }
    },
    {
      "id": "93b094eb-4a0a-4639-b343-932b7f261b0d",
      "name": "Close Modal Popup",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -320,
        2180
      ]
    },
    {
      "id": "6d67a6f5-9966-40a9-a9ad-db514027257b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        860
      ],
      "parameters": {
        "width": 376.26546828439086,
        "height": 113.6416448104651,
        "content": "### 🙋 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. "
      }
    },
    {
      "id": "3222f63e-036f-43b6-9d60-a9d1a19bafa5",
      "name": "Idea Selector Modal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        1000
      ]
    },
    {
      "id": "a23e7c3b-7f20-4832-a4f0-a696e661accf",
      "name": "Route Message",
      "type": "n8n-nodes-base.switch",
      "position": [
        -300,
        1100
      ]
    },
    {
      "id": "91cde8d3-2eca-4a00-a2cc-61a4f2d3280f",
      "name": "Route Message1",
      "type": "n8n-nodes-base.switch",
      "position": [
        40,
        1400
      ]
    },
    {
      "id": "0dd0e945-8a1d-4ba8-b711-e8ccc4a98ec1",
      "name": "Create Folder",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        1320
      ]
    },
    {
      "id": "d4cdcd35-b28e-4d01-a35f-20d239f92fca",
      "name": "Select Folder",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        1560
      ]
    },
    {
      "id": "997821dc-c8e8-45f5-87e9-d006fe6b5de7",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        460,
        2140
      ]
    },
    {
      "id": "e7ae5827-2fe3-411b-9689-f0f6b2d9dfc0",
      "name": "Success Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1440,
        2360
      ]
    },
    {
      "id": "72f1af25-faef-4556-8b71-97deb03b7755",
      "name": "Check if uploaded successfully",
      "type": "n8n-nodes-base.if",
      "position": [
        1160,
        2420
      ]
    },
    {
      "id": "912e8689-53e0-4919-a664-b9025b4618b6",
      "name": "move on to next",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1800,
        2360
      ]
    },
    {
      "id": "69d94e2e-9ff8-42ae-8969-bbe4b11976d2",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        760,
        1940
      ]
    },
    {
      "id": "8c43201b-97ee-419a-81a3-5cd9c204022a",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        980,
        1940
      ]
    },
    {
      "id": "792eaa0e-e281-451a-b582-4e3ecef9cb20",
      "name": "Route Action",
      "type": "n8n-nodes-base.switch",
      "position": [
        -80,
        2180
      ]
    },
    {
      "id": "3877766c-dc3f-4e4e-9921-5ef36c7ae787",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -720,
        1100
      ]
    },
    {
      "id": "b2ee67cb-dd60-4775-aa1a-8d52e192991a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        2080
      ],
      "parameters": {
        "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."
      }
    },
    {
      "id": "c28de034-b4d6-4f78-a91b-0667830a7632",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        2180
      ],
      "parameters": {
        "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. "
      }
    },
    {
      "id": "141cb7dc-d9a3-4440-b60f-7a3b3dd8f831",
      "name": "Failure Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1460,
        2560
      ]
    },
    {
      "id": "e947e3b4-a016-4d9e-a647-53a666d4c1b9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        1780
      ],
      "parameters": {
        "width": 1080,
        "height": 380,
        "content": "## Combine Success and failure responses in final message\nAllows for the workflow to fail gracefully. "
      }
    },
    {
      "id": "7e7275c8-976b-493d-bfd8-7180517bac53",
      "name": "Respond to Slack Webhook - Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        40,
        1000
      ]
    },
    {
      "id": "d508c32d-414d-4316-8fdc-e1c8687f6fa8",
      "name": "Respond to Slack Webhook - No Action",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -140,
        1400
      ]
    },
    {
      "id": "b2a06a70-4ec6-4d10-94e6-0467009af01e",
      "name": "Download File Binary",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        760,
        2420
      ]
    },
    {
      "id": "3ea9d291-233b-4f25-8538-f9427e55001b",
      "name": "Upload to S3 Bucket",
      "type": "n8n-nodes-base.s3",
      "position": [
        960,
        2420
      ]
    },
    {
      "id": "e1182b20-d90d-4f53-96e7-90b36aff7053",
      "name": "Post Image to Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        1420,
        1940
      ]
    },
    {
      "id": "39814189-fbc3-46c0-992a-41623d7d0e7b",
      "name": "Split Out Files",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        140,
        2180
      ]
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}