{
  "name": "merging slides",
  "nodes": [
    {
      "parameters": {
        "notice": ""
      },
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -880,
        112
      ],
      "id": "21ed4b9f-05bb-48f8-98a1-cd3383865fb3",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "fileFolder",
        "operation": "search",
        "searchMethod": "name",
        "queryString": "",
        "returnAll": true,
        "filter": {
          "driveId": {
            "mode": "list",
            "value": "My Drive"
          },
          "folderId": {
            "__rl": true,
            "value": "1oT6-FQTdatzTyNq77b9fBP_cI4WrN_oc",
            "mode": "list",
            "cachedResultName": "merge_testing_folder",
            "cachedResultUrl": "https://drive.google.com/drive/folders/1oT6-FQTdatzTyNq77b9fBP_cI4WrN_oc"
          }
        },
        "options": {
          "fields": [
            "*"
          ]
        }
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -464,
        112
      ],
      "id": "77934dd8-f0d3-4e53-af8b-0be7b3fc423a",
      "name": "Search files and folders4",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "T9wsSrB4sqpKAVmV",
          "name": "Google Drive account 2"
        }
      }
    },
    {
      "parameters": {
        "curlImport": "",
        "method": "POST",
        "url": "=https://script.google.com/macros/s/AKfycbyB2nfG_vn11vljQGu8h4YaI0_BYTulB_ef5jyjJJ4hSd8FSl1j-oxBG0CWTOm9pq86/exec",
        "authentication": "none",
        "provideSslCertificates": false,
        "sendQuery": false,
        "sendHeaders": false,
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={\n  \"destId\": \"{{ $('Copy file').item.json.id }}\",\n  \"sourceId\": \"{{ $('Loop Over Items4').item.json.id }}\"\n}",
        "options": {},
        "infoMessage": ""
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        704,
        128
      ],
      "id": "fc3a2407-2cce-4806-96e1-45181ac415df",
      "name": "HTTP Request8"
    },
    {
      "parameters": {
        "type": "simple",
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "createdTime",
              "order": "ascending"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.sort",
      "typeVersion": 1,
      "position": [
        -272,
        112
      ],
      "id": "5d4a3f33-e1d9-42ee-b378-9045188e662b",
      "name": "Sort4"
    },
    {
      "parameters": {
        "splitInBatchesNotice": "",
        "batchSize": 1,
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -96,
        112
      ],
      "id": "9d0b1530-334d-43e3-84ae-2e63842a597e",
      "name": "Loop Over Items4"
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "presentation",
        "operation": "replaceText",
        "presentationId": "={{ $('Copy file').item.json.id }}",
        "textUi": {
          "textValues": [
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{ItemNo}}",
              "replaceText": "={{ $json['SWP ITEM NO.'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{feature1}}",
              "replaceText": "={{ $json['FEATURE 1'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{feature2}}",
              "replaceText": "={{ $json['FEATURE 2'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{feature3}}",
              "replaceText": "={{ $json['FEATURE 3'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{feature 4}}",
              "replaceText": "={{ $json['FEATURE 4'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{feature 5}}",
              "replaceText": "={{ $json['FEATURE 5'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{Packaging}}",
              "replaceText": "={{ $json['PRODUCT DESCRIPTION'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{CaP}}",
              "replaceText": "={{ String($json['CASE PACK']) }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{Casw}}",
              "replaceText": "case weight"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{PackagedUnitDimensions}}",
              "replaceText": "={{ $json['DROPSHIP PACKAGING DIMS'] }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{UnitWe}}",
              "replaceText": "={{ String($json['DROPSHIP PACKAGING WEIGHT (LBS.)']) }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{PalletTixHi}}",
              "replaceText": "={{ String($json.PALLET) }}"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{UPC}}",
              "replaceText": "UPC you provide"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{Casedimensions}}",
              "replaceText": "cas dimension you provide"
            },
            {
              "matchCase": true,
              "pageObjectIds": "=",
              "text": "{{CaseCu}}",
              "replaceText": "case cube you provide"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSlides",
      "typeVersion": 2,
      "position": [
        528,
        128
      ],
      "id": "4c541831-7aab-4eb0-9c48-fe9065b7e852",
      "name": "Replace text in a presentation3",
      "credentials": {
        "googleSlidesOAuth2Api": {
          "id": "KfI6VaLHcQAaAkJ0",
          "name": "merge_slides"
        }
      }
    },
    {
      "parameters": {
        "curlImport": "",
        "method": "POST",
        "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/copy",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "provideSslCertificates": false,
        "sendQuery": true,
        "specifyQuery": "keypair",
        "queryParameters": {
          "parameters": [
            {
              "name": "supportsAllDrives",
              "value": "true"
            }
          ]
        },
        "sendHeaders": false,
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={\n  \"name\": \"1234e\",\n  \"parents\": [\"12mHFohJtSkC0APnCwLLDyZnOB73HkJrD\"]\n}",
        "options": {},
        "infoMessage": ""
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        144,
        128
      ],
      "id": "628c5961-8226-4c8d-839b-955b511b91d8",
      "name": "HTTP Request9",
      "retryOnFail": true,
      "maxTries": null,
      "waitBetweenTries": 2000,
      "credentials": {
        "googleSlidesOAuth2Api": {
          "id": "a8RzVCW6BYKvMihY",
          "name": "Growwstacks"
        },
        "googleDriveOAuth2Api": {
          "id": "T9wsSrB4sqpKAVmV",
          "name": "Google Drive account 2"
        }
      }
    },
    {
      "parameters": {
        "authentication": "airtableTokenApi",
        "resource": "record",
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "appGX0JXvhZbFrKqG",
          "mode": "list",
          "cachedResultName": "Landed Cost",
          "cachedResultUrl": "https://airtable.com/appGX0JXvhZbFrKqG"
        },
        "table": {
          "__rl": true,
          "value": "tbl1AKIWSxjiWSxuM",
          "mode": "list",
          "cachedResultName": "Product Import Details",
          "cachedResultUrl": "https://airtable.com/appGX0JXvhZbFrKqG/tbl1AKIWSxjiWSxuM"
        },
        "filterByFormula": "={SWP ITEM NO.} = '{{ $('Loop Over Items4').item.json.name.split(\".\")[0].split(\" \")[0]}}'",
        "returnAll": false,
        "limit": 1,
        "options": {},
        "sort": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        336,
        128
      ],
      "id": "af55be9d-67c1-4f3c-9804-44d0442e8932",
      "name": "Search records2",
      "alwaysOutputData": true,
      "credentials": {
        "airtableTokenApi": {
          "id": "xcbwRRDLLJIdbD4y",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "file",
        "operation": "copy",
        "fileId": {
          "__rl": true,
          "value": "1thx-nN9IZHcHpZXoqkkDSGk92CpKhXzmsLT9f1GFKuw",
          "mode": "id"
        },
        "name": "Final Merged Deck (4:3)",
        "sameFolder": true,
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -656,
        112
      ],
      "id": "f5781bd5-cca0-4d93-ac9e-99297507e3da",
      "name": "Copy file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "T9wsSrB4sqpKAVmV",
          "name": "Google Drive account 2"
        }
      }
    },
    {
      "parameters": {
        "curlImport": "",
        "method": "POST",
        "url": "=https://slides.googleapis.com/v1/presentations/{{ $('Copy file').item.json.id }}:batchUpdate",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "provideSslCertificates": false,
        "sendQuery": false,
        "sendHeaders": false,
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={\n  \"requests\": [\n    {\n      \"deleteObject\": {\n        \"objectId\": \"{{ $json.objectId }}\"\n      }\n    }\n  ]\n} ",
        "options": {},
        "infoMessage": ""
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        336,
        -48
      ],
      "id": "f2df17e2-9bf7-45df-8f77-14325a2e5e46",
      "name": "HTTP Request10(delete extra slide)",
      "executeOnce": true,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "T9wsSrB4sqpKAVmV",
          "name": "Google Drive account 2"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "presentation",
        "operation": "getSlides",
        "presentationId": "={{ $('Replace text in a presentation3').item.json.presentationId }}",
        "returnAll": false,
        "limit": 100
      },
      "type": "n8n-nodes-base.googleSlides",
      "typeVersion": 2,
      "position": [
        96,
        -48
      ],
      "id": "e7c77733-8c90-41ec-9f2e-a1564d553212",
      "name": "Get slides from a presentation",
      "credentials": {
        "googleSlidesOAuth2Api": {
          "id": "KfI6VaLHcQAaAkJ0",
          "name": "merge_slides"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Copy file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders4": {
      "main": [
        [
          {
            "node": "Sort4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request8": {
      "main": [
        [
          {
            "node": "Loop Over Items4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort4": {
      "main": [
        [
          {
            "node": "Loop Over Items4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items4": {
      "main": [
        [
          {
            "node": "Get slides from a presentation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace text in a presentation3": {
      "main": [
        [
          {
            "node": "HTTP Request8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request9": {
      "main": [
        [
          {
            "node": "Search records2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records2": {
      "main": [
        [
          {
            "node": "Replace text in a presentation3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Copy file": {
      "main": [
        [
          {
            "node": "Search files and folders4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get slides from a presentation": {
      "main": [
        [
          {
            "node": "HTTP Request10(delete extra slide)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {
    "When clicking \u2018Execute workflow\u2019": [
      {
        "json": {}
      }
    ]
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "staticData": null,
  "meta": {},
  "tags": [],
  "versionId": "f5917a96-0a0a-47cd-b507-ca27ce0c7ab1"
}