{
  "name": "Automate S3 video transcoding, thumbnail generation & CDN distribution",
  "nodes": [
    {
      "id": "0c0cdae8-5aa2-4edb-bc88-1bfc52dccc05",
      "name": "Sticky Note - Overview1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        1200
      ],
      "parameters": {
        "width": 400,
        "height": 380,
        "content": "## Video Processing Pipeline\n\nThis workflow automates video processing from upload to delivery. When a video is uploaded to S3, it automatically generates thumbnails at multiple sizes, creates an anim"
      }
    },
    {
      "id": "b99bbc11-8163-45ef-8138-962239fb6c80",
      "name": "Sticky Note - Step ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        1056
      ],
      "parameters": {
        "width": 584,
        "height": 652,
        "content": "### Step 1: Video Detection\nReceives the upload event and validates the file is a video format. Extracts the S3 bucket and file path, then generates a unique job ID for tracking."
      }
    },
    {
      "id": "39259dec-4c82-4ad6-8620-7149412105b2",
      "name": "Sticky Note - Step 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1024
      ],
      "parameters": {
        "width": 488,
        "height": 684,
        "content": "### Step 2: Media Analysis\nUses FFprobe to extract video metadata including duration, resolution, bitrate, and codec info. Determines optimal thumbnail timestamps and whether transcoding is needed."
      }
    },
    {
      "id": "d8ab0e88-4c79-4b2c-b124-9ccaead04fd2",
      "name": "Sticky Note - Step 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        992
      ],
      "parameters": {
        "width": 360,
        "height": 716,
        "content": "### Step 3: Processing\nGenerates thumbnails in 3 sizes, creates an animated GIF preview, and transcodes the video into multiple resolutions. All assets are uploaded to S3 for CDN distribution."
      }
    },
    {
      "id": "76673f42-9830-4752-8e9b-bff98cffaf1a",
      "name": "Sticky Note - Step 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        992
      ],
      "parameters": {
        "width": 568,
        "height": 716,
        "content": "### Step 4: Distribution\nInvalidates CDN cache to serve fresh content, generates signed URLs for secure access, logs metrics to Google Sheets, and notifies your team via Slack."
      }
    },
    {
      "id": "53ac5a8e-8bb4-42ce-98a1-8659072659b5",
      "name": "S3 Event Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        640,
        1232
      ]
    },
    {
      "id": "651350a0-385f-489b-b6a5-329ad302820e",
      "name": "Manual Process Trigger1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        640,
        1424
      ]
    },
    {
      "id": "245e3b5c-924a-48f2-bedc-323460577049",
      "name": "Merge Triggers1",
      "type": "n8n-nodes-base.merge",
      "position": [
        864,
        1328
      ]
    },
    {
      "id": "1591ba26-5593-4bfc-bb66-682ed043d886",
      "name": "Extract S3 Info1",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        1328
      ]
    },
    {
      "id": "ece174e5-6e4d-420d-9a41-6853c7e70b01",
      "name": "Check Is Video1",
      "type": "n8n-nodes-base.if",
      "position": [
        1216,
        1328
      ]
    },
    {
      "id": "83515379-c92e-4fdb-994d-9049b14d242b",
      "name": "Invalid File Response1",
      "type": "n8n-nodes-base.set",
      "position": [
        1408,
        1536
      ]
    },
    {
      "id": "a404b1c5-56c1-4d35-bbac-ddd81a60159c",
      "name": "Get Video Metadata (FFprobe)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1408,
        1232
      ]
    },
    {
      "id": "231560fe-7da8-4cad-af09-64bd18a6202a",
      "name": "Parse Video Metadata1",
      "type": "n8n-nodes-base.code",
      "position": [
        1584,
        1232
      ]
    },
    {
      "id": "4e0a1804-73cf-49d4-8734-dc6aab541eb6",
      "name": "Generate Thumbnails (FFmpeg)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        1136
      ]
    },
    {
      "id": "c44f8ab4-c4ad-4348-b0e6-17b5b20819d6",
      "name": "Generate Preview GIF1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        1328
      ]
    },
    {
      "id": "a52101b0-eee8-41fb-9275-50e061e2e5b7",
      "name": "Transcode Video1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        1536
      ]
    },
    {
      "id": "2cb16b80-f76b-4573-b2fb-3716e97990ae",
      "name": "Aggregate Processing Results1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1936,
        1328
      ]
    },
    {
      "id": "273af213-8fad-4d56-93ec-6b17ad6076ae",
      "name": "Invalidate CDN Cache1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2128,
        1328
      ]
    },
    {
      "id": "9d5e9314-f5f5-43c9-8db4-67fb441ba6a8",
      "name": "Generate Signed URLs1",
      "type": "n8n-nodes-base.code",
      "position": [
        2304,
        1328
      ]
    },
    {
      "id": "2ff7a3a5-a318-4930-a3ac-c0fa3653d334",
      "name": "Log Processing Metrics1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2480,
        1232
      ]
    },
    {
      "id": "31dc01fb-e496-4520-b480-5c0007c02e94",
      "name": "Send Slack Notification1",
      "type": "n8n-nodes-base.slack",
      "position": [
        2480,
        1424
      ]
    },
    {
      "id": "ded2767b-743b-4180-be73-a96609925393",
      "name": "Merge Output Paths1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2656,
        1328
      ]
    },
    {
      "id": "592b01b7-3c0b-4311-a6cf-9c3252f0b5cb",
      "name": "Merge All Paths1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2848,
        1424
      ]
    },
    {
      "id": "33dbd120-352a-4a0d-b56c-6fa950beef7f",
      "name": "Respond to Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3024,
        1424
      ]
    }
  ],
  "connections": {
    "Check Is Video1": {
      "main": [
        [
          {
            "node": "Get Video Metadata (FFprobe)1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Invalid File Response1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Triggers1": {
      "main": [
        [
          {
            "node": "Extract S3 Info1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract S3 Info1": {
      "main": [
        [
          {
            "node": "Check Is Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Paths1": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcode Video1": {
      "main": [
        [
          {
            "node": "Aggregate Processing Results1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "S3 Event Webhook1": {
      "main": [
        [
          {
            "node": "Merge Triggers1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Output Paths1": {
      "main": [
        [
          {
            "node": "Merge All Paths1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Preview GIF1": {
      "main": [
        [
          {
            "node": "Aggregate Processing Results1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Signed URLs1": {
      "main": [
        [
          {
            "node": "Log Processing Metrics1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Slack Notification1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invalidate CDN Cache1": {
      "main": [
        [
          {
            "node": "Generate Signed URLs1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Video Metadata1": {
      "main": [
        [
          {
            "node": "Generate Thumbnails (FFmpeg)1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Preview GIF1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Transcode Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invalid File Response1": {
      "main": [
        [
          {
            "node": "Merge All Paths1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Log Processing Metrics1": {
      "main": [
        [
          {
            "node": "Merge Output Paths1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Process Trigger1": {
      "main": [
        [
          {
            "node": "Merge Triggers1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Send Slack Notification1": {
      "main": [
        [
          {
            "node": "Merge Output Paths1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Aggregate Processing Results1": {
      "main": [
        [
          {
            "node": "Invalidate CDN Cache1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Thumbnails (FFmpeg)1": {
      "main": [
        [
          {
            "node": "Aggregate Processing Results1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video Metadata (FFprobe)1": {
      "main": [
        [
          {
            "node": "Parse Video Metadata1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}