Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "name": "v4 Test - 4 workflows EK main (copie 16 Avril) -R",
- "nodes": [
- {
- "parameters": {
- "content": "## Generate PDF in folder",
- "width": 268.039543103924
- },
- "id": "cf149094-59e5-4912-90e2-e9242d2151cd",
- "name": "Sticky Note6",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1260,
- -4200
- ]
- },
- {
- "parameters": {
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.body.presentationId }}/export?mimeType=application/pdf",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "b5401657-1aeb-49f7-91ac-17018b27e983",
- "name": "Drive API Export PDF1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -700,
- -4100
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "name": "=Devis Hit Film pour {{ $('Webhook : Generate PDF1').item.json.body.companyName }}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "4a08ac07-9f7f-4083-8485-93ef94521ea6",
- "name": "Save PDF in Drive1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -520,
- -4100
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "f4c6f11a-d5a6-4fd1-aee1-b4565552d1b4",
- "name": "Change permission access PDF1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -220,
- -4340
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "958a7850-4e5e-47b0-aa25-f0cf9cad2a82",
- "name": "Réponse au Webhook PDF1",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -220,
- -3980
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-pdf-folder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "e5540116-8bdc-4574-9e24-7d1291cb0077",
- "name": "Webhook : Generate PDF1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -940,
- -4180
- ],
- "webhookId": "966de1a5-971b-40ef-89a8-a448e5e24c87"
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.pdfId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "9b222aae-c9f8-4040-8ff0-7d7c166ae373",
- "name": "Google Drive5",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 220,
- -4160
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.body.folderId,\n pdfId: items[1].json.id,\n pdfUrl: items[1].json.webContentLink,\n }\n }\n];"
- },
- "id": "95ea73d9-7801-4b5a-97be-d8a92db582c5",
- "name": "FolderId4",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 0,
- -4160
- ]
- },
- {
- "parameters": {},
- "id": "23c42eb3-1ee8-427d-9122-5ae32e1d08bf",
- "name": "Merge15",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -220,
- -4160
- ]
- },
- {
- "parameters": {
- "content": "## Generate text-assistant avec specialite\n",
- "width": 276.28646754625464
- },
- "id": "8474e987-e886-47d2-b174-795010e2aac0",
- "name": "Sticky Note2",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1240,
- -2440
- ]
- },
- {
- "parameters": {
- "assistantId": "asst_i2QUuO0EVMPzGApRaLSGNkB5",
- "text": "= {{ $json.body.promptText }}",
- "options": {}
- },
- "id": "86c76dc8-5dea-47e9-89f2-0f12dba427ea",
- "name": "OpenAI Assistant1",
- "type": "@n8n/n8n-nodes-langchain.openAiAssistant",
- "typeVersion": 1,
- "position": [
- -700,
- -2420
- ],
- "credentials": {
- "openAiApi": {
- "id": "EO2RhIFsAhnbcENg",
- "name": "OpenAi account 2"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-text-assistant",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "7cf3504d-628e-4ae5-b654-2c3c6fa34b49",
- "name": "Webhook : générer texte1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -920,
- -2420
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "45922dea-46f3-414a-b100-5229437bb09c",
- "name": "Réponse au Webhook TEXTE1",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -320,
- -2420
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-merge-pdfs-folder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "fce1e77b-5bfa-491c-9b08-3e8a3dd91fc2",
- "name": "Webhook : Merge PDFs",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -940,
- -3600
- ],
- "webhookId": "966de1a5-971b-40ef-89a8-a448e5e24c87"
- },
- {
- "parameters": {
- "content": "## Merge PDFs in folder",
- "width": 267.520986963149
- },
- "id": "6ba51974-4a77-4ce2-9241-40a77601f239",
- "name": "Sticky Note15",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1260,
- -3620
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=file",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "a2384767-cc2d-4ed9-b57d-f5ffa812e1fa",
- "name": "Google Drive Upload chosen PDF2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -700,
- -3520
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "5bb6af32-8982-4aab-be77-14150195addf",
- "name": "Réponse au Webhook upload PDF2",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -420,
- -3400
- ]
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "17e9549c-b425-4b27-80dd-bba9dd710bbe",
- "name": "Change permission access pdf1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -420,
- -3760
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.pdfId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "ac9e1cc4-31d9-4b6c-87dd-a2dfd72936c7",
- "name": "Google Drive6",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 20,
- -3580
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.body.folderId,\n pdfId: items[1].json.id,\n pdfUrl: items[1].json.webContentLink,\n }\n }\n];"
- },
- "id": "2a395c49-f190-4e9b-94be-8e7dbefe618f",
- "name": "FolderId5",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -200,
- -3580
- ]
- },
- {
- "parameters": {},
- "id": "2c553847-b78b-45a5-9b48-b3aca1a85c5a",
- "name": "Merge16",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -420,
- -3580
- ]
- },
- {
- "parameters": {
- "content": "## Upload Devis to Google Drive in folder",
- "height": 168.1377342479297,
- "width": 264.3913647049092
- },
- "id": "013ecf63-bd1f-450e-9445-19127bbc1508",
- "name": "Sticky Note8",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1240,
- -2960
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-upload-devis-folder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "fc4920f8-fb08-4a19-9c70-73c5f62edcab",
- "name": "Webhook: Upload chosen PDF1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -940,
- -2940
- ],
- "webhookId": "ea78f9eb-ae04-43a1-9c7f-eb04726fd699"
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "d53ba04c-4990-4a99-8c2f-02dd707c50d9",
- "name": "Réponse au Webhook upload PDF3",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -420,
- -2740
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=file",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "5fef5738-537e-44c2-83fe-7d3fdb9bcb4c",
- "name": "Google Drive Upload chosen PDF3",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -680,
- -2840
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "f99a51fb-706b-480b-91d0-8f08aae818d9",
- "name": "Change permission access pdf3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -420,
- -3100
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate PDF",
- "width": 268.039543103924,
- "color": 7
- },
- "id": "fcb5a5ef-2e21-4bbd-861c-9a32d9fe28ae",
- "name": "Sticky Note5",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1120,
- 2980
- ]
- },
- {
- "parameters": {
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.body.presentationId }}/export?mimeType=application/pdf",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "7c443bfc-7438-48c7-a02f-6832b0ce53d3",
- "name": "Drive API Export PDF",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -620,
- 3000
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "name": "=Devis Hit Film pour {{ $('Webhook : Generate PDF').item.json.body.companyName }}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "0e68b562-b9d8-4888-93de-d76da4d16f7e",
- "name": "Save PDF in Drive",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -440,
- 3000
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "736bd33b-c480-4254-a1c6-f415da89ee3e",
- "name": "Change permission access PDF",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -160,
- 2920
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "64645ce4-0241-4ff7-91b8-6f0a704f4b60",
- "name": "Réponse au Webhook PDF",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -160,
- 3120
- ]
- },
- {
- "parameters": {
- "content": "## Upload Devis to Google Drive",
- "height": 168.1377342479297,
- "width": 264.3913647049092,
- "color": 7
- },
- "id": "804e3839-741d-428b-b1cc-b5bdd7bbde88",
- "name": "Sticky Note7",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1100,
- 3820
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-upload-devis",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "956a1ce8-dfa0-4f37-b915-fb8ac90ed4f1",
- "name": "Webhook: Upload chosen PDF",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -800,
- 3840
- ],
- "webhookId": "ea78f9eb-ae04-43a1-9c7f-eb04726fd699"
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "b67650df-f825-44c7-acd0-e5b9e46260ee",
- "name": "Réponse au Webhook upload PDF",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -360,
- 3940
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=file",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "b7939dfc-d475-47ac-b264-f125c32d39f0",
- "name": "Google Drive Upload chosen PDF",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -600,
- 3840
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "cd5b8efc-b7dd-499d-b3df-fd06333f6c1d",
- "name": "Change permission access pdf2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -360,
- 3740
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "71760a3e-f1cc-4e97-9d4f-38468299f96a",
- "name": "Google Drive Upload image1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -280,
- 2440
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate slides\n\n",
- "color": 7
- },
- "id": "fe408011-3b76-4a1e-8afb-1b01c5373b29",
- "name": "Sticky Note13",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1100,
- 1980
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "5130e84b-47db-4b89-8cf3-a0b6eaeeb00a",
- "name": "Webhook : générer slides",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -800,
- 2000
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "content": "## Generate text\n",
- "color": 7
- },
- "id": "21f182d9-ca38-4b94-bdbc-627a7bb90d4d",
- "name": "Sticky Note",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1100,
- 4240
- ]
- },
- {
- "parameters": {
- "assistantId": "asst_i2QUuO0EVMPzGApRaLSGNkB5",
- "text": "= {{ $json.body.promptText }}",
- "nativeTools": [
- "retrieval"
- ],
- "options": {}
- },
- "id": "dd3828fa-3edb-407f-adb3-146f2e57c14f",
- "name": "OpenAI Assistant",
- "type": "@n8n/n8n-nodes-langchain.openAiAssistant",
- "typeVersion": 1,
- "position": [
- -560,
- 4260
- ],
- "credentials": {
- "openAiApi": {
- "id": "EO2RhIFsAhnbcENg",
- "name": "OpenAi account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate image\n"
- },
- "id": "4c8bc662-e28f-49b8-939b-a2b358b610b2",
- "name": "Sticky Note1",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1200,
- -1920
- ]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "https://api.openai.com/v1/images/generations",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "openAiApi",
- "sendBody": true,
- "bodyParameters": {
- "parameters": [
- {
- "name": "prompt",
- "value": "={{ $json.body.textImage }}"
- },
- {
- "name": "model",
- "value": "dall-e-3"
- },
- {
- "name": "size",
- "value": "1792x1024"
- }
- ]
- },
- "options": {}
- },
- "id": "f4306147-3b90-4a07-9793-621a1fb4f359",
- "name": "Generate image (DE-3, 1792x1024)",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -620,
- -1900
- ],
- "credentials": {
- "openAiApi": {
- "id": "tx6ly9gMjT46qPeU",
- "name": "OpenAi account 3"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "f533513f-437d-42fb-b67d-7dc5d6c25b3b",
- "name": "Google Drive Upload image2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -280,
- 2640
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "d01147db-49c4-4579-aed4-d28063985bca",
- "name": "Change permission access",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 540,
- 2200
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "7fce5ff5-75f8-4b56-ae4d-622d48aaff53",
- "name": "Merge1",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -20,
- 2540
- ]
- },
- {
- "parameters": {},
- "id": "03f9aae2-d218-4e50-83db-baea7bb3791f",
- "name": "Merge2",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 220,
- 2280
- ]
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ"
- },
- "id": "987802ed-81af-4c2e-b32e-9ba7995806ab",
- "name": "Get Templace Source1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -520,
- 2080
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "copy",
- "fileId": {
- "__rl": true,
- "value": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ",
- "mode": "id"
- },
- "name": "=\"Pitch\" + {{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}-{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}:{{(\"0\" + new Date().getSeconds()).slice(-2)}}",
- "sameFolder": false,
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "f5e0ba66-f96a-491a-8f7a-539e72189b1d",
- "name": "Copy temp src and generate unique name file1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -280,
- 2080
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "={{ $json.id }}"
- },
- "id": "5fced670-a4b4-4bf2-8cd6-4a40bf789dc7",
- "name": "Getting the copied Slide1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -20,
- 2080
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "a9f10523-6be4-4b2d-895a-00001230aa38",
- "name": "Merge5",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 540,
- 2020
- ]
- },
- {
- "parameters": {
- "jsCode": "\n\n\n// Le alt text du triangle qu'on cherche\nconst targetDescription = \"bordure\";\n\n// Correcting the path to access borderColor \nif (!items[0].json.body || !items[0].json.body.selectedColor) {\n throw new Error(\"borderColor is undefined or not passed correctly.\");\n}\n\n// Adjusting to the correct path\nconst inputColor = items[0].json.body.selectedColor;\n\n// Assuming `items[0].json.slides` is the array of slides you received from the Slides API.\nconst slides = items[1].json.slides;\n\n// Placeholder for the found shapes\nlet foundShapes = [];\n\n// Loop over each slide\nfor (const slide of slides) {\n // Check if slide has pageElements and it's an array\n if (Array.isArray(slide.pageElements)) {\n // Find all shapes with the description 'triangle1' within the current slide\n const matchingShapes = slide.pageElements.filter(\n (element) => element.description === targetDescription\n );\n foundShapes = foundShapes.concat(matchingShapes);\n }\n}\n\n// Check if we found any shapes\nif (foundShapes.length > 0) {\n // Apply the new color to all found shapes.\n foundShapes.forEach(foundShape => {\n foundShape.shape.shapeProperties.shapeBackgroundFill.solidFill.color.rgbColor = {\n red: inputColor.red, // Ensure this is a value between 0 and 1\n green: inputColor.green, // Ensure this is a value between 0 and 1\n blue: inputColor.blue, // Ensure this is a value between 0 and 1\n alpha: inputColor.alpha || 1, // Default to 1 if alpha is not provided\n };\n });\n\n // Return the modified shapes and the presentationId\n return foundShapes.map(foundShape => ({\n json: {\n foundShape: foundShape,\n presentationId: items[1].json.presentationId\n }\n }));\n} else {\n // If no shapes with 'triangle1' description were found in any slide\n return [{ json: { error: \"Shape with description 'triangle1' not found\" } }];\n}\n"
- },
- "id": "77bee001-921f-4291-8735-275223d0f89a",
- "name": "Code for color modification1",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 960,
- 2020
- ]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('Code for color modification1').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateShapeProperties\": {\n \"objectId\": \"{{ $json['foundShape']['objectId'] }}\",\n \"fields\": \"shapeBackgroundFill.solidFill.color\",\n \"shapeProperties\": {\n \"shapeBackgroundFill\": {\n \"solidFill\": {\n \"color\": {\n \"rgbColor\": {\n \"red\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['red'] }}\",\n \"green\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['green'] }}\",\n \"blue\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['blue'] }}\"\n }\n }\n }\n }\n }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "7d6a830d-ecc5-43a2-9f40-48a7ce210fbc",
- "name": "Send new color to slides1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1240,
- 2020
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "g1f1e0df403e_0_20"
- ],
- "replaceText": "={{ $json.sections.sectionContenu1 }}",
- "text": "{{sectionContenu1}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_21"
- ],
- "replaceText": "={{ $json.sections.sectionContenu2 }}",
- "text": "{{sectionContenu2}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_129"
- ],
- "replaceText": "={{ $json.sections.sectionContenu3 }}",
- "text": "{{sectionContenu3}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_148"
- ],
- "replaceText": "={{ $json.sections.sectionContenu4 }}",
- "text": "{{sectionContenu4}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_164"
- ],
- "replaceText": "={{ $json.sections.sectionContenu5 }}",
- "text": "{{sectionContenu5}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_193"
- ],
- "replaceText": "={{ $json.sections.sectionContenu6 }}",
- "text": "{{sectionContenu6}}"
- },
- {
- "pageObjectIds": [
- "g2c1a0221ae8_0_0"
- ],
- "replaceText": "={{ $json.sections.sectionContenu7 }}",
- "text": "{{sectionContenu7}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "a383a20d-0864-471d-bed9-ed1f24847c6a",
- "name": "Insert cutText1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1620,
- 1820
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image2Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-x\" }\n }\n }\n ]\n}",
- "options": {}
- },
- "id": "80512a3e-aeb0-4294-9a52-27567f8a8a35",
- "name": "Insert images 2 into placeholders ",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1620,
- 2460
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.logoId }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"Logo_client\" }\n }\n }\n ]\n} ",
- "options": {}
- },
- "id": "92cd926b-6160-4513-b353-0db1cb0d8296",
- "name": "Insert logo into PH1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1620,
- 2660
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "p"
- ],
- "replaceText": "={{ $json.companyName }}",
- "text": "{{nom_compagnie}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "c9761908-b9c1-4d86-af1c-941830a767be",
- "name": "Insert companyName1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1620,
- 2020
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "= \n",
- "text": "\\n"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "c5829be9-9036-43a2-b6f9-634dd0dc0b5d",
- "name": "remove \\n1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1880,
- 1820
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image1Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-p\" }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "cf06fa7f-793a-4e31-9872-edaca6fe3913",
- "name": "Insert images into placeholders1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1620,
- 2260
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "url": "={{ $json.body.logoData }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "93e81159-9763-4fae-be0b-45705500e33f",
- "name": "Send logo to Google Drive",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -520,
- 2260
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "3e3d54b0-1cc5-4d3b-8ec6-fbeb08c5678b",
- "name": "Google Drive Upload logo",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -280,
- 2260
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "={{ $json.sections.sectionTitre1 }}",
- "text": "{{sectionTitre1}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre2 }}",
- "text": "{{sectionTitre2}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre3 }}",
- "text": "{{sectionTitre3}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre4 }}",
- "text": "{{sectionTitre4}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre5 }}",
- "text": "{{sectionTitre5}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre6 }}",
- "text": "{{sectionTitre6}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre7 }}",
- "text": "{{sectionTitre7}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDescription }}",
- "text": "{{sectionDescription1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDescription }}",
- "text": "{{sectionDescription2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDescription }}",
- "text": "{{sectionDescription3}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDisplayName }} ",
- "text": "{{sectionLien1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDisplayName }}",
- "text": "{{sectionLien2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDisplayName }}",
- "text": "{{sectionLien3}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "95ff9dce-5e88-4b86-8198-4f482750069c",
- "name": "Insert cutTitles1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1620,
- 1620
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "8a0c2922-9097-4c1d-bfee-26b67724c69b",
- "name": "Merge3",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 960,
- 2260
- ]
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst logoId = items[2].json.id;\nconst image1Id = items[3].json.id;\nconst image2Id = items[4].json.id;\n\n\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n image1Id: image1Id,\n image2Id: image2Id,\n logoId: logoId\n};\n\nreturn { json: result };\n"
- },
- "id": "77fa26e2-7874-442c-9ab8-bcbc06eed47e",
- "name": "InsertImages",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1240,
- 2260
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[0].json.presentationId;\n\n// presentationId in one object\nconst result = {\n presentationId: presentationId\n};\n\nreturn { json: result };\n"
- },
- "id": "509ba496-b505-4083-bfd2-58889f24cc48",
- "name": "InsertImages2",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1900,
- 2660
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "6759c749-ce2a-44f2-82c5-32dd69b2b7fa",
- "name": "Réponse au Webhook TEXT2",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- 2160,
- 2660
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-text",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "cc34d56f-3562-49e5-8e31-31e99853c4d9",
- "name": "Webhook : générer texte",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -780,
- 4260
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-image",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "75ccabed-f4b5-4427-875f-c4c79d3a0464",
- "name": "Webhook : générer image",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -900,
- -1900
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "7b1a10b5-e763-455f-a783-8cde23efb030",
- "name": "Réponse au Webhook TEXTE",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -180,
- 4260
- ]
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "c5a46fb4-2350-4bfa-a3c8-175e667976d8",
- "name": "Réponse au Webhook IMAGE",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- 140,
- -1880
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[0] }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "5ad4fa3d-6bb9-4947-80f9-049d46e0ccad",
- "name": "Send image 1 to Google Drive",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -520,
- 2440
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[1] }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "35af9944-39d4-41c0-8953-770e8d34a934",
- "name": "Send image 2 to Google Drive",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -520,
- 2640
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-merge-pdfs",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "e64e2b4e-d390-4c08-8deb-867293861663",
- "name": "Webhook : Merge PDFs1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -800,
- 3420
- ],
- "webhookId": "966de1a5-971b-40ef-89a8-a448e5e24c87"
- },
- {
- "parameters": {
- "content": "## Merge PDFs",
- "width": 267.520986963149,
- "color": 7
- },
- "id": "9852a71d-1929-452d-8aca-85f63cb94e86",
- "name": "Sticky Note12",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1120,
- 3400
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=file",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "4faad8c7-1773-4152-a3f2-84e0aa4f2c78",
- "name": "Google Drive Upload chosen PDF1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -600,
- 3420
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "b4db2adb-01fd-4077-81bd-34e3311ba914",
- "name": "Réponse au Webhook upload PDF1",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -360,
- 3520
- ]
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "142bc62e-2e0e-4dd8-9fe1-3639179cdb01",
- "name": "Change permission access pdf",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -360,
- 3320
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-pdf",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "2b302e0f-1d06-4c92-85b6-5f416fea2646",
- "name": "Webhook : Generate PDF",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -800,
- 3000
- ],
- "webhookId": "966de1a5-971b-40ef-89a8-a448e5e24c87"
- },
- {
- "parameters": {
- "method": "POST",
- "url": "https://api.openai.com/v1/images/generations",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "openAiApi",
- "sendBody": true,
- "bodyParameters": {
- "parameters": [
- {
- "name": "prompt",
- "value": "={{ $json.body.textImage }}"
- },
- {
- "name": "model",
- "value": "dall-e-3"
- },
- {
- "name": "size",
- "value": "1792x1024"
- }
- ]
- },
- "options": {}
- },
- "id": "386097b1-e918-479a-8834-4f62501f62f8",
- "name": "Generate image (DE-3, 1792x1024)1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -620,
- -2080
- ],
- "credentials": {
- "openAiApi": {
- "id": "tx6ly9gMjT46qPeU",
- "name": "OpenAi account 3"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "https://api.openai.com/v1/images/generations",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "openAiApi",
- "sendBody": true,
- "bodyParameters": {
- "parameters": [
- {
- "name": "prompt",
- "value": "={{ $json.body.textImage }}"
- },
- {
- "name": "model",
- "value": "dall-e-3"
- },
- {
- "name": "size",
- "value": "1792x1024"
- }
- ]
- },
- "options": {}
- },
- "id": "283ac20f-1233-453f-bf58-8f369cbc104b",
- "name": "Generate image (DE-3, 1792x1024)2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -620,
- -1720
- ],
- "credentials": {
- "openAiApi": {
- "id": "tx6ly9gMjT46qPeU",
- "name": "OpenAi account 3"
- }
- }
- },
- {
- "parameters": {},
- "id": "7b00ee1d-616c-4d65-a00b-7f1737853621",
- "name": "Merge",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -360,
- -2000
- ]
- },
- {
- "parameters": {},
- "id": "5e91a855-93b4-47c5-b334-04736a4199d7",
- "name": "Merge4",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -100,
- -1880
- ]
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst imageUrls = items[0].json.body.imageUrls;\nconst logoData = items[0].json.body.logoData;\nconst companyName = items[0].json.body.companyName;\nconst urlGenerative = items[0].json.body.urlGenerative;\nconst firstLinkDescription = items[0].json.body.firstLink.description;\nconst firstLinkUrl = items[0].json.body.firstLink.url;\nconst firstLinkDisplayName = items[0].json.body.firstLink.displayName;\nconst secondLinkDescription = items[0].json.body.secondLink.description;\nconst secondLinkUrl = items[0].json.body.secondLink.url;\nconst secondLinkDisplayName = items[0].json.body.secondLink.displayName;\nconst thirdLinkDescription = items[0].json.body.thirdLink.description;\nconst thirdLinkUrl = items[0].json.body.thirdLink.url;\nconst thirdLinkDisplayName = items[0].json.body.thirdLink.displayName;\nconst red = items[0].json.body.selectedColor.red;\nconst green = items[0].json.body.selectedColor.green;\nconst blue = items[0].json.body.selectedColor.blue;\n\nconst text = items[0].json.body.output; // Make sure this is where your text is located\nconst sections = {};\nconst regex = /<h1 className=\"h1title\">(.*?)<\\/h1>\\s*<[^>]+>(.*?)<\\/[^>]+>/gis;\nconst removalRegex = /【\\d†source】/g; // Expression to remove undesired strings\n\nlet match;\nlet contentCounter = 1; // Counter for contents\nlet titleCounter = 1; // Counter for titles\n\nwhile ((match = regex.exec(text)) !== null) {\n let title = match[1].trim().replace(removalRegex, '');\n let content = match[2].trim().replace(removalRegex, '');\n \n const titlePlaceholder = `sectionTitre${titleCounter}`; // Placeholder for the title\n const contentPlaceholder = `sectionContenu${contentCounter}`; // Placeholder for the content\n sections[titlePlaceholder] = title.toUpperCase();\n sections[contentPlaceholder] = content;\n \n titleCounter++;\n contentCounter++;\n}\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n sections: sections,\n imageUrls: imageUrls,\n logoData: logoData,\n urlGenerative: urlGenerative,\n companyName: companyName,\n firstLinkDescription: firstLinkDescription,\n firstLinkUrl: firstLinkUrl,\n firstLinkDisplayName: firstLinkDisplayName,\n secondLinkDescription: secondLinkDescription,\n secondLinkUrl: secondLinkUrl,\n secondLinkDisplayName: secondLinkDisplayName,\n thirdLinkDescription: thirdLinkDescription,\n thirdLinkUrl: thirdLinkUrl,\n thirdLinkDisplayName: thirdLinkDisplayName,\n red: red,\n green: green,\n blue: blue\n};\n\nreturn { json: result };"
- },
- "id": "9587ea15-b809-428c-9911-20fbaa1ffef6",
- "name": "OutputTextCut",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 960,
- 1720
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('OutputTextCut').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Content-Type",
- "value": "application/json"
- }
- ]
- },
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c0a7f6a914_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_6\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_0\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_32\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_2\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_138\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_1\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_159\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_3\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_174\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_204\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_6\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c1a0221ae8_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_7\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_16\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4e164aa46_0_10\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_10\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 24,\n \"endIndex\": 41\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.firstLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 66,\n \"endIndex\": 83\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.secondLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 108,\n \"endIndex\": 125\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.thirdLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "09cd3a41-030b-4b58-ac4a-e37452c56933",
- "name": "Send urlGenerative",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1620,
- 1440
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "getSlides",
- "presentationId": "={{ $json.id }}"
- },
- "id": "50ed6304-f824-4fea-a3fd-3aaabe27987e",
- "name": "Google Slides",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -20,
- 1900
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.pdfId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "39d6a948-f2b8-439c-83fe-aa4ab399734b",
- "name": "Google Drive7",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 20,
- -2920
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.body.folderId,\n pdfId: items[1].json.id,\n pdfUrl: items[1].json.webContentLink,\n }\n }\n];"
- },
- "id": "c9e78336-2286-474d-89f0-cac822cd5019",
- "name": "FolderId6",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -200,
- -2920
- ]
- },
- {
- "parameters": {},
- "id": "0bb563a2-6c44-4760-81e5-9b63c7fadb7b",
- "name": "Merge17",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- -420,
- -2920
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "ab245fef-ef3e-48b1-a4bf-10bc8f826595",
- "name": "Google Drive Upload image4",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -6640
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate slides in sub folders in parent folder (Si vous en avez de besoin)\n\n",
- "color": 5
- },
- "id": "2a6b963e-8490-4cc9-b18c-7aae525f4e75",
- "name": "Sticky Note16",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1220,
- -7100
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "5e778d61-e98d-4184-b862-59c2e37f70b4",
- "name": "Google Drive Upload image5",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -6440
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "7bae8337-58ba-4dfc-b259-af82e5722eda",
- "name": "Change permission access2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1680,
- -6900
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "c573bd10-d3f8-475b-a943-1e20d76ff29c",
- "name": "Merge18",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1240,
- -6620
- ]
- },
- {
- "parameters": {},
- "id": "c5303975-7669-4b0d-a7db-376504d87b77",
- "name": "Merge19",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1420,
- -6800
- ]
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ"
- },
- "id": "2fa1c4a1-3921-456d-981e-e1d77880529a",
- "name": "Get Templace Source2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -640,
- -7000
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "copy",
- "fileId": {
- "__rl": true,
- "value": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ",
- "mode": "id"
- },
- "name": "=\"Pitch\" + {{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}-{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}:{{(\"0\" + new Date().getSeconds()).slice(-2)}}",
- "sameFolder": false,
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.id }}",
- "mode": "id"
- },
- "options": {}
- },
- "id": "b8e22415-55ce-4662-8f0e-a0df3a223b79",
- "name": "Copy temp src and generate unique name file2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -7000
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "={{ $json.id }}"
- },
- "id": "0388d0b2-72bf-4046-a232-5aa33927a6da",
- "name": "Getting the copied Slide2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1420,
- -7000
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "aad2049b-0ead-42f7-a5b1-a03d7c47aa22",
- "name": "Merge20",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1680,
- -7060
- ]
- },
- {
- "parameters": {
- "jsCode": "\n\n\n// Le alt text du triangle qu'on cherche\nconst targetDescription = \"bordure\";\n\n// Correcting the path to access borderColor \nif (!items[0].json.body || !items[0].json.body.selectedColor) {\n throw new Error(\"borderColor is undefined or not passed correctly.\");\n}\n\n// Adjusting to the correct path\nconst inputColor = items[0].json.body.selectedColor;\n\n// Assuming `items[0].json.slides` is the array of slides you received from the Slides API.\nconst slides = items[1].json.slides;\n\n// Placeholder for the found shapes\nlet foundShapes = [];\n\n// Loop over each slide\nfor (const slide of slides) {\n // Check if slide has pageElements and it's an array\n if (Array.isArray(slide.pageElements)) {\n // Find all shapes with the description 'triangle1' within the current slide\n const matchingShapes = slide.pageElements.filter(\n (element) => element.description === targetDescription\n );\n foundShapes = foundShapes.concat(matchingShapes);\n }\n}\n\n// Check if we found any shapes\nif (foundShapes.length > 0) {\n // Apply the new color to all found shapes.\n foundShapes.forEach(foundShape => {\n foundShape.shape.shapeProperties.shapeBackgroundFill.solidFill.color.rgbColor = {\n red: inputColor.red, // Ensure this is a value between 0 and 1\n green: inputColor.green, // Ensure this is a value between 0 and 1\n blue: inputColor.blue, // Ensure this is a value between 0 and 1\n alpha: inputColor.alpha || 1, // Default to 1 if alpha is not provided\n };\n });\n\n // Return the modified shapes and the presentationId\n return foundShapes.map(foundShape => ({\n json: {\n foundShape: foundShape,\n presentationId: items[1].json.presentationId\n }\n }));\n} else {\n // If no shapes with 'triangle1' description were found in any slide\n return [{ json: { error: \"Shape with description 'triangle1' not found\" } }];\n}\n"
- },
- "id": "2f9d6c29-b8df-482b-9e80-a652035399a8",
- "name": "Code for color modification2",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1940,
- -7060
- ]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('Code for color modification2').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateShapeProperties\": {\n \"objectId\": \"{{ $json['foundShape']['objectId'] }}\",\n \"fields\": \"shapeBackgroundFill.solidFill.color\",\n \"shapeProperties\": {\n \"shapeBackgroundFill\": {\n \"solidFill\": {\n \"color\": {\n \"rgbColor\": {\n \"red\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['red'] }}\",\n \"green\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['green'] }}\",\n \"blue\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['blue'] }}\"\n }\n }\n }\n }\n }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "698e82f2-0ddb-4579-b3c5-41d7ced4a3e3",
- "name": "Send new color to slides2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2220,
- -7060
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "g1f1e0df403e_0_20"
- ],
- "replaceText": "={{ $json.sections.sectionContenu1 }}",
- "text": "{{sectionContenu1}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_21"
- ],
- "replaceText": "={{ $json.sections.sectionContenu2 }}",
- "text": "{{sectionContenu2}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_129"
- ],
- "replaceText": "={{ $json.sections.sectionContenu3 }}",
- "text": "{{sectionContenu3}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_148"
- ],
- "replaceText": "={{ $json.sections.sectionContenu4 }}",
- "text": "{{sectionContenu4}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_164"
- ],
- "replaceText": "={{ $json.sections.sectionContenu5 }}",
- "text": "{{sectionContenu5}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_193"
- ],
- "replaceText": "={{ $json.sections.sectionContenu6 }}",
- "text": "{{sectionContenu6}}"
- },
- {
- "pageObjectIds": [
- "g2c1a0221ae8_0_0"
- ],
- "replaceText": "={{ $json.sections.sectionContenu7 }}",
- "text": "{{sectionContenu7}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "45b57613-4701-4c27-977c-43cb9c699dd1",
- "name": "Insert cutText2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2600,
- -7260
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image2Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-x\" }\n }\n }\n ]\n}",
- "options": {}
- },
- "id": "ae8dea26-cbe9-48ca-a492-181d10fc2a9d",
- "name": "Insert images 2 into placeholders 2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2600,
- -6620
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.logoId }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"Logo_client\" }\n }\n }\n ]\n} ",
- "options": {}
- },
- "id": "92018233-075c-418f-b489-8f4c9beb74af",
- "name": "Insert logo into PH2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2600,
- -6420
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "p"
- ],
- "replaceText": "={{ $json.companyName }}",
- "text": "{{nom_compagnie}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "b0cd3fb3-956e-4309-84e9-92eeaf1d3f80",
- "name": "Insert companyName2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2600,
- -7060
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "= \n",
- "text": "\\n"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "d7a3350f-7d2e-4c9f-9b27-75f30fc009e0",
- "name": "remove \\n2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2860,
- -7260
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image1Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-p\" }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "bd65f526-6d8d-4a20-9069-267d3b90d37a",
- "name": "Insert images into placeholders2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2600,
- -6820
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "url": "={{ $json.body.logoData }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "979f62dc-7e90-4ec8-b9eb-ce3dd6a8ef5c",
- "name": "Send logo to Google Drive2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -640,
- -6820
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "ea6ea03e-4572-4ed3-af19-96c53f705ce8",
- "name": "Google Drive Upload logo2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -6820
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "={{ $json.sections.sectionTitre1 }}",
- "text": "{{sectionTitre1}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre2 }}",
- "text": "{{sectionTitre2}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre3 }}",
- "text": "{{sectionTitre3}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre4 }}",
- "text": "{{sectionTitre4}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre5 }}",
- "text": "{{sectionTitre5}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre6 }}",
- "text": "{{sectionTitre6}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre7 }}",
- "text": "{{sectionTitre7}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDescription }}",
- "text": "{{sectionDescription1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDescription }}",
- "text": "{{sectionDescription2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDescription }}",
- "text": "{{sectionDescription3}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDisplayName }} ",
- "text": "{{sectionLien1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDisplayName }}",
- "text": "{{sectionLien2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDisplayName }}",
- "text": "{{sectionLien3}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "148f5eeb-0a26-44d0-a52d-b0e23bfa40ea",
- "name": "Insert cutTitles2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2600,
- -7460
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "39559b32-b93c-4e79-8200-49f66a19a7f2",
- "name": "Merge21",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1940,
- -6820
- ]
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst logoId = items[2].json.id;\nconst image1Id = items[3].json.id;\nconst image2Id = items[4].json.id;\n\n\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n image1Id: image1Id,\n image2Id: image2Id,\n logoId: logoId\n};\n\nreturn { json: result };\n"
- },
- "id": "d844d335-69a9-4e1d-a15d-d64c563209ff",
- "name": "InsertImages4",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 2220,
- -6820
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "jsCode": "const presentationId = items[0].json.presentationId;\nconst folderId = items[1].json.folderId;\n\n// presentationId in one object\nconst result = {\n presentationId: presentationId,\n folderId: folderId\n};\n\nreturn { json: result };\n"
- },
- "id": "eec9584d-cfb6-457c-b3ca-d692d175c178",
- "name": "InsertImages5",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 3020,
- -6340
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "9fcdd9cf-01f4-4105-a221-a5fe75d58528",
- "name": "Réponse au Webhook TEXT1",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- 3220,
- -6340
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[0] }}",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Accept",
- "value": "image/*"
- }
- ]
- },
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "a1028bfd-78ba-4073-84aa-c77625723aae",
- "name": "Send image 1 to Google Drive2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -640,
- -6640
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[1] }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "82607f5e-8ff7-45e4-8a2b-fbea1f634466",
- "name": "Send image 2 to Google Drive2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -640,
- -6440
- ]
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst imageUrls = items[0].json.body.imageUrls;\nconst logoData = items[0].json.body.logoData;\nconst companyName = items[0].json.body.companyName;\nconst urlGenerative = items[0].json.body.urlGenerative;\nconst firstLinkDescription = items[0].json.body.firstLink.description;\nconst firstLinkUrl = items[0].json.body.firstLink.url;\nconst firstLinkDisplayName = items[0].json.body.firstLink.displayName;\nconst secondLinkDescription = items[0].json.body.secondLink.description;\nconst secondLinkUrl = items[0].json.body.secondLink.url;\nconst secondLinkDisplayName = items[0].json.body.secondLink.displayName;\nconst thirdLinkDescription = items[0].json.body.thirdLink.description;\nconst thirdLinkUrl = items[0].json.body.thirdLink.url;\nconst thirdLinkDisplayName = items[0].json.body.thirdLink.displayName;\nconst red = items[0].json.body.selectedColor.red;\nconst green = items[0].json.body.selectedColor.green;\nconst blue = items[0].json.body.selectedColor.blue;\n\nconst text = items[0].json.body.output; // Make sure this is where your text is located\nconst sections = {};\nconst regex = /<h1 className=\"h1title\">(.*?)<\\/h1>\\s*<[^>]+>(.*?)<\\/[^>]+>/gis;\nconst removalRegex = /【\\d†source】/g; // Expression to remove undesired strings\n\nlet match;\nlet contentCounter = 1; // Counter for contents\nlet titleCounter = 1; // Counter for titles\n\nwhile ((match = regex.exec(text)) !== null) {\n let title = match[1].trim().replace(removalRegex, '');\n let content = match[2].trim().replace(removalRegex, '');\n \n const titlePlaceholder = `sectionTitre${titleCounter}`; // Placeholder for the title\n const contentPlaceholder = `sectionContenu${contentCounter}`; // Placeholder for the content\n sections[titlePlaceholder] = title.toUpperCase();\n sections[contentPlaceholder] = content;\n \n titleCounter++;\n contentCounter++;\n}\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n sections: sections,\n imageUrls: imageUrls,\n logoData: logoData,\n urlGenerative: urlGenerative,\n companyName: companyName,\n firstLinkDescription: firstLinkDescription,\n firstLinkUrl: firstLinkUrl,\n firstLinkDisplayName: firstLinkDisplayName,\n secondLinkDescription: secondLinkDescription,\n secondLinkUrl: secondLinkUrl,\n secondLinkDisplayName: secondLinkDisplayName,\n thirdLinkDescription: thirdLinkDescription,\n thirdLinkUrl: thirdLinkUrl,\n thirdLinkDisplayName: thirdLinkDisplayName,\n red: red,\n green: green,\n blue: blue\n};\n\nreturn { json: result };"
- },
- "id": "b438bd22-72f3-4371-9d79-105e91a634ae",
- "name": "OutputTextCut2",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1940,
- -7360
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('OutputTextCut2').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Content-Type",
- "value": "application/json"
- }
- ]
- },
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c0a7f6a914_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_6\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_0\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_32\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_2\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_138\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_1\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_159\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_3\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_174\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_204\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_6\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c1a0221ae8_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_7\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_16\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4e164aa46_0_10\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_10\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 24,\n \"endIndex\": 41\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.firstLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 66,\n \"endIndex\": 83\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.secondLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 108,\n \"endIndex\": 125\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.thirdLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "e2e6619c-f9ea-48de-a9de-8a3dd8273435",
- "name": "Send urlGenerative2",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2600,
- -7640
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "getSlides",
- "presentationId": "={{ $json.id }}"
- },
- "id": "f9acf718-40e7-4e4a-b782-c1809fe6733c",
- "name": "Google Slides2",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1420,
- -7200
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "const folderName = items[0].json.body.companyName;\nconst selectedColor = items[0].json.body.selectedColor;\n\nreturn [\n {\n json: {\n folderPath: folderName,\n color: selectedColor,\n }\n }\n];"
- },
- "id": "fde5d3e6-d887-47ca-939b-9c52a01ee418",
- "name": "FolderName1",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -640,
- -7340
- ]
- },
- {
- "parameters": {
- "resource": "folder",
- "name": "={{ $json.folderPath }}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "eaa4f116-8d92-4566-a3d6-1fb937059c42",
- "name": "CreateFolder1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -7340
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "b71f2380-eef3-44be-a6d2-19198980975f",
- "name": "FolderId7",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 700,
- -7000
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "d5dedd07-420a-421d-93a7-7adf19697fde",
- "name": "Google Drive8",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 980,
- -7000
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "17a3f13e-17bc-4848-8455-537f05e84c85",
- "name": "Merge22",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 440,
- -7000
- ]
- },
- {
- "parameters": {},
- "id": "848bde7c-45d5-4626-b8b5-1c0a5597c58f",
- "name": "Merge23",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 440,
- -6820
- ]
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "4f1f059c-59c6-4766-a6df-3558af858a49",
- "name": "FolderId8",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 700,
- -6820
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "186dc2f4-f454-4e70-964f-aee453598277",
- "name": "Google Drive9",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 980,
- -6820
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "3478aa52-373a-4e25-8d66-25a251865cff",
- "name": "Merge24",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 440,
- -6640
- ]
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "501ac631-7427-4f0a-96dc-009a2e77a787",
- "name": "FolderId9",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 700,
- -6640
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "fcdeca37-19fa-46cd-8886-23c852467d54",
- "name": "Google Drive10",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 980,
- -6640
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "28c97c41-6e83-4d26-a00d-61691fd9c50c",
- "name": "Merge25",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 440,
- -6440
- ]
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "19184041-ad0e-4de1-949d-8c2cbb857bd8",
- "name": "FolderId10",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 700,
- -6440
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "f27839d7-8dd8-4eb3-b060-69ba3f175e5f",
- "name": "Google Drive11",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 980,
- -6440
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {},
- "id": "1b0cbb06-7aab-427b-ab5f-50363c25bfcf",
- "name": "Merge26",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 2800,
- -6340
- ]
- },
- {
- "parameters": {
- "jsCode": "const folderName = items[0].json.body.companyName;\nconst selectedColor = items[0].json.body.selectedColor;\n\nreturn [\n {\n json: {\n folderPath: folderName,\n color: selectedColor,\n }\n }\n];"
- },
- "id": "8567aebc-443e-4ebf-ade5-ebebf2f3b0c2",
- "name": "FolderName3",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -640,
- -7180
- ]
- },
- {
- "parameters": {
- "resource": "fileFolder",
- "queryString": "={{ $json.folderPath }}",
- "filter": {
- "folderId": {
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- }
- },
- "options": {}
- },
- "id": "2f1a4698-8708-4666-b112-5abfc1aea430",
- "name": "SearchFolder1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -340,
- -7180
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides-folder-create-subfolder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "d0627e62-2197-4f13-945b-58b3470cf6e1",
- "name": "GenerateSlides_Create1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -940,
- -7080
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides-folder-search-subfolder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "9a013a0d-b8f3-489f-a13d-3d91ded74b56",
- "name": "GenerateSlides_Search1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -940,
- -6900
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "resource": "folder",
- "name": "={{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}_{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.id }}",
- "mode": "id"
- },
- "options": {}
- },
- "id": "a85e0a50-7f4a-43f6-a1b5-5f6108cc762c",
- "name": "CreateSubFolder",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -80,
- -7260
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('OutputTextCut1').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Content-Type",
- "value": "application/json"
- }
- ]
- },
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c0a7f6a914_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_6\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_0\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_32\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_2\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_138\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_1\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_159\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_3\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_174\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_204\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_6\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c1a0221ae8_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_7\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_16\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4e164aa46_0_10\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_10\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 24,\n \"endIndex\": 41\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.firstLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 66,\n \"endIndex\": 83\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.secondLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 108,\n \"endIndex\": 125\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.thirdLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "508070ee-e9f0-47c3-8b83-09d840664731",
- "name": "Send urlGenerative1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2400,
- -220
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides-folder-search",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "7891309d-88c6-4499-b88e-0568a6e141e4",
- "name": "GenerateSlides_Search",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -740,
- 520
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides-folder-create",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "70baf5d1-7e24-4bb8-8168-7f90393993a6",
- "name": "GenerateSlides_Create",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -740,
- 340
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "resource": "fileFolder",
- "queryString": "={{ $json.folderPath }}",
- "filter": {
- "folderId": {
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- }
- },
- "options": {}
- },
- "id": "316566fe-a896-40d2-8ee2-2697aa3f668f",
- "name": "SearchFolder",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 240
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "const folderName = items[0].json.body.companyName;\nconst selectedColor = items[0].json.body.selectedColor;\n\nreturn [\n {\n json: {\n folderPath: folderName,\n color: selectedColor,\n }\n }\n];"
- },
- "id": "bb1d5549-d6f1-4eb5-9bb4-e3fa9cc8799b",
- "name": "FolderName2",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -440,
- 240
- ]
- },
- {
- "parameters": {},
- "id": "c2026edd-36c6-4b84-ae89-27749f493d5e",
- "name": "Merge14",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 2600,
- 1080
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "8a2c2640-ccc1-4494-b06d-87bf5459748b",
- "name": "Google Drive4",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 780,
- 980
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "9215641d-1838-49fe-b097-6e9cec27a027",
- "name": "FolderId3",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 500,
- 980
- ]
- },
- {
- "parameters": {},
- "id": "55711424-302b-4f77-8502-c486fe42b4fe",
- "name": "Merge13",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 240,
- 980
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "372bb3af-95f3-4740-8996-5d0c3a657d07",
- "name": "Google Drive3",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 780,
- 780
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "fa019f60-0b14-4b3f-bee1-9ca0d5da0df1",
- "name": "FolderId2",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 500,
- 780
- ]
- },
- {
- "parameters": {},
- "id": "dc75ee62-95c4-4521-8dbc-97ef3418e12a",
- "name": "Merge12",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 240,
- 780
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "9eb680e9-e607-4982-bc9c-2941b4cbbf7d",
- "name": "Google Drive",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 780,
- 600
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "3d300779-0fec-4e43-91e6-8d8f281f0e58",
- "name": "FolderId1",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 500,
- 600
- ]
- },
- {
- "parameters": {},
- "id": "0bb16bc9-e57f-4063-b77b-8d222bd25e25",
- "name": "Merge10",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 240,
- 600
- ]
- },
- {
- "parameters": {},
- "id": "c815fbbe-ce44-4f4f-ac11-a0c8894d51ee",
- "name": "Merge11",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 240,
- 420
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "6b711626-ae03-48b8-b790-2bce0727173a",
- "name": "Google Drive1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 780,
- 420
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "7c440a10-1e00-4637-ad23-fdfec112f9da",
- "name": "FolderId",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 500,
- 420
- ]
- },
- {
- "parameters": {
- "resource": "folder",
- "name": "={{ $json.folderPath }}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "a7abdef2-db99-4b28-b608-09fb8282c9f9",
- "name": "CreateFolder",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 80
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "const folderName = items[0].json.body.companyName;\nconst selectedColor = items[0].json.body.selectedColor;\n\nreturn [\n {\n json: {\n folderPath: folderName,\n color: selectedColor,\n }\n }\n];"
- },
- "id": "365af3ca-c4ef-4c4e-b3f4-2ca984ce1644",
- "name": "FolderName",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -440,
- 80
- ]
- },
- {
- "parameters": {
- "operation": "getSlides",
- "presentationId": "={{ $json.id }}"
- },
- "id": "cd752b2a-da52-4472-bcd6-694bb33a2125",
- "name": "Google Slides1",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1220,
- 240
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst imageUrls = items[0].json.body.imageUrls;\nconst logoData = items[0].json.body.logoData;\nconst companyName = items[0].json.body.companyName;\nconst urlGenerative = items[0].json.body.urlGenerative;\nconst firstLinkDescription = items[0].json.body.firstLink.description;\nconst firstLinkUrl = items[0].json.body.firstLink.url;\nconst firstLinkDisplayName = items[0].json.body.firstLink.displayName;\nconst secondLinkDescription = items[0].json.body.secondLink.description;\nconst secondLinkUrl = items[0].json.body.secondLink.url;\nconst secondLinkDisplayName = items[0].json.body.secondLink.displayName;\nconst thirdLinkDescription = items[0].json.body.thirdLink.description;\nconst thirdLinkUrl = items[0].json.body.thirdLink.url;\nconst thirdLinkDisplayName = items[0].json.body.thirdLink.displayName;\nconst red = items[0].json.body.selectedColor.red;\nconst green = items[0].json.body.selectedColor.green;\nconst blue = items[0].json.body.selectedColor.blue;\n\nconst text = items[0].json.body.output; // Make sure this is where your text is located\nconst sections = {};\nconst regex = /<h1 className=\"h1title\">(.*?)<\\/h1>\\s*<[^>]+>(.*?)<\\/[^>]+>/gis;\nconst removalRegex = /【\\d†source】/g; // Expression to remove undesired strings\n\nlet match;\nlet contentCounter = 1; // Counter for contents\nlet titleCounter = 1; // Counter for titles\n\nwhile ((match = regex.exec(text)) !== null) {\n let title = match[1].trim().replace(removalRegex, '');\n let content = match[2].trim().replace(removalRegex, '');\n \n const titlePlaceholder = `sectionTitre${titleCounter}`; // Placeholder for the title\n const contentPlaceholder = `sectionContenu${contentCounter}`; // Placeholder for the content\n sections[titlePlaceholder] = title.toUpperCase();\n sections[contentPlaceholder] = content;\n \n titleCounter++;\n contentCounter++;\n}\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n sections: sections,\n imageUrls: imageUrls,\n logoData: logoData,\n urlGenerative: urlGenerative,\n companyName: companyName,\n firstLinkDescription: firstLinkDescription,\n firstLinkUrl: firstLinkUrl,\n firstLinkDisplayName: firstLinkDisplayName,\n secondLinkDescription: secondLinkDescription,\n secondLinkUrl: secondLinkUrl,\n secondLinkDisplayName: secondLinkDisplayName,\n thirdLinkDescription: thirdLinkDescription,\n thirdLinkUrl: thirdLinkUrl,\n thirdLinkDisplayName: thirdLinkDisplayName,\n red: red,\n green: green,\n blue: blue\n};\n\nreturn { json: result };"
- },
- "id": "9b78d68b-d79f-43f4-b182-0d9bcbc804bf",
- "name": "OutputTextCut1",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1740,
- 60
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[1] }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "3dcf8916-89a0-41d2-8f8f-b4102a66d961",
- "name": "Send image 2 to Google Drive1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -440,
- 980
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[0] }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "1eb8ccfb-10ee-4de6-b0c4-1e7e32d39910",
- "name": "Send image 1 to Google Drive1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -440,
- 780
- ]
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "112196d9-15a5-4557-a741-46cedaab7f2a",
- "name": "Réponse au Webhook TEXT",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- 3020,
- 1080
- ]
- },
- {
- "parameters": {
- "jsCode": "const presentationId = items[0].json.presentationId;\nconst folderId = items[1].json.folderId;\n\n// presentationId in one object\nconst result = {\n presentationId: presentationId,\n folderId: folderId\n};\n\nreturn { json: result };\n"
- },
- "id": "d9a58dea-b40b-470b-b48b-a6ba65a6ab9f",
- "name": "InsertImages3",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 2820,
- 1080
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst logoId = items[2].json.id;\nconst image1Id = items[3].json.id;\nconst image2Id = items[4].json.id;\n\n\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n image1Id: image1Id,\n image2Id: image2Id,\n logoId: logoId\n};\n\nreturn { json: result };\n"
- },
- "id": "15aae91a-86da-4f2a-bab1-7917cd8ee2aa",
- "name": "InsertImages1",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 2020,
- 600
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {},
- "id": "1dfed88a-855a-46b2-981e-0ddf6b356fd4",
- "name": "Merge9",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1740,
- 600
- ]
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "={{ $json.sections.sectionTitre1 }}",
- "text": "{{sectionTitre1}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre2 }}",
- "text": "{{sectionTitre2}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre3 }}",
- "text": "{{sectionTitre3}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre4 }}",
- "text": "{{sectionTitre4}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre5 }}",
- "text": "{{sectionTitre5}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre6 }}",
- "text": "{{sectionTitre6}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre7 }}",
- "text": "{{sectionTitre7}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDescription }}",
- "text": "{{sectionDescription1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDescription }}",
- "text": "{{sectionDescription2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDescription }}",
- "text": "{{sectionDescription3}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDisplayName }} ",
- "text": "{{sectionLien1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDisplayName }}",
- "text": "{{sectionLien2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDisplayName }}",
- "text": "{{sectionLien3}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "5d7e4432-1f7b-45da-a018-dafc41177cbd",
- "name": "Insert cutTitles",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2400,
- -40
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "cdeef1df-0167-4e1a-abcb-394f1cfca547",
- "name": "Google Drive Upload logo1",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 600
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "url": "={{ $json.body.logoData }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "be9adbed-f9c3-4c54-a3ab-74dbe1ae471a",
- "name": "Send logo to Google Drive1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -440,
- 600
- ]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image1Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-p\" }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "39a9069a-3299-40f8-80a6-67149e03b210",
- "name": "Insert images into placeholders",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2400,
- 600
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "= \n",
- "text": "\\n"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "e8162332-aeaf-4ea5-afa0-5806016afaac",
- "name": "remove \\n",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2660,
- 160
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "p"
- ],
- "replaceText": "={{ $json.companyName }}",
- "text": "{{nom_compagnie}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "b0ea87d4-f02d-4b78-a243-0081bc6b08c8",
- "name": "Insert companyName",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2400,
- 360
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.logoId }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"Logo_client\" }\n }\n }\n ]\n} ",
- "options": {}
- },
- "id": "e6067534-1180-4e57-852d-44eaba97f797",
- "name": "Insert logo into PH",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2400,
- 1000
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image2Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-x\" }\n }\n }\n ]\n}",
- "options": {}
- },
- "id": "7b1d0228-2cac-43b8-9ad3-10042227ba0b",
- "name": "Insert images 2 into placeholders 1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2400,
- 800
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "g1f1e0df403e_0_20"
- ],
- "replaceText": "={{ $json.sections.sectionContenu1 }}",
- "text": "{{sectionContenu1}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_21"
- ],
- "replaceText": "={{ $json.sections.sectionContenu2 }}",
- "text": "{{sectionContenu2}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_129"
- ],
- "replaceText": "={{ $json.sections.sectionContenu3 }}",
- "text": "{{sectionContenu3}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_148"
- ],
- "replaceText": "={{ $json.sections.sectionContenu4 }}",
- "text": "{{sectionContenu4}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_164"
- ],
- "replaceText": "={{ $json.sections.sectionContenu5 }}",
- "text": "{{sectionContenu5}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_193"
- ],
- "replaceText": "={{ $json.sections.sectionContenu6 }}",
- "text": "{{sectionContenu6}}"
- },
- {
- "pageObjectIds": [
- "g2c1a0221ae8_0_0"
- ],
- "replaceText": "={{ $json.sections.sectionContenu7 }}",
- "text": "{{sectionContenu7}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "803fd271-20c5-45fb-964e-b97156b297f0",
- "name": "Insert cutText",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2400,
- 160
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('Code for color modification').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateShapeProperties\": {\n \"objectId\": \"{{ $json['foundShape']['objectId'] }}\",\n \"fields\": \"shapeBackgroundFill.solidFill.color\",\n \"shapeProperties\": {\n \"shapeBackgroundFill\": {\n \"solidFill\": {\n \"color\": {\n \"rgbColor\": {\n \"red\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['red'] }}\",\n \"green\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['green'] }}\",\n \"blue\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['blue'] }}\"\n }\n }\n }\n }\n }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "c8ce4383-ed73-4ad5-92a7-061a5645d815",
- "name": "Send new color to slides",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2020,
- 360
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "\n\n\n// Le alt text du triangle qu'on cherche\nconst targetDescription = \"bordure\";\n\n// Correcting the path to access borderColor \nif (!items[0].json.body || !items[0].json.body.selectedColor) {\n throw new Error(\"borderColor is undefined or not passed correctly.\");\n}\n\n// Adjusting to the correct path\nconst inputColor = items[0].json.body.selectedColor;\n\n// Assuming `items[0].json.slides` is the array of slides you received from the Slides API.\nconst slides = items[1].json.slides;\n\n// Placeholder for the found shapes\nlet foundShapes = [];\n\n// Loop over each slide\nfor (const slide of slides) {\n // Check if slide has pageElements and it's an array\n if (Array.isArray(slide.pageElements)) {\n // Find all shapes with the description 'triangle1' within the current slide\n const matchingShapes = slide.pageElements.filter(\n (element) => element.description === targetDescription\n );\n foundShapes = foundShapes.concat(matchingShapes);\n }\n}\n\n// Check if we found any shapes\nif (foundShapes.length > 0) {\n // Apply the new color to all found shapes.\n foundShapes.forEach(foundShape => {\n foundShape.shape.shapeProperties.shapeBackgroundFill.solidFill.color.rgbColor = {\n red: inputColor.red, // Ensure this is a value between 0 and 1\n green: inputColor.green, // Ensure this is a value between 0 and 1\n blue: inputColor.blue, // Ensure this is a value between 0 and 1\n alpha: inputColor.alpha || 1, // Default to 1 if alpha is not provided\n };\n });\n\n // Return the modified shapes and the presentationId\n return foundShapes.map(foundShape => ({\n json: {\n foundShape: foundShape,\n presentationId: items[1].json.presentationId\n }\n }));\n} else {\n // If no shapes with 'triangle1' description were found in any slide\n return [{ json: { error: \"Shape with description 'triangle1' not found\" } }];\n}\n"
- },
- "id": "e8692ba7-8bb0-4d10-97cf-ccc5ecc13e2b",
- "name": "Code for color modification",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1740,
- 360
- ]
- },
- {
- "parameters": {},
- "id": "9147a709-1b9a-4f2f-8265-e3ed381e071a",
- "name": "Merge8",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1480,
- 360
- ]
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "={{ $json.id }}"
- },
- "id": "e3527896-88f3-409e-a65c-82f52b862fd5",
- "name": "Getting the copied Slide",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1220,
- 420
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "copy",
- "fileId": {
- "__rl": true,
- "value": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ",
- "mode": "id"
- },
- "name": "=\"Pitch\" + {{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}-{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}:{{(\"0\" + new Date().getSeconds()).slice(-2)}}",
- "sameFolder": false,
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.id }}",
- "mode": "id"
- },
- "options": {}
- },
- "id": "8344ac07-4994-4e9c-8850-19f6767903e8",
- "name": "Copy temp src and generate unique name file",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 420
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ"
- },
- "id": "dba867c6-f726-4372-83c8-2d75178fe8ef",
- "name": "Get Templace Source",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -440,
- 420
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "8d52b914-ae02-4858-aa3c-c0f91fefc5ed",
- "name": "Merge7",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1220,
- 620
- ]
- },
- {
- "parameters": {},
- "id": "d96427a9-6b6c-4b1a-9945-fbbb9511617c",
- "name": "Merge6",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1040,
- 780
- ]
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "841ef845-7555-4733-a224-d5062cce75a4",
- "name": "Change permission access1",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1480,
- 520
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "42a82d7a-e904-4881-bb48-69267fb23963",
- "name": "Google Drive Upload image3",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 980
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate slides in folder\n\n",
- "width": 332.0380316721941,
- "color": 7
- },
- "id": "d96d42bc-d169-4c1c-982e-5be086dd82a6",
- "name": "Sticky Note14",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1160,
- 360
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "5f755cfc-70bb-44db-9acc-0a4964cba0d8",
- "name": "Google Drive Upload image",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -140,
- 780
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Step 7: \n## Send G-mail",
- "height": 163.66336633663366,
- "width": 267.4234596525042
- },
- "id": "b102bc24-d740-4acd-ab6c-d4cbfa3fdb61",
- "name": "Sticky Note10",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1180,
- -1260
- ]
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "gmail",
- "options": {}
- },
- "id": "c37a9ab2-d4ff-4d21-b3ba-37ea3a665c2b",
- "name": "Webhook: Send g-mail1",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -880,
- -1240
- ],
- "webhookId": "702ffef6-10da-471a-b71f-54a8a57826a1"
- },
- {
- "parameters": {
- "conditions": {
- "options": {
- "caseSensitive": true,
- "leftValue": "",
- "typeValidation": "strict"
- },
- "conditions": [
- {
- "id": "5f8c76d3-600a-4ece-95d7-8e28d4c20e4b",
- "leftValue": "={{ $json.body.sendOption }}",
- "rightValue": "now",
- "operator": {
- "type": "string",
- "operation": "equals",
- "name": "filter.operator.equals"
- }
- }
- ],
- "combinator": "and"
- },
- "options": {}
- },
- "id": "a121b60a-b257-4515-aaa7-13c561d213c6",
- "name": "If1",
- "type": "n8n-nodes-base.if",
- "typeVersion": 2,
- "position": [
- -480,
- -1240
- ]
- },
- {
- "parameters": {
- "amount": 20
- },
- "id": "95a6637e-4900-47f5-9b6a-a6e33b581ae4",
- "name": "Wait",
- "type": "n8n-nodes-base.wait",
- "typeVersion": 1,
- "position": [
- -240,
- -1160
- ],
- "webhookId": "363838d3-03a2-4a82-88ab-4bc939e70e19"
- },
- {
- "parameters": {
- "sendTo": "={{ $json.body.recipient }}",
- "subject": "={{ $json.body.subject }}",
- "message": "={{ $json.body.message }}",
- "options": {
- "attachmentsUi": {
- "attachmentsBinary": [
- {}
- ]
- },
- "bccList": "={{ $json.body.cci }}",
- "ccList": "={{ $json.body.cc }}"
- }
- },
- "id": "f3576136-4fa0-4476-96ea-fddd68af38d9",
- "name": "Gmail3",
- "type": "n8n-nodes-base.gmail",
- "typeVersion": 2.1,
- "position": [
- -20,
- -1260
- ],
- "credentials": {
- "gmailOAuth2": {
- "id": "B3bDOeN9uiZP2cER",
- "name": "Gmail Emanuel"
- }
- }
- },
- {
- "parameters": {
- "operation": "download",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.body.pdfId }}",
- "mode": "id"
- },
- "options": {}
- },
- "id": "97ad900c-cb9c-499f-9e50-c4bab2dd7de0",
- "name": "Google Drive2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -680,
- -1240
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-search-folder",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "9f8a8da3-af07-4cd2-891b-4f0ef5e60599",
- "name": "SearchFolder to get folderID",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -920,
- -7680
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "resource": "fileFolder",
- "queryString": "={{ $json.body.companyName }}",
- "filter": {
- "folderId": {
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "whatToSearch": "folders"
- },
- "options": {
- "fields": []
- }
- },
- "id": "60fe2385-d438-4b42-9da7-a7be2804f0fd",
- "name": "Search for existing folder",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -640,
- -7680
- ],
- "alwaysOutputData": true,
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "6eb11c82-4c3c-41f7-8bcf-66fe06a195f2",
- "name": "Réponse au Webhook SearchFolder",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- -400,
- -7680
- ]
- },
- {
- "parameters": {
- "content": "## Search for existing folder in Google Drive (Si vous en avez de besoin)\n\n",
- "width": 263.78290591263107,
- "color": 5
- },
- "id": "4047e318-745e-492a-8946-8ab0ea56eeef",
- "name": "Sticky Note17",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1244,
- -7700
- ]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('OutputTextCut3').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Content-Type",
- "value": "application/json"
- }
- ]
- },
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c0a7f6a914_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_6\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_0\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_32\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_2\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_138\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_1\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_159\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_3\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_174\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_4\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_204\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_6\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c1a0221ae8_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_7\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g2c0a7f6a914_0_16\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4e164aa46_0_10\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g2c7c4771883_0_10\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 0,\n \"endIndex\": 14\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateImageProperties\": {\n \"objectId\": \"g1f4ef1b3123_0_11\",\n \"fields\": \"link\",\n \"imageProperties\": {\n \"link\": {\n \"url\": \"{{ $json.urlGenerative }}\"\n }\n }\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 24,\n \"endIndex\": 41\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.firstLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 66,\n \"endIndex\": 83\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.secondLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n },\n {\n \"updateTextStyle\": {\n \"objectId\": \"g1f4ef1b3123_0_9\",\n \"textRange\": {\n \"type\": \"FIXED_RANGE\",\n \"startIndex\": 108,\n \"endIndex\": 125\n },\n \"style\": {\n \"link\": {\n \"url\": \"{{ $json.thirdLinkUrl }}\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {\n \"red\": {{ $json.red }},\n \"green\": {{ $json.green }},\n \"blue\": {{ $json.blue }}\n }\n }\n },\n \"underline\": false\n },\n \"fields\": \"link,foregroundColor,underline\"\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "1db7a147-09fb-4173-891e-4fd37da5a248",
- "name": "Send urlGenerative3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2300,
- -6040
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "429e1c02-e223-4c52-8ad3-a618f5a3091a",
- "name": "Merge27",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 2500,
- -4740
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "72864d1e-386c-4d69-b389-71ed916cb5ce",
- "name": "Google Drive12",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 680,
- -4840
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "0793c2d0-97a2-4a9c-9656-2a035540fb52",
- "name": "FolderId11",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 400,
- -4840
- ]
- },
- {
- "parameters": {},
- "id": "c27c7687-d8cb-4cd2-959a-0093d21bd4ba",
- "name": "Merge28",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 140,
- -4840
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "ed47968c-4e9e-4589-8124-3272f11cf145",
- "name": "Google Drive13",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 680,
- -5040
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "b611ee2e-7337-40da-9a5b-9053a18b2a2a",
- "name": "FolderId12",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 400,
- -5040
- ]
- },
- {
- "parameters": {},
- "id": "f541ffed-4bb8-4f45-be29-d5170a4365c3",
- "name": "Merge29",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 140,
- -5040
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "e29c4211-1ecb-4359-9deb-8a14afa28fa7",
- "name": "Google Drive14",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 680,
- -5220
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "ab92beba-9ba2-4c16-8e6e-09cbb27a9a77",
- "name": "FolderId13",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 400,
- -5220
- ]
- },
- {
- "parameters": {},
- "id": "94ea9f07-d676-4855-8699-6eb5439bc1f5",
- "name": "Merge30",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 140,
- -5220
- ]
- },
- {
- "parameters": {},
- "id": "ca81f59d-0c14-4955-a8e4-4af53bca032f",
- "name": "Merge31",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 140,
- -5400
- ]
- },
- {
- "parameters": {
- "operation": "move",
- "fileId": {
- "__rl": true,
- "value": "={{ $json.presentationId }}",
- "mode": "id"
- },
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "=\n{{ $json.folderId }}",
- "mode": "id"
- }
- },
- "id": "729148af-2e9d-4c4a-97d1-7538d25885c0",
- "name": "Google Drive15",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- 680,
- -5400
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "return [\n {\n json: {\n folderId: items[0].json.id,\n presentationId: items[1].json.id\n }\n }\n];"
- },
- "id": "4770cd88-de15-4c25-abc2-9fee888524b8",
- "name": "FolderId14",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 400,
- -5400
- ]
- },
- {
- "parameters": {
- "resource": "folder",
- "name": "={{ $json.folderPath }}_{{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}_{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "mode": "list",
- "value": "root",
- "cachedResultName": "/ (Root folder)"
- },
- "options": {}
- },
- "id": "732b07fc-33e8-44db-89d6-8589736add58",
- "name": "CreateFolder2",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -240,
- -5600
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "const folderName = items[0].json.body.companyName;\nconst selectedColor = items[0].json.body.selectedColor;\n\nreturn [\n {\n json: {\n folderPath: folderName,\n color: selectedColor,\n }\n }\n];"
- },
- "id": "6b35bd50-9419-4fee-9215-546654f25ee5",
- "name": "FolderName5",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- -540,
- -5600
- ]
- },
- {
- "parameters": {
- "operation": "getSlides",
- "presentationId": "={{ $json.id }}"
- },
- "id": "d4435173-9e33-4c6a-96b8-2a1cec7018aa",
- "name": "Google Slides3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1120,
- -5580
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst imageUrls = items[0].json.body.imageUrls;\nconst logoData = items[0].json.body.logoData;\nconst companyName = items[0].json.body.companyName;\nconst urlGenerative = items[0].json.body.urlGenerative;\nconst firstLinkDescription = items[0].json.body.firstLink.description;\nconst firstLinkUrl = items[0].json.body.firstLink.url;\nconst firstLinkDisplayName = items[0].json.body.firstLink.displayName;\nconst secondLinkDescription = items[0].json.body.secondLink.description;\nconst secondLinkUrl = items[0].json.body.secondLink.url;\nconst secondLinkDisplayName = items[0].json.body.secondLink.displayName;\nconst thirdLinkDescription = items[0].json.body.thirdLink.description;\nconst thirdLinkUrl = items[0].json.body.thirdLink.url;\nconst thirdLinkDisplayName = items[0].json.body.thirdLink.displayName;\nconst red = items[0].json.body.selectedColor.red;\nconst green = items[0].json.body.selectedColor.green;\nconst blue = items[0].json.body.selectedColor.blue;\n\nconst text = items[0].json.body.output; // Make sure this is where your text is located\nconst sections = {};\nconst regex = /<h1 className=\"h1title\">(.*?)<\\/h1>\\s*<[^>]+>(.*?)<\\/[^>]+>/gis;\nconst removalRegex = /【\\d†source】/g; // Expression to remove undesired strings\n\nlet match;\nlet contentCounter = 1; // Counter for contents\nlet titleCounter = 1; // Counter for titles\n\nwhile ((match = regex.exec(text)) !== null) {\n let title = match[1].trim().replace(removalRegex, '');\n let content = match[2].trim().replace(removalRegex, '');\n \n const titlePlaceholder = `sectionTitre${titleCounter}`; // Placeholder for the title\n const contentPlaceholder = `sectionContenu${contentCounter}`; // Placeholder for the content\n sections[titlePlaceholder] = title.toUpperCase();\n sections[contentPlaceholder] = content;\n \n titleCounter++;\n contentCounter++;\n}\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n sections: sections,\n imageUrls: imageUrls,\n logoData: logoData,\n urlGenerative: urlGenerative,\n companyName: companyName,\n firstLinkDescription: firstLinkDescription,\n firstLinkUrl: firstLinkUrl,\n firstLinkDisplayName: firstLinkDisplayName,\n secondLinkDescription: secondLinkDescription,\n secondLinkUrl: secondLinkUrl,\n secondLinkDisplayName: secondLinkDisplayName,\n thirdLinkDescription: thirdLinkDescription,\n thirdLinkUrl: thirdLinkUrl,\n thirdLinkDisplayName: thirdLinkDisplayName,\n red: red,\n green: green,\n blue: blue\n};\n\nreturn { json: result };"
- },
- "id": "47114013-1b2f-48a4-9f6b-670575611aff",
- "name": "OutputTextCut3",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1640,
- -5760
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "respondWith": "allIncomingItems",
- "options": {}
- },
- "id": "e808b97a-ddac-4e8d-8f3a-a48819ef0578",
- "name": "Réponse au Webhook TEXT3",
- "type": "n8n-nodes-base.respondToWebhook",
- "typeVersion": 1,
- "position": [
- 2920,
- -4740
- ]
- },
- {
- "parameters": {
- "jsCode": "const presentationId = items[0].json.presentationId;\nconst folderId = items[1].json.folderId;\n\n// presentationId in one object\nconst result = {\n presentationId: presentationId,\n folderId: folderId\n};\n\nreturn { json: result };\n"
- },
- "id": "6a31beaa-666f-4c63-87e4-c6b651342cec",
- "name": "InsertImages6",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 2720,
- -4740
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "jsCode": "\nconst presentationId = items[1].json.presentationId;\nconst logoId = items[2].json.id;\nconst image1Id = items[3].json.id;\nconst image2Id = items[4].json.id;\n\n\n\n// Combine sections and presentationId in one object\nconst result = {\n presentationId: presentationId,\n image1Id: image1Id,\n image2Id: image2Id,\n logoId: logoId\n};\n\nreturn { json: result };\n"
- },
- "id": "da6d892a-512d-4e3c-bcde-f689dca044f1",
- "name": "InsertImages7",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1920,
- -5220
- ],
- "alwaysOutputData": false
- },
- {
- "parameters": {},
- "id": "401930d3-cffd-4813-a200-b9eef1d904c0",
- "name": "Merge32",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1640,
- -5220
- ]
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "={{ $json.sections.sectionTitre1 }}",
- "text": "{{sectionTitre1}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre2 }}",
- "text": "{{sectionTitre2}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre3 }}",
- "text": "{{sectionTitre3}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre4 }}",
- "text": "{{sectionTitre4}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre5 }}",
- "text": "{{sectionTitre5}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre6 }}",
- "text": "{{sectionTitre6}}"
- },
- {
- "replaceText": "={{ $json.sections.sectionTitre7 }}",
- "text": "{{sectionTitre7}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDescription }}",
- "text": "{{sectionDescription1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDescription }}",
- "text": "{{sectionDescription2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDescription }}",
- "text": "{{sectionDescription3}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.firstLinkDisplayName }} ",
- "text": "{{sectionLien1}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.secondLinkDisplayName }}",
- "text": "{{sectionLien2}}"
- },
- {
- "pageObjectIds": [
- "g1f4ef1b3123_0_0"
- ],
- "replaceText": "={{ $json.thirdLinkDisplayName }}",
- "text": "{{sectionLien3}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "6be8e8d5-6c6a-4b30-b588-f3f8365ca23e",
- "name": "Insert cutTitles3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2300,
- -5860
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "15f3cb3d-fa52-4cc6-a9b2-4fe426fdd739",
- "name": "Google Drive Upload logo3",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -240,
- -5220
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image1Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-p\" }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "e4812ae7-49d6-4a2d-97a8-adc8205a7c32",
- "name": "Insert images into placeholders3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2300,
- -5220
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "replaceText": "= \n",
- "text": "\\n"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "e4883a3b-98af-4080-9c90-5bca3197243e",
- "name": "remove \\n3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2560,
- -5660
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "p"
- ],
- "replaceText": "={{ $json.companyName }}",
- "text": "{{nom_compagnie}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "a7462fa2-1263-4fa3-877d-234c8db8e806",
- "name": "Insert companyName3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2300,
- -5460
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.logoId }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"Logo_client\" }\n }\n }\n ]\n} ",
- "options": {}
- },
- "id": "11311526-a742-441d-9d44-e531cf0b2848",
- "name": "Insert logo into PH3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2300,
- -4820
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $json.presentationId }}:batchUpdate ",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"replaceAllShapesWithImage\": {\n \"imageUrl\": \"https://drive.google.com/uc?id={{ $json.image2Id }}\",\n \"imageReplaceMethod\": \"CENTER_INSIDE\",\n \"containsText\": { \"text\": \"placeholder-image-x\" }\n }\n }\n ]\n}",
- "options": {}
- },
- "id": "2cd82159-989d-4d20-8242-04bc120e6703",
- "name": "Insert images 2 into placeholders 3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 2300,
- -5020
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "replaceText",
- "presentationId": "={{ $json.presentationId }}",
- "textUi": {
- "textValues": [
- {
- "pageObjectIds": [
- "g1f1e0df403e_0_20"
- ],
- "replaceText": "={{ $json.sections.sectionContenu1 }}",
- "text": "{{sectionContenu1}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_21"
- ],
- "replaceText": "={{ $json.sections.sectionContenu2 }}",
- "text": "{{sectionContenu2}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_129"
- ],
- "replaceText": "={{ $json.sections.sectionContenu3 }}",
- "text": "{{sectionContenu3}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_148"
- ],
- "replaceText": "={{ $json.sections.sectionContenu4 }}",
- "text": "{{sectionContenu4}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_164"
- ],
- "replaceText": "={{ $json.sections.sectionContenu5 }}",
- "text": "{{sectionContenu5}}"
- },
- {
- "pageObjectIds": [
- "g2c0a7f6a914_0_193"
- ],
- "replaceText": "={{ $json.sections.sectionContenu6 }}",
- "text": "{{sectionContenu6}}"
- },
- {
- "pageObjectIds": [
- "g2c1a0221ae8_0_0"
- ],
- "replaceText": "={{ $json.sections.sectionContenu7 }}",
- "text": "{{sectionContenu7}}"
- }
- ]
- },
- "options": {
- "revisionId": ""
- }
- },
- "id": "b8d1f302-085c-4514-b9c4-bb9cb4377ad4",
- "name": "Insert cutText3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 2300,
- -5660
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "method": "POST",
- "url": "=https://slides.googleapis.com/v1/presentations/{{ $('Code for color modification3').item.json.presentationId }}:batchUpdate",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleSlidesOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "={\n \"requests\": [\n {\n \"updateShapeProperties\": {\n \"objectId\": \"{{ $json['foundShape']['objectId'] }}\",\n \"fields\": \"shapeBackgroundFill.solidFill.color\",\n \"shapeProperties\": {\n \"shapeBackgroundFill\": {\n \"solidFill\": {\n \"color\": {\n \"rgbColor\": {\n \"red\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['red'] }}\",\n \"green\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['green'] }}\",\n \"blue\": \"{{ $json['foundShape']['shape']['shapeProperties']['shapeBackgroundFill']['solidFill']['color']['rgbColor']['blue'] }}\"\n }\n }\n }\n }\n }\n }\n }\n ]\n}\n",
- "options": {}
- },
- "id": "5f270b17-b11b-422a-a5c8-de3c9c9e463b",
- "name": "Send new color to slides3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1920,
- -5460
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "jsCode": "\n\n\n// Le alt text du triangle qu'on cherche\nconst targetDescription = \"bordure\";\n\n// Correcting the path to access borderColor \nif (!items[0].json.body || !items[0].json.body.selectedColor) {\n throw new Error(\"borderColor is undefined or not passed correctly.\");\n}\n\n// Adjusting to the correct path\nconst inputColor = items[0].json.body.selectedColor;\n\n// Assuming `items[0].json.slides` is the array of slides you received from the Slides API.\nconst slides = items[1].json.slides;\n\n// Placeholder for the found shapes\nlet foundShapes = [];\n\n// Loop over each slide\nfor (const slide of slides) {\n // Check if slide has pageElements and it's an array\n if (Array.isArray(slide.pageElements)) {\n // Find all shapes with the description 'triangle1' within the current slide\n const matchingShapes = slide.pageElements.filter(\n (element) => element.description === targetDescription\n );\n foundShapes = foundShapes.concat(matchingShapes);\n }\n}\n\n// Check if we found any shapes\nif (foundShapes.length > 0) {\n // Apply the new color to all found shapes.\n foundShapes.forEach(foundShape => {\n foundShape.shape.shapeProperties.shapeBackgroundFill.solidFill.color.rgbColor = {\n red: inputColor.red, // Ensure this is a value between 0 and 1\n green: inputColor.green, // Ensure this is a value between 0 and 1\n blue: inputColor.blue, // Ensure this is a value between 0 and 1\n alpha: inputColor.alpha || 1, // Default to 1 if alpha is not provided\n };\n });\n\n // Return the modified shapes and the presentationId\n return foundShapes.map(foundShape => ({\n json: {\n foundShape: foundShape,\n presentationId: items[1].json.presentationId\n }\n }));\n} else {\n // If no shapes with 'triangle1' description were found in any slide\n return [{ json: { error: \"Shape with description 'triangle1' not found\" } }];\n}\n"
- },
- "id": "40f16d17-c5ca-45b2-a801-fba6ff161f87",
- "name": "Code for color modification3",
- "type": "n8n-nodes-base.code",
- "typeVersion": 2,
- "position": [
- 1640,
- -5460
- ]
- },
- {
- "parameters": {},
- "id": "91b1319f-3194-43c9-b523-edb5be5d257d",
- "name": "Merge33",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1380,
- -5460
- ]
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "={{ $json.id }}"
- },
- "id": "1b5d981d-246a-48c1-8e93-5e0f89048643",
- "name": "Getting the copied Slide3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- 1120,
- -5400
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {
- "operation": "copy",
- "fileId": {
- "__rl": true,
- "value": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ",
- "mode": "id"
- },
- "name": "=\"Pitch\" + {{new Date().getFullYear()}}-{{(\"0\" + (new Date().getMonth() + 1)).slice(-2)}}-{{(\"0\" + new Date().getDate()).slice(-2)}}-{{(\"0\" + new Date().getHours()).slice(-2)}}:{{(\"0\" + new Date().getMinutes()).slice(-2)}}:{{(\"0\" + new Date().getSeconds()).slice(-2)}}",
- "sameFolder": false,
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "={{ $json.id }}",
- "mode": "id"
- },
- "options": {}
- },
- "id": "78c39ac6-bbce-4103-a5b5-8c9455f3c612",
- "name": "Copy temp src and generate unique name file3",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -240,
- -5400
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "operation": "get",
- "presentationId": "1bRj2003LHoNJWfjQ3N3meVlgpDD8cmMmOWniHfpgFLQ"
- },
- "id": "ada78e6f-c007-4ad9-a8d9-b0480bd00d69",
- "name": "Get Templace Source3",
- "type": "n8n-nodes-base.googleSlides",
- "typeVersion": 2,
- "position": [
- -540,
- -5400
- ],
- "credentials": {
- "googleSlidesOAuth2Api": {
- "id": "yloV13TPeYn5lmdZ",
- "name": "Google Slides account"
- }
- }
- },
- {
- "parameters": {},
- "id": "4426846b-a91b-4c05-8bb7-ff585d97d72d",
- "name": "Merge34",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 1120,
- -5200
- ]
- },
- {
- "parameters": {},
- "id": "db8a0c1b-0ace-4172-8986-a31a8e6e1c2c",
- "name": "Merge35",
- "type": "n8n-nodes-base.merge",
- "typeVersion": 2.1,
- "position": [
- 940,
- -5040
- ]
- },
- {
- "parameters": {
- "method": "=POST",
- "url": "=https://www.googleapis.com/drive/v3/files/{{ $json.id }}/permissions",
- "authentication": "predefinedCredentialType",
- "nodeCredentialType": "googleDriveOAuth2Api",
- "sendBody": true,
- "specifyBody": "json",
- "jsonBody": "{\n \"role\": \"reader\",\n \"type\": \"anyone\"\n}",
- "options": {}
- },
- "id": "ab596cc4-e20b-4212-acfa-5d4cf1914912",
- "name": "Change permission access3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- 1380,
- -5300
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "Ez0VV5Mm43ioqg7r",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "60ceda22-1a55-4b1f-8eb1-136b2f3e6ce1",
- "name": "Google Drive Upload image6",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -240,
- -4840
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "content": "## Generate slides in folder with name and creation date \n",
- "width": 332.0380316721941
- },
- "id": "970bc900-c1ea-4e99-8288-894f9870e6a4",
- "name": "Sticky Note18",
- "type": "n8n-nodes-base.stickyNote",
- "typeVersion": 1,
- "position": [
- -1260,
- -5500
- ]
- },
- {
- "parameters": {
- "inputDataFieldName": "=data",
- "driveId": {
- "__rl": true,
- "mode": "list",
- "value": "My Drive"
- },
- "folderId": {
- "__rl": true,
- "value": "root",
- "mode": "list",
- "cachedResultName": "/ (Root folder)",
- "cachedResultUrl": "https://drive.google.com/drive"
- },
- "options": {}
- },
- "id": "ee69c88e-5c61-43f2-a40f-19503e5dfff1",
- "name": "Google Drive Upload image7",
- "type": "n8n-nodes-base.googleDrive",
- "typeVersion": 3,
- "position": [
- -240,
- -5040
- ],
- "credentials": {
- "googleDriveOAuth2Api": {
- "id": "qipLEwtX0VvgOAKy",
- "name": "Google Drive account 2"
- }
- }
- },
- {
- "parameters": {
- "httpMethod": "POST",
- "path": "v4-generate-slides-folder-create-date",
- "responseMode": "responseNode",
- "options": {
- "allowedOrigins": "*"
- }
- },
- "id": "9b27005d-947b-4beb-bb21-fb64a669b5af",
- "name": "GenerateSlides_Create2",
- "type": "n8n-nodes-base.webhook",
- "typeVersion": 1.1,
- "position": [
- -840,
- -5480
- ],
- "webhookId": "d845efd4-3b7b-4447-be4d-3cdfb1cddf2d"
- },
- {
- "parameters": {
- "url": "={{ $json.body.logoData }}",
- "options": {
- "response": {
- "response": {
- "responseFormat": "file"
- }
- }
- }
- },
- "id": "d05dfc70-71c3-42a7-b20b-0be80d427305",
- "name": "Send logo to Google Drive3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -540,
- -5220
- ]
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[0]}}",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Host",
- "value": "oaidalleapiprodscus.blob.core.windows.net"
- },
- {
- "name": "User-Agent",
- "value": "Mozilla/5.0"
- },
- {
- "name": "Connection",
- "value": "keep-alive"
- }
- ]
- },
- "options": {
- "response": {
- "response": {
- "fullResponse": true,
- "responseFormat": "file"
- }
- },
- "timeout": 90000
- }
- },
- "id": "d6f40c9f-0cfd-44c5-97b0-5070dc096134",
- "name": "Send image 1 to Google Drive3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -540,
- -5040
- ],
- "retryOnFail": false,
- "waitBetweenTries": 3000,
- "alwaysOutputData": false
- },
- {
- "parameters": {
- "url": "={{ $json.body.imageUrls[1] }}",
- "sendHeaders": true,
- "headerParameters": {
- "parameters": [
- {
- "name": "Host",
- "value": "oaidalleapiprodscus.blob.core.windows.net"
- },
- {
- "name": "User-Agent",
- "value": "Mozilla/5.0"
- },
- {
- "name": "Connection",
- "value": "keep-alive"
- }
- ]
- },
- "options": {
- "response": {
- "response": {
- "fullResponse": true,
- "responseFormat": "file"
- }
- },
- "timeout": 90000
- }
- },
- "id": "d54626b7-8e03-4b87-ac98-1a43e49e975d",
- "name": "Send image 2 to Google Drive3",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 4.1,
- "position": [
- -540,
- -4840
- ],
- "retryOnFail": false,
- "waitBetweenTries": 3000,
- "alwaysOutputData": false
- }
- ],
- "pinData": {},
- "connections": {
- "Drive API Export PDF1": {
- "main": [
- [
- {
- "node": "Save PDF in Drive1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Save PDF in Drive1": {
- "main": [
- [
- {
- "node": "Merge15",
- "type": "main",
- "index": 1
- },
- {
- "node": "Change permission access PDF1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook PDF1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : Generate PDF1": {
- "main": [
- [
- {
- "node": "Drive API Export PDF1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge15",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId4": {
- "main": [
- [
- {
- "node": "Google Drive5",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge15": {
- "main": [
- [
- {
- "node": "FolderId4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OpenAI Assistant1": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXTE1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : générer texte1": {
- "main": [
- [
- {
- "node": "OpenAI Assistant1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : Merge PDFs": {
- "main": [
- [
- {
- "node": "Google Drive Upload chosen PDF2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge16",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload chosen PDF2": {
- "main": [
- [
- {
- "node": "Change permission access pdf1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook upload PDF2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge16",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "FolderId5": {
- "main": [
- [
- {
- "node": "Google Drive6",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge16": {
- "main": [
- [
- {
- "node": "FolderId5",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook: Upload chosen PDF1": {
- "main": [
- [
- {
- "node": "Google Drive Upload chosen PDF3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge17",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload chosen PDF3": {
- "main": [
- [
- {
- "node": "Change permission access pdf3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook upload PDF3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge17",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Drive API Export PDF": {
- "main": [
- [
- {
- "node": "Save PDF in Drive",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Save PDF in Drive": {
- "main": [
- [
- {
- "node": "Change permission access PDF",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook PDF",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook: Upload chosen PDF": {
- "main": [
- [
- {
- "node": "Google Drive Upload chosen PDF",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload chosen PDF": {
- "main": [
- [
- {
- "node": "Change permission access pdf2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook upload PDF",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload image1": {
- "main": [
- [
- {
- "node": "Merge1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : générer slides": {
- "main": [
- [
- {
- "node": "Send image 1 to Google Drive",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive",
- "type": "main",
- "index": 0
- },
- {
- "node": "Get Templace Source1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge5",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OpenAI Assistant": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXTE",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Generate image (DE-3, 1792x1024)": {
- "main": [
- [
- {
- "node": "Merge",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image2": {
- "main": [
- [
- {
- "node": "Merge1",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge1": {
- "main": [
- [
- {
- "node": "Merge2",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge2": {
- "main": [
- [
- {
- "node": "Change permission access",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge3",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Get Templace Source1": {
- "main": [
- [
- {
- "node": "Copy temp src and generate unique name file1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Copy temp src and generate unique name file1": {
- "main": [
- [
- {
- "node": "Getting the copied Slide1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Google Slides",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Getting the copied Slide1": {
- "main": [
- [
- {
- "node": "Merge5",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge5": {
- "main": [
- [
- {
- "node": "Code for color modification1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge3",
- "type": "main",
- "index": 0
- },
- {
- "node": "OutputTextCut",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Code for color modification1": {
- "main": [
- [
- {
- "node": "Send new color to slides1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert cutText1": {
- "main": [
- [
- {
- "node": "remove \\n1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert logo into PH1": {
- "main": [
- [
- {
- "node": "InsertImages2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send logo to Google Drive": {
- "main": [
- [
- {
- "node": "Google Drive Upload logo",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload logo": {
- "main": [
- [
- {
- "node": "Merge2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge3": {
- "main": [
- [
- {
- "node": "InsertImages",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages": {
- "main": [
- [
- {
- "node": "Insert images into placeholders1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert images 2 into placeholders ",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert logo into PH1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages2": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXT2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : générer texte": {
- "main": [
- [
- {
- "node": "OpenAI Assistant",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : générer image": {
- "main": [
- [
- {
- "node": "Generate image (DE-3, 1792x1024)",
- "type": "main",
- "index": 0
- },
- {
- "node": "Generate image (DE-3, 1792x1024)1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Generate image (DE-3, 1792x1024)2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 1 to Google Drive": {
- "main": [
- [
- {
- "node": "Google Drive Upload image1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 2 to Google Drive": {
- "main": [
- [
- {
- "node": "Google Drive Upload image2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : Merge PDFs1": {
- "main": [
- [
- {
- "node": "Google Drive Upload chosen PDF1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload chosen PDF1": {
- "main": [
- [
- {
- "node": "Change permission access pdf",
- "type": "main",
- "index": 0
- },
- {
- "node": "Réponse au Webhook upload PDF1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Webhook : Generate PDF": {
- "main": [
- [
- {
- "node": "Drive API Export PDF",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Generate image (DE-3, 1792x1024)1": {
- "main": [
- [
- {
- "node": "Merge",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Generate image (DE-3, 1792x1024)2": {
- "main": [
- [
- {
- "node": "Merge4",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge": {
- "main": [
- [
- {
- "node": "Merge4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge4": {
- "main": [
- [
- {
- "node": "Réponse au Webhook IMAGE",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OutputTextCut": {
- "main": [
- [
- {
- "node": "Insert cutTitles1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutText1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert companyName1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send urlGenerative",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId6": {
- "main": [
- [
- {
- "node": "Google Drive7",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge17": {
- "main": [
- [
- {
- "node": "FolderId6",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload image4": {
- "main": [
- [
- {
- "node": "Merge24",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image5": {
- "main": [
- [
- {
- "node": "Merge25",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge18": {
- "main": [
- [
- {
- "node": "Merge19",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge19": {
- "main": [
- [
- {
- "node": "Change permission access2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge21",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Get Templace Source2": {
- "main": [
- [
- {
- "node": "Copy temp src and generate unique name file2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Copy temp src and generate unique name file2": {
- "main": [
- [
- {
- "node": "Merge22",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Getting the copied Slide2": {
- "main": [
- [
- {
- "node": "Merge20",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge20": {
- "main": [
- [
- {
- "node": "Code for color modification2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge21",
- "type": "main",
- "index": 0
- },
- {
- "node": "OutputTextCut2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Code for color modification2": {
- "main": [
- [
- {
- "node": "Send new color to slides2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert cutText2": {
- "main": [
- [
- {
- "node": "remove \\n2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert logo into PH2": {
- "main": [
- [
- {
- "node": "Merge26",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send logo to Google Drive2": {
- "main": [
- [
- {
- "node": "Google Drive Upload logo2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload logo2": {
- "main": [
- [
- {
- "node": "Merge23",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge21": {
- "main": [
- [
- {
- "node": "InsertImages4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages4": {
- "main": [
- [
- {
- "node": "Insert images into placeholders2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert images 2 into placeholders 2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert logo into PH2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages5": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXT1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 1 to Google Drive2": {
- "main": [
- [
- {
- "node": "Google Drive Upload image4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 2 to Google Drive2": {
- "main": [
- [
- {
- "node": "Google Drive Upload image5",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OutputTextCut2": {
- "main": [
- [
- {
- "node": "Insert cutTitles2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutText2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert companyName2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send urlGenerative2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderName1": {
- "main": [
- [
- {
- "node": "CreateFolder1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "CreateFolder1": {
- "main": [
- [
- {
- "node": "CreateSubFolder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId7": {
- "main": [
- [
- {
- "node": "Google Drive8",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive8": {
- "main": [
- [
- {
- "node": "Google Slides2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Getting the copied Slide2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge22": {
- "main": [
- [
- {
- "node": "FolderId7",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge23": {
- "main": [
- [
- {
- "node": "FolderId8",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId8": {
- "main": [
- [
- {
- "node": "Google Drive9",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive9": {
- "main": [
- [
- {
- "node": "Merge19",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge24": {
- "main": [
- [
- {
- "node": "FolderId9",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId9": {
- "main": [
- [
- {
- "node": "Google Drive10",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive10": {
- "main": [
- [
- {
- "node": "Merge18",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge25": {
- "main": [
- [
- {
- "node": "FolderId10",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId10": {
- "main": [
- [
- {
- "node": "Google Drive11",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge26",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive11": {
- "main": [
- [
- {
- "node": "Merge18",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Merge26": {
- "main": [
- [
- {
- "node": "InsertImages5",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderName3": {
- "main": [
- [
- {
- "node": "SearchFolder1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "SearchFolder1": {
- "main": [
- [
- {
- "node": "CreateSubFolder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "GenerateSlides_Create1": {
- "main": [
- [
- {
- "node": "Send image 1 to Google Drive2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Get Templace Source2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge20",
- "type": "main",
- "index": 0
- },
- {
- "node": "FolderName1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "GenerateSlides_Search1": {
- "main": [
- [
- {
- "node": "Get Templace Source2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 1 to Google Drive2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge20",
- "type": "main",
- "index": 0
- },
- {
- "node": "FolderName3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "CreateSubFolder": {
- "main": [
- [
- {
- "node": "Merge22",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge23",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge24",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge25",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "GenerateSlides_Search": {
- "main": [
- [
- {
- "node": "FolderName2",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 1 to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge8",
- "type": "main",
- "index": 0
- },
- {
- "node": "Get Templace Source",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "GenerateSlides_Create": {
- "main": [
- [
- {
- "node": "FolderName",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 1 to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge8",
- "type": "main",
- "index": 0
- },
- {
- "node": "Get Templace Source",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "SearchFolder": {
- "main": [
- [
- {
- "node": "Merge13",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge12",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge10",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge11",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderName2": {
- "main": [
- [
- {
- "node": "SearchFolder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge14": {
- "main": [
- [
- {
- "node": "InsertImages3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive4": {
- "main": [
- [
- {
- "node": "Merge6",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "FolderId3": {
- "main": [
- [
- {
- "node": "Merge14",
- "type": "main",
- "index": 1
- },
- {
- "node": "Google Drive4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge13": {
- "main": [
- [
- {
- "node": "FolderId3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive3": {
- "main": [
- [
- {
- "node": "Merge6",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId2": {
- "main": [
- [
- {
- "node": "Google Drive3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge12": {
- "main": [
- [
- {
- "node": "FolderId2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive": {
- "main": [
- [
- {
- "node": "Merge7",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId1": {
- "main": [
- [
- {
- "node": "Google Drive",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge10": {
- "main": [
- [
- {
- "node": "FolderId1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge11": {
- "main": [
- [
- {
- "node": "FolderId",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive1": {
- "main": [
- [
- {
- "node": "Google Slides1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Getting the copied Slide",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId": {
- "main": [
- [
- {
- "node": "Google Drive1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "CreateFolder": {
- "main": [
- [
- {
- "node": "Merge13",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge12",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge10",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge11",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderName": {
- "main": [
- [
- {
- "node": "CreateFolder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OutputTextCut1": {
- "main": [
- [
- {
- "node": "Send urlGenerative1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutTitles",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert companyName",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutText",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 2 to Google Drive1": {
- "main": [
- [
- {
- "node": "Google Drive Upload image3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 1 to Google Drive1": {
- "main": [
- [
- {
- "node": "Google Drive Upload image",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages3": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXT",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages1": {
- "main": [
- [
- {
- "node": "Insert images into placeholders",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert logo into PH",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert images 2 into placeholders 1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge9": {
- "main": [
- [
- {
- "node": "InsertImages1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload logo1": {
- "main": [
- [
- {
- "node": "Merge10",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Send logo to Google Drive1": {
- "main": [
- [
- {
- "node": "Google Drive Upload logo1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert logo into PH": {
- "main": [
- [
- {
- "node": "Merge14",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert cutText": {
- "main": [
- [
- {
- "node": "remove \\n",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Code for color modification": {
- "main": [
- [
- {
- "node": "Send new color to slides",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge8": {
- "main": [
- [
- {
- "node": "OutputTextCut1",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge9",
- "type": "main",
- "index": 0
- },
- {
- "node": "Code for color modification",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Getting the copied Slide": {
- "main": [
- [
- {
- "node": "Merge8",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Copy temp src and generate unique name file": {
- "main": [
- [
- {
- "node": "Merge11",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Get Templace Source": {
- "main": [
- [
- {
- "node": "Copy temp src and generate unique name file",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge7": {
- "main": [
- [
- {
- "node": "Merge9",
- "type": "main",
- "index": 1
- },
- {
- "node": "Change permission access1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge6": {
- "main": [
- [
- {
- "node": "Merge7",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image3": {
- "main": [
- [
- {
- "node": "Merge13",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image": {
- "main": [
- [
- {
- "node": "Merge12",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Webhook: Send g-mail1": {
- "main": [
- [
- {
- "node": "Google Drive2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "If1": {
- "main": [
- [
- {
- "node": "Gmail3",
- "type": "main",
- "index": 0
- }
- ],
- [
- {
- "node": "Wait",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Wait": {
- "main": [
- [
- {
- "node": "Gmail3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive2": {
- "main": [
- [
- {
- "node": "If1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "SearchFolder to get folderID": {
- "main": [
- [
- {
- "node": "Search for existing folder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Search for existing folder": {
- "main": [
- [
- {
- "node": "Réponse au Webhook SearchFolder",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge27": {
- "main": [
- [
- {
- "node": "InsertImages6",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive12": {
- "main": [
- [
- {
- "node": "Merge35",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "FolderId11": {
- "main": [
- [
- {
- "node": "Merge27",
- "type": "main",
- "index": 1
- },
- {
- "node": "Google Drive12",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge28": {
- "main": [
- [
- {
- "node": "FolderId11",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive13": {
- "main": [
- [
- {
- "node": "Merge35",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId12": {
- "main": [
- [
- {
- "node": "Google Drive13",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge29": {
- "main": [
- [
- {
- "node": "FolderId12",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive14": {
- "main": [
- [
- {
- "node": "Merge34",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId13": {
- "main": [
- [
- {
- "node": "Google Drive14",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge30": {
- "main": [
- [
- {
- "node": "FolderId13",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge31": {
- "main": [
- [
- {
- "node": "FolderId14",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive15": {
- "main": [
- [
- {
- "node": "Google Slides3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Getting the copied Slide3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderId14": {
- "main": [
- [
- {
- "node": "Google Drive15",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "CreateFolder2": {
- "main": [
- [
- {
- "node": "Merge28",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge29",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge30",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge31",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "FolderName5": {
- "main": [
- [
- {
- "node": "CreateFolder2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OutputTextCut3": {
- "main": [
- [
- {
- "node": "Send urlGenerative3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutTitles3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert companyName3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert cutText3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages6": {
- "main": [
- [
- {
- "node": "Réponse au Webhook TEXT3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "InsertImages7": {
- "main": [
- [
- {
- "node": "Insert images into placeholders3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert logo into PH3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Insert images 2 into placeholders 3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge32": {
- "main": [
- [
- {
- "node": "InsertImages7",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Google Drive Upload logo3": {
- "main": [
- [
- {
- "node": "Merge30",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Insert logo into PH3": {
- "main": [
- [
- {
- "node": "Merge27",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Insert cutText3": {
- "main": [
- [
- {
- "node": "remove \\n3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Code for color modification3": {
- "main": [
- [
- {
- "node": "Send new color to slides3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge33": {
- "main": [
- [
- {
- "node": "OutputTextCut3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge32",
- "type": "main",
- "index": 0
- },
- {
- "node": "Code for color modification3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Getting the copied Slide3": {
- "main": [
- [
- {
- "node": "Merge33",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Copy temp src and generate unique name file3": {
- "main": [
- [
- {
- "node": "Merge31",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Get Templace Source3": {
- "main": [
- [
- {
- "node": "Copy temp src and generate unique name file3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge34": {
- "main": [
- [
- {
- "node": "Merge32",
- "type": "main",
- "index": 1
- },
- {
- "node": "Change permission access3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Merge35": {
- "main": [
- [
- {
- "node": "Merge34",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image6": {
- "main": [
- [
- {
- "node": "Merge28",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "Google Drive Upload image7": {
- "main": [
- [
- {
- "node": "Merge29",
- "type": "main",
- "index": 1
- }
- ]
- ]
- },
- "GenerateSlides_Create2": {
- "main": [
- [
- {
- "node": "FolderName5",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 2 to Google Drive3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send image 1 to Google Drive3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Merge33",
- "type": "main",
- "index": 0
- },
- {
- "node": "Get Templace Source3",
- "type": "main",
- "index": 0
- },
- {
- "node": "Send logo to Google Drive3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send logo to Google Drive3": {
- "main": [
- [
- {
- "node": "Google Drive Upload logo3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 1 to Google Drive3": {
- "main": [
- [
- {
- "node": "Google Drive Upload image7",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Send image 2 to Google Drive3": {
- "main": [
- [
- {
- "node": "Google Drive Upload image6",
- "type": "main",
- "index": 0
- }
- ]
- ]
- }
- },
- "active": true,
- "settings": {
- "executionOrder": "v1",
- "saveManualExecutions": true,
- "callerPolicy": "workflowsFromSameOwner"
- },
- "versionId": "27c4a7f8-172f-4e5d-a179-104af3042690",
- "meta": {
- "templateCredsSetupCompleted": true,
- "instanceId": "36abe9b3ac99fd4c745db3c9a045f0513ab3f13db58e2ecb7d39728c27629c76"
- },
- "id": "sRVFLh9N8T3XKFWP",
- "tags": []
- }
Add Comment
Please, Sign In to add comment