{
  "name": "Automatically optimise images added to a Google drive folder",
  "nodes": [
    {
      "id": "a6fac2bb-4079-4872-9cc9-17b1016d2fcc",
      "name": "Check GDrive for new images",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        500,
        160
      ]
    },
    {
      "id": "a0cae553-e4c1-408b-b11a-ceda4ff1aaa4",
      "name": "Download image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        700,
        160
      ]
    },
    {
      "id": "006ba31a-f42b-460c-87e1-66c5345fb6d7",
      "name": "Optimise - Send image to TinyPNG",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        940,
        320
      ]
    },
    {
      "id": "e380304e-1c94-4841-bc1c-73047e4c2501",
      "name": "Get optimised image from tinyPNG",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1140,
        320
      ]
    },
    {
      "id": "f4db56cf-e362-41da-b2c2-da59b71a103f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -60
      ],
      "parameters": {
        "width": 459.2991776576996,
        "height": 146.4269155371431,
        "content": "## Automatically optimise images uploaded to Google drive folder\nEach time an image is added to a google drive folder, this workflow will send it to tinypng.com to optimise the size and resave it to a"
      }
    },
    {
      "id": "b9e2dd81-245d-4328-adbc-a1f17100d590",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        120
      ],
      "parameters": {
        "width": 463.09809221779403,
        "height": 176.7894351639415,
        "content": "### 1. Pre-setup: Google Drive credentials\n\n**a.** Firstly you'll need to setup Google Drive credentials. Best thing is to [read n8n docs](https://docs.n8n.io/integrations/builtin/credentials/google/o"
      }
    },
    {
      "id": "285b5324-07d5-4f17-b6cc-9013e60644ad",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -60
      ],
      "parameters": {
        "width": 411.49840818526235,
        "height": 189.2115813199212,
        "content": "### 2. Choose the Google Drive folder n8n is going to watch for new files\n\n**a.** Go to Google Drive and create the folder you want n8n to watch for new images\n**b.** Then you need to select that fold"
      }
    },
    {
      "id": "8b574c32-baec-48ec-9cab-41d9f9813c6f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        100
      ],
      "parameters": {
        "width": 322.632285684791,
        "height": 189.2115813199212,
        "content": "### 3. Create an API key for tinypng.com\n\n**a.** Visit [tinypng.com](https://tinypng.com/developers) and request an API key\n**b.** Update the \"Authorisation\" parameter value with your api key. It will"
      }
    },
    {
      "id": "d3740bb8-f296-4b81-816e-ebc6e42927ad",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        240
      ],
      "parameters": {
        "width": 322.632285684791,
        "height": 239.85571564814694,
        "content": "### 4. Choose your Google Drive folder to save your upload your optimised images to\n\n**a.** Finally, create and select the folder that you want your optimised images to be saved to\n**b.** OPTIONAL: Yo"
      }
    },
    {
      "id": "b69a925f-9938-4672-9329-4f8895ea9c79",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1480,
        520
      ]
    }
  ],
  "connections": {
    "Download image": {
      "main": [
        [
          {
            "node": "Optimise - Send image to TinyPNG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check GDrive for new images": {
      "main": [
        [
          {
            "node": "Download image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get optimised image from tinyPNG": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Optimise - Send image to TinyPNG": {
      "main": [
        [
          {
            "node": "Get optimised image from tinyPNG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}