{
  "name": "Replace images in Google Docs documents and download as PDF/Docx",
  "nodes": [
    {
      "id": "f4570aad-db25-4dcd-8589-b1c8335935de",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        20,
        5220
      ]
    },
    {
      "id": "675243b0-080f-4d5e-a0ca-a0fe0e7c04a9",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        185,
        5140
      ],
      "parameters": {
        "width": 426.32566328767217,
        "height": 260.3707944299243,
        "content": "**Find and replace image in docx. Connect to a datasource with an image URL you want to insert into the Docx file**"
      }
    },
    {
      "id": "16bbf5da-5ebc-4e9c-8b3c-80d0077c51b8",
      "name": "Find Image ID in Docx",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        900,
        5220
      ]
    },
    {
      "id": "60325192-4730-4410-ae33-9127ff8cc5f7",
      "name": "Make file shareable publically (optional)",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1360,
        5220
      ]
    },
    {
      "id": "6f254810-3ab8-4ec1-b964-8b399472acf3",
      "name": "Image URL",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        5220
      ]
    },
    {
      "id": "d33a913a-2d98-4922-ba8d-5d325b114572",
      "name": "Find & Copy Docx Template",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        660,
        5220
      ]
    },
    {
      "id": "1f43d321-eddf-4008-99e2-9338cc85bad2",
      "name": "Sticky Note42",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        5420
      ],
      "parameters": {
        "width": 415.45208033736463,
        "height": 105.04337297263078,
        "content": "**REQUIRED**\nConnect to your database of image urls to input. Name the column `url` like in the `Image URL` node. This flow works with an image URL only, not a physical image file"
      }
    },
    {
      "id": "0e1bb319-8429-4bde-88a3-9fd69df7c986",
      "name": "Own datasource",
      "type": "n8n-nodes-base.noOp",
      "position": [
        240,
        5220
      ]
    },
    {
      "id": "d534cc1f-e651-4c06-860b-ce3d3c648964",
      "name": "Sticky Note43",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        5420
      ],
      "parameters": {
        "width": 415.45208033736463,
        "height": 222.7191963089109,
        "content": "**OPTIONAL**\nIf you want to create multiple documents with multiple images then create a template in your GDrive folder with a placeholder image that you want to replace. This template will be copied "
      }
    },
    {
      "id": "b6a22eb4-0b13-4eb5-be40-ed2dfedf99b5",
      "name": "Sticky Note44",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        5120
      ],
      "parameters": {
        "width": 169.22824698060023,
        "height": 278.7193163441844,
        "content": "**Optional - create and copy a template document in your GDrive folder**"
      }
    },
    {
      "id": "25d2a7c0-cef7-4aaf-9bb8-fe9c83d73731",
      "name": "Sticky Note45",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        853,
        5120
      ],
      "parameters": {
        "width": 435.22861330045936,
        "height": 278.7193163441844,
        "content": "**Sends request to Google API to retrieve document details (including image ID) in the template document**"
      }
    },
    {
      "id": "f8dcb709-5505-4c63-afe9-83a0dfb608e9",
      "name": "Replace Image in Docx",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1100,
        5220
      ]
    },
    {
      "id": "f800131b-e8d3-4741-8e8d-ad208e53ebe7",
      "name": "Sticky Note46",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        5420
      ],
      "parameters": {
        "width": 297.15093794343295,
        "height": 373.0766632058715,
        "content": "**REQUIRED**\n- Update the Google Docs OAuth 2 API credentials [with your own](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledocs/)\n- Ensure Document ID is passing correctly t"
      }
    },
    {
      "id": "0cdad7ae-e407-4c21-b454-8b2824e2b6d4",
      "name": "Sticky Note47",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        5420
      ],
      "parameters": {
        "width": 747.7707439712262,
        "height": 222.7191963089109,
        "content": "**OPTIONAL**\n- Make the file publically shareable (anyone can view/edit)\n- Download the file as a Docx\n- Download the file as a PDF\n\n\nAll of the above requires authenticating with your GDrive account,"
      }
    },
    {
      "id": "fa6a214e-b6c5-403a-884a-d915f5a1362f",
      "name": "Download File - Docx",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1580,
        5220
      ]
    },
    {
      "id": "399e08ae-864d-4ffa-bc18-d82e03e30f7c",
      "name": "Download File - PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1800,
        5220
      ]
    },
    {
      "id": "0855b49a-dca3-4da8-8e22-4294523798d7",
      "name": "Sticky Note48",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        5120
      ],
      "parameters": {
        "width": 683.4764182113373,
        "height": 278.7193163441844,
        "content": "**Optional - make the file shareable, and download in docx and PDF format**"
      }
    },
    {
      "id": "d4a2e23d-9c14-4b0c-8fd3-99a981d2f39b",
      "name": "Sticky Note49",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        4960
      ],
      "parameters": {
        "width": 773.6179704580734,
        "height": 875.8289847608302,
        "content": "## Replace Images in Google Docs Documents and Download as PDF/Docx\n\n## Use Case\nAutomate image replacement in Google Docs:\n- You need to update document images dynamically\n- You want to create multip"
      }
    }
  ],
  "connections": {
    "Image URL": {
      "main": [
        [
          {
            "node": "Find & Copy Docx Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Own datasource": {
      "main": [
        [
          {
            "node": "Image URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File - Docx": {
      "main": [
        [
          {
            "node": "Download File - PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Image ID in Docx": {
      "main": [
        [
          {
            "node": "Replace Image in Docx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace Image in Docx": {
      "main": [
        [
          {
            "node": "Make file shareable publically (optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find & Copy Docx Template": {
      "main": [
        [
          {
            "node": "Find Image ID in Docx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Own datasource",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Make file shareable publically (optional)": {
      "main": [
        [
          {
            "node": "Download File - Docx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}