{
  "name": "⭐ One-Click Online Course Creator ⭐",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.compression",
      "typeVersion": 1.1,
      "position": [
        -3760,
        1536
      ],
      "id": "19fa7b44-9fc8-4195-a839-80f0caf9a1c6",
      "name": "Compress"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3568,
        1488
      ],
      "typeVersion": 1,
      "id": "c9c7c4dc-c290-4c93-bcb6-d0358586f541",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4784,
        1520
      ],
      "typeVersion": 1,
      "id": "3baed297-3e40-4b57-923a-670586d5303a",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# Vector Store Setup\n\n## This section builds the knowledge foundation for the course creation pipeline. Raw PDF chapters are chunked, embedded via Cohere, and indexed in Qdrant. Once complete, AI agents can query this vector store to retrieve relevant content for lesson design and script generation.\n",
        "height": 320,
        "width": 592,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        2064
      ],
      "typeVersion": 1,
      "id": "bc47aef8-c9be-4c0f-9553-ad50f28d8588",
      "name": "Sticky Note16"
    },
    {
      "parameters": {
        "content": "",
        "height": 1040,
        "width": 2640,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1408
      ],
      "typeVersion": 1,
      "id": "f0dd498b-4031-4fbd-8f85-0a85eb62867c",
      "name": "Sticky Note15"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        1728
      ],
      "typeVersion": 1,
      "id": "1edd8935-4f74-4461-ae8b-42465924cfcb",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -624,
        1584
      ],
      "id": "73244f22-8a57-48b5-8fb8-264394b2fc3d",
      "name": "HTTP Request1",
      "executeOnce": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 5,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        3904,
        1840
      ],
      "id": "d538b802-da38-4094-baef-4a53c9d0a9d9",
      "name": "If7"
    },
    {
      "parameters": {
        "content": "",
        "height": 1040,
        "width": 2144,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2976,
        1408
      ],
      "typeVersion": 1,
      "id": "eacf07a0-6f42-479a-8c48-5f263a1c4c6b",
      "name": "Sticky Note19"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Search for current statistics, modern real-world examples, or recent industry developments. Use sparingly — vector store is your primary source.",
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "count": 4,
        "additionalParameters": {
          "search_lang": "en"
        }
      },
      "type": "@brave/n8n-nodes-brave-search.braveSearchTool",
      "typeVersion": 1,
      "position": [
        -1744,
        3712
      ],
      "id": "369af958-db1b-442f-ae3c-f4221c48b316",
      "name": "Brave Search1",
      "credentials": {
        "braveSearchApi": {
          "id": "4yKxSu1Rx4YYMObx",
          "name": "Brave Search Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -816,
        4160
      ],
      "id": "ef1490cd-e0aa-4a30-8c41-62b8f14c6846",
      "name": "Wait1",
      "webhookId": "b0856f12-6ce4-4f73-86ac-0b88773c7e16",
      "executeOnce": true
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"segments\": {\n      \"type\": \"array\",\n      \"minItems\": 8,\n      \"maxItems\": 16,\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"segment_number\": {\n            \"type\": \"integer\",\n            \"minimum\": 1\n          },\n          \"text\": {\n            \"type\": \"string\"\n          },\n          \"word_count\": {\n            \"type\": \"integer\",\n            \"minimum\": 80\n          }\n        },\n        \"required\": [\"segment_number\", \"text\", \"word_count\"],\n        \"additionalProperties\": false\n      }\n    },\n    \"total_segments\": {\n      \"type\": \"integer\",\n      \"minimum\": 8,\n      \"maximum\": 16\n    },\n    \"total_word_count\": {\n      \"type\": \"integer\"\n    },\n    \"original_word_count\": {\n      \"type\": \"integer\"\n    },\n    \"word_count_match\": {\n      \"type\": \"boolean\"\n    }\n  },\n  \"required\": [\n    \"segments\",\n    \"total_segments\",\n    \"total_word_count\",\n    \"original_word_count\",\n    \"word_count_match\"\n  ],\n  \"additionalProperties\": false\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1216,
        3056
      ],
      "id": "6e00ae4b-34d8-4268-ad54-79f074c7fc67",
      "name": "Structured Output Parser4"
    },
    {
      "parameters": {
        "content": "",
        "height": 240,
        "width": 182,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2960,
        3024
      ],
      "typeVersion": 1,
      "id": "7c669712-ff85-4ac7-8167-9139dbe42ac7",
      "name": "Sticky Note35"
    },
    {
      "parameters": {
        "content": "",
        "height": 1184,
        "width": 2592,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        2544
      ],
      "typeVersion": 1,
      "id": "d54622fe-7d75-4003-b300-dd4d3857af13",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "",
        "height": 944,
        "width": 2064,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2768,
        2544
      ],
      "typeVersion": 1,
      "id": "e3c0b6be-8909-4eed-b2d2-1a8ee030c1a9",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "content": "",
        "height": 2128,
        "width": 192,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        1664
      ],
      "typeVersion": 1,
      "id": "35c4bcb7-55a4-41b7-88bc-c96deaaaa538",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"name\": \"script_revision\",\n  \"strict\": true,\n  \"schema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"lesson_title\": {\n        \"type\": \"string\",\n        \"description\": \"The title of the lesson being revised\"\n      },\n      \"original_word_count\": {\n        \"type\": \"integer\",\n        \"description\": \"Word count of the original script\"\n      },\n      \"revised_word_count\": {\n        \"type\": \"integer\",\n        \"description\": \"Word count of the revised script\"\n      },\n      \"revised_script\": {\n        \"type\": \"string\",\n        \"description\": \"Complete revised teleprompter-ready script as continuous flowing prose\"\n      },\n      \"feedback_addressed\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"string\"\n        },\n        \"minItems\": 1,\n        \"description\": \"List of feedback points and how each was addressed\"\n      },\n      \"changes_made\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"string\"\n        },\n        \"minItems\": 1,\n        \"description\": \"Summary of specific changes made to the script\"\n      }\n    },\n    \"required\": [\n      \"lesson_title\",\n      \"original_word_count\",\n      \"revised_word_count\",\n      \"revised_script\",\n      \"feedback_addressed\",\n      \"changes_made\"\n    ],\n    \"additionalProperties\": false\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -96,
        3040
      ],
      "id": "defc10d1-aabe-4e87-8404-5fa0c80b220c",
      "name": "Structured Output Parser6"
    },
    {
      "parameters": {
        "content": "",
        "height": 1056,
        "width": 2928,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        1408
      ],
      "typeVersion": 1,
      "id": "cbad44ef-5dd0-4810-a499-8e7070a49f1d",
      "name": "Sticky Note17"
    },
    {
      "parameters": {
        "content": "",
        "height": 1008,
        "width": 3520,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3136,
        3536
      ],
      "typeVersion": 1,
      "id": "235913a6-9132-4799-bf85-7b3924cf9a7d",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "name"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.sort",
      "typeVersion": 1,
      "position": [
        -3712,
        1776
      ],
      "id": "fb1d8bc7-4fae-4e91-9c1b-67451082c375",
      "name": "Sort_01"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -2816,
        1776
      ],
      "id": "d81bc503-4a85-46f0-aaf9-6015dcbc9f12",
      "name": "ActivateWebhook_01",
      "executeOnce": true
    },
    {
      "parameters": {
        "formTitle": "TestPracticeCourse",
        "formDescription": "Course Maker",
        "formFields": {
          "values": [
            {
              "fieldLabel": "PDF Attachment",
              "fieldType": "file",
              "requiredField": true
            },
            {
              "fieldLabel": "Are you a Taylor Swift fan?",
              "fieldType": "password",
              "requiredField": true
            },
            {
              "fieldLabel": "Do you hate Donald Trump?",
              "fieldType": "password",
              "requiredField": true
            },
            {
              "fieldName": "What's your email?",
              "fieldType": "hiddenField"
            },
            {
              "fieldName": "What's your phone number?",
              "fieldType": "hiddenField"
            }
          ]
        },
        "options": {
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "respondWith": "redirect",
              "redirectUrl": "https://hesham.us/"
            }
          },
          "ignoreBots": true
        }
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [
        -4688,
        1552
      ],
      "id": "cb2efec6-602e-4148-ac85-6fd38165f1a0",
      "name": "PDFAttachmentUpload",
      "webhookId": "08d52ca2-87d9-45d9-a0e3-2de5da78a1a0"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://pdf.supergenius.cloud/api/v1/general/split-pdf-by-chapters",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "*/*"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "fileId"
            },
            {
              "name": "includeMetadata",
              "value": "false"
            },
            {
              "name": "allowDuplicates",
              "value": "false"
            },
            {
              "name": "bookmarkLevel",
              "value": "0"
            },
            {
              "parameterType": "formBinaryData",
              "name": "fileInput",
              "inputDataFieldName": "PDF_Attachment"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -3968,
        1536
      ],
      "id": "5e2fd417-eaca-42f2-920b-4c45d9bac2be",
      "name": "SplitPDFByChapter",
      "credentials": {
        "httpHeaderAuth": {
          "id": "qBzrJCdw85CRgbPJ",
          "name": "Stirling PDF Key"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "let results = [];\n\nfor (item of items) {\n    for (key of Object.keys(item.binary)) {\n        results.push({\n            json: {\n                fileName: item.binary[key].fileName\n            },\n            binary: {\n                data: item.binary[key],\n            }\n        });\n    }\n}\n\nreturn results;"
      },
      "name": "SplitUpBinaryData",
      "type": "n8n-nodes-base.function",
      "position": [
        -3536,
        1536
      ],
      "typeVersion": 1,
      "id": "07b5f075-b936-4709-a24a-7244aa7a88f4"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -3280,
        1536
      ],
      "id": "4abe4a9b-d55c-43a4-84a8-fc6c2791611b",
      "name": "GlobalConstants_01",
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $('SplitUpBinaryData').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_01').first().json.constants.doc_folder_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "id": "8d4f7cc0-36a4-4ccb-9a22-6395e49bd0d7",
      "name": "UploadSplitPDFs",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -3904,
        1776
      ],
      "typeVersion": 3,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_01').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_01').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Chapter Number": "={{ $json.name.split(\" \")[0] }}",
            "STATUS": "={{ $('GlobalConstants_01').first().json.constants.Status_4 }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Chapter Name",
              "displayName": "Chapter Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Number",
              "displayName": "Lesson Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Name",
              "displayName": "Lesson Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "SCRIPT",
              "displayName": "SCRIPT",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Rewritten Script",
              "displayName": "Rewritten Script",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3536,
        1776
      ],
      "id": "365112c1-c5dc-4a8f-8642-ed501ec52761",
      "name": "AppendPDFChaptersIntoGoogleSheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_01').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_01').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Module": "={{ $('GlobalConstants_01').first().json.constants.Status_8 }}",
            "STATUS": "={{ $('GlobalConstants_01').first().json.constants.Status_8 }}",
            "Verdict": "={{ $('GlobalConstants_01').first().json.constants.Status_8 }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "file_id",
              "displayName": "file_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module",
              "displayName": "Module",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Verdict",
              "displayName": "Verdict",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3184,
        1776
      ],
      "id": "d995222e-7488-48d5-8662-e3837eefd292",
      "name": "AppendSTOPRow_01",
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "height": 896,
        "width": 1168,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4368,
        1408
      ],
      "typeVersion": 1,
      "id": "cc1071fd-1eb3-489a-99fc-03d60b7c2a55",
      "name": "Sticky Note18"
    },
    {
      "parameters": {
        "content": "# PDF Document Splitter By Chapter\n\n## Splits the source PDF into individual chapter files using Stirling PDF's bookmark-based extraction. ",
        "height": 192,
        "width": 608,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4320,
        2048
      ],
      "typeVersion": 1,
      "id": "7dad3880-d5d2-4bbc-bb3c-0b0c24da6bb4",
      "name": "Sticky Note20"
    },
    {
      "parameters": {
        "path": "cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2640,
        1776
      ],
      "id": "3fef2d1d-b676-4412-84d1-900f00c278f5",
      "name": "Webhook_01",
      "webhookId": "cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -2336,
        1776
      ],
      "id": "d5a7483e-9767-472d-827f-fb6dbaf752c8",
      "name": "GlobalConstants_02",
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $json.constants.Status_4 }}"
            },
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $json.constants.Status_8 }}"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -2080,
        1776
      ],
      "id": "10729c1d-e103-42fd-953f-4dc71b74266b",
      "name": "GetPDFChaptersFromGoogleSheet",
      "executeOnce": true,
      "retryOnFail": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "c6d73b8c-7045-43fe-9fc5-6ad3740558a3",
              "leftValue": "={{ $json.STATUS }}",
              "rightValue": "STOP",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1808,
        1776
      ],
      "id": "73ae4efb-50be-42ee-a753-f7b5191e32f9",
      "name": "If_01"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Chapter Name:\n\n{{ $json.Module }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You are a Book Chapter Classifier. You receive a chapter name and classify it.\n\nOUTPUT RULES (STRICT):\n- You MUST output valid JSON matching the exact schema provided\n- The \"classification\" field MUST be exactly one of two values: \"actual_content\" OR \"filler\"\n- No other values are permitted. Do not combine terms or add explanations.\n\nCLASSIFY AS \"actual_content\":\n- Numbered chapters (Chapter 1, Chapter 12)\n- Named narrative chapters (The Beginning, Into the Woods)\n- Parts/Sections (Part I, Section 3, Book Two)\n- Prologue, Epilogue\n- Substantive appendices\n\nCLASSIFY AS \"filler\":\n- Copyright, Copyright Notice, ©\n- Dedication, Dedications\n- Acknowledgments, Acknowledgements\n- Table of Contents, Contents\n- Index\n- About the Author\n- Disclaimer, Legal Notice\n- Title Page\n- Also By, Other Books By, Books by\n- Foreword, Preface, Introduction (when clearly editorial)\n- ISBN, Publishing Information\n- Half Title, Full Title\n- Blank, Front Matter, Back Matter\n- Tribute, Tributes, In Memory Of, In Memoriam\n- Praise, Praise for, Reviews, Endorsements\n- Epigraph, Quotations\n- Author's Note, Editor's Note, Publisher's Note\n- Permissions, Credits, Photo Credits\n- Glossary (unless core to understanding the content)\n- Bibliography, References, Works Cited, Further Reading\n- Colophon\n\nWhen uncertain, consider: \"Would a reader skip this to get to the story/core content?\" If yes, classify as \"filler\"."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -1600,
        1792
      ],
      "id": "63f68d79-2af1-4750-b918-8a2ff4a6a739",
      "name": "FilterIncidentalBookSections"
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1600,
        2000
      ],
      "id": "93a7b1f6-6170-4988-a44d-a34d920588fb",
      "name": "MistralCloud_01",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1536,
        2208
      ],
      "id": "0157febb-afb8-4734-ba33-ee2bececc5d3",
      "name": "MistralCloud_02",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"name\": \"chapter_classification\",\n  \"strict\": true,\n  \"schema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"chapter_name\": {\n        \"type\": \"string\",\n        \"description\": \"The chapter name that was analyzed\"\n      },\n      \"is_actual_content\": {\n        \"type\": \"boolean\",\n        \"description\": \"True if actual book content, false if filler\"\n      },\n      \"classification\": {\n        \"type\": \"string\",\n        \"enum\": [\"actual_content\", \"filler\"],\n        \"description\": \"Must be exactly 'actual_content' or 'filler'\"\n      }\n    },\n    \"required\": [\"chapter_name\", \"is_actual_content\", \"classification\"],\n    \"additionalProperties\": false\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1536,
        2080
      ],
      "id": "3d50226d-1b8c-4d8e-85b1-74ad522d0fd9",
      "name": "StructuredOutputParser_01"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "c6d73b8c-7045-43fe-9fc5-6ad3740558a3",
              "leftValue": "={{ $json.output.classification }}",
              "rightValue": "filler",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1280,
        1792
      ],
      "id": "fa7b229a-d6da-43db-a997-3651810f41ff",
      "name": "If_02"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.row_number }}",
            "Verdict": "={{ $json.output.classification }}",
            "STATUS": "={{ $('GlobalConstants_02').first().json.constants.Status_1 }}",
            "file_id": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.file_id }}",
            "Module": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.Module }}",
            "Chapter Number": "={{ $('GetPDFChaptersFromGoogleSheet').item.json['Chapter Number'] }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "file_id",
              "displayName": "file_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Module",
              "displayName": "Module",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Verdict",
              "displayName": "Verdict",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1072,
        1872
      ],
      "id": "84dae823-c811-46e4-a32c-069bc46f3af3",
      "name": "UpdateBookChapterGoogleSheet_02",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "deleteCollection",
        "collectionName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').item.json.constants.course_name }}",
          "mode": "name"
        },
        "requestOptions": {}
      },
      "type": "n8n-nodes-qdrant.qdrant",
      "typeVersion": 1,
      "position": [
        -880,
        1872
      ],
      "id": "149a01de-9424-4ab0-99a5-0188e2e65b56",
      "name": "DeleteVectorStoreCollection_01",
      "executeOnce": false,
      "credentials": {
        "qdrantRestApi": {
          "id": "kyJuaZdMhkSypEWf",
          "name": "Qdrant account"
        }
      }
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=http://qdrant:6333/collections/{{ $('GlobalConstants_02').item.json.constants.course_name }}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantRestApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"vectors\": {\n    \"size\": 1024,\n    \"distance\": \"Cosine\",\n    \"on_disk\": true\n  },\n  \"shard_number\": 1,  \n  \"replication_factor\": 1,  \n  \"write_consistency_factor\": 1,\n  \"hnsw_config\": { \"m\": 32, \"ef_construct\": 256, \"on_disk\": false },\n  \"optimizers_config\": { \"default_segment_number\": 1 }\n}",
        "options": {}
      },
      "id": "d7e1b7ef-35ad-4082-a26b-be6bba9b1975",
      "name": "CreateCollection_01",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -704,
        1872
      ],
      "typeVersion": 4.2,
      "retryOnFail": false,
      "waitBetweenTries": 5000,
      "credentials": {
        "qdrantRestApi": {
          "id": "kyJuaZdMhkSypEWf",
          "name": "Qdrant account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $('UpdateBookChapterGoogleSheet_02').item.json.file_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        112,
        1648
      ],
      "id": "c59d3e68-d4eb-4727-9a25-d8d598dfcc72",
      "name": "DownloadPDFChapterPDF",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "YW5uoCGpLGXuL18x",
          "name": "Google Drive (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 5,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -480,
        2016
      ],
      "id": "d2b69abe-62f4-480a-bd8f-e62da10bfcf2",
      "name": "If_03"
    },
    {
      "parameters": {
        "amount": 30
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -256,
        2096
      ],
      "id": "fe972fd7-b11c-42d5-a6bd-230d5e653b3c",
      "name": "Wait_01",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "content": "# Chapter Classification\n\n## Filters chapter files to identify actual book content versus front/back matter filler. Discards non-content sections like Table of Contents, Dedications, Copyright, and Index.",
        "height": 240,
        "width": 720,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        2160
      ],
      "typeVersion": 1,
      "id": "47207905-0254-4a82-8334-e85b1e414079",
      "name": "Sticky Note21"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 160,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        2000
      ],
      "typeVersion": 1,
      "id": "e9bc0d6d-fbf2-4315-b69f-916f7f7ee425",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        1552
      ],
      "typeVersion": 1,
      "id": "05321041-5733-4376-a183-dea207380b1e",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mistral.ai/v1/files",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "mistralCloudApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {}
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "purpose",
              "value": "ocr"
            },
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        368,
        1648
      ],
      "id": "41ad1343-52f0-4055-a41b-5e629b3ca7e9",
      "name": "MistralOCR_01",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.mistral.ai/v1/files/{{ $json.id }}/url",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "mistralCloudApi",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "expiry",
              "value": "24"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        544,
        1648
      ],
      "id": "9b7400ee-3b3f-4ba1-af9c-fa9bcc836330",
      "name": "MistralOCR_02",
      "retryOnFail": true,
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mistral.ai/v1/ocr",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "mistralCloudApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {}
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"mistral-ocr-latest\",\n  \"document\": {\n    \"type\": \"document_url\",\n    \"document_url\": \"{{ $json.url }}\"\n  },\n  \"include_image_base64\": true,\n  \"bbox_annotation_format\": {\n    \"type\": \"text\",\n    \"json_schema\": {\n      \"name\": \"visual_description\",\n      \"description\": \"Extract a concise natural language descreiption for each distinct visual element (image, chart, table, diagram etc.) on the page. Focus on summarizing what each visual element contains and/or conveys.\",\n      \"schema\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"string\",\n          \"description\": \"A concise description of a single visual element.\"\n        }\n      },\n      \"strict\": false\n    }\n  }\n}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        704,
        1648
      ],
      "id": "65a98144-c648-46f5-b1bb-fff0d218d9d0",
      "name": "MistralOCR_03",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "pages",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        896,
        1648
      ],
      "id": "908f5ca7-699f-4c0c-8621-c2f69ed62fe9",
      "name": "SplitOut_01"
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.course_name }}",
          "mode": "id"
        },
        "embeddingBatchSize": 96,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        2288,
        1664
      ],
      "id": "1d28491d-9be3-4928-bf2a-3493ba4ece4c",
      "name": "QdrantVectorStore_01",
      "credentials": {
        "qdrantApi": {
          "id": "f4OYPtbhAv74DCJ1",
          "name": "Qdrant API"
        }
      }
    },
    {
      "parameters": {
        "resource": "point",
        "operation": "upsertPoints",
        "collectionName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.course_name }}",
          "mode": "name"
        },
        "points": "={{\n$json.points.map(item => ({\n  id: item.id,\n  payload: {\n    content: item.annotation,\n    metadata: {}\n  },\n  vector: item.embedding\n})).toJsonString()\n}}",
        "wait": false,
        "requestOptions": {}
      },
      "id": "fe97f57e-f3de-452a-b646-99f44205d8e9",
      "name": "QdrantVectorStore_02",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        1760,
        2160
      ],
      "typeVersion": 1,
      "credentials": {
        "qdrantRestApi": {
          "id": "kyJuaZdMhkSypEWf",
          "name": "Qdrant account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "/**\n * n8n Code node — Mode: \"Run Once for Each Item\"\n * Input shape expected per item:\n *   item.json.markdown : string\n *   item.json.images   : [{ id|file_name|filename, image_annotation|annotation|caption|legend, ... }, ...]\n *\n * Behavior:\n * - For each image, find a Markdown image tag that includes the filename (id) in its link target.\n * - Insert the image's annotation text immediately after that tag.\n * - If the tag is missing, append a new tag + annotation at the end.\n * - Idempotent via a hidden sentinel comment so re-runs don't duplicate inserts.\n */\n\nconst item = $input.item;\nconst json = item.json ?? {};\nlet md = String(json.markdown ?? '');\nconst images = Array.isArray(json.images) ? json.images : [];\n\n// Escape a string for use in a dynamic RegExp\nconst escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\nfor (const img of images) {\n  // Try common filename keys\n  const id =\n    (img && (img.id ?? img.file_name ?? img.filename)) || null;\n  if (!id) continue;\n\n  // Try common annotation keys\n  const annotation = String(\n    (img.image_annotation ?? img.annotation ?? img.caption ?? img.legend ?? '')\n  ).trim();\n\n  if (!annotation) continue;\n\n  // Prevent duplicate insertion on re-runs\n  const sentinel = `<!--image-annotation:${id}-->`;\n  if (md.includes(sentinel)) continue;\n\n  // Match the *first* Markdown image tag that contains this filename anywhere in the link target\n  // Example match: ![anything](img-1.jpeg) or ![alt](assets/img-1.jpeg)\n  const pattern = new RegExp(\n    `(!\\\\[[^\\\\]]*\\\\]\\\\([^\\\\)]*${escapeRegExp(id)}[^\\\\)]*\\\\))`\n  );\n\n  if (pattern.test(md)) {\n    // Insert annotation right after the found image tag\n    md = md.replace(pattern, `$1\\n\\n${annotation}\\n\\n${sentinel}`);\n  } else {\n    // If no tag exists, append a new tag + annotation to the end\n    md += `\\n\\n![${id}](${id})\\n\\n${annotation}\\n\\n${sentinel}`;\n  }\n}\n\nitem.json.markdown = md;\nreturn item;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1184,
        1648
      ],
      "id": "cf32a173-b3de-48cf-a307-d1525688c2f9",
      "name": "Javascript_01"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "2ac5f384-9c3c-4a2f-98a8-adaca1bee883",
              "name": "markdown",
              "value": "={{ $json.markdown }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1376,
        1648
      ],
      "id": "4670bc9f-f798-4b1e-b7d2-7578d4b8996d",
      "name": "EditFields_01"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "eb17af95-de87-4469-9f28-25e736b7555b",
              "name": "file_name",
              "value": "={{$workflow.id.toString(36)}}{{$json.top_left_x.toString(36)}}{{$json.top_left_y}}{{$json.bottom_right_x.toString(36)}}{{$json.bottom_right_y.toString(36)}}",
              "type": "string"
            },
            {
              "id": "eb68e1c6-cddc-492e-abb7-73df0041c206",
              "name": "image_annotation",
              "value": "={{ $json.image_annotation }}",
              "type": "string"
            },
            {
              "id": "3fb34e0d-942b-438b-8b11-3dd2a236e153",
              "name": "image_base64",
              "value": "={{ $('SplitOut_02').item.json.image_base64.split(',')[1] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1376,
        1888
      ],
      "id": "0344a756-ec77-41c5-b31a-9fa9a7389a84",
      "name": "EditFields_"
    },
    {
      "parameters": {
        "fieldToSplitOut": "images",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1184,
        1888
      ],
      "id": "fb0a1808-a6bf-4c8a-81c0-7ecd0243d581",
      "name": "SplitOut_02"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "image_base64",
        "options": {
          "fileName": "={{ $('EditFields_').item.json.file_name }}"
        }
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1552,
        1888
      ],
      "id": "cb06fd0e-702f-4893-b7a3-6a51312a6d3b",
      "name": "ConvertBase64"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cohere.com/v2/embed",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "cohereApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"model\": \"embed-v4.0\",\n    \"input_type\": \"image\",\n    \"embedding_types\": [\"float\"],\n    \"images\": [\"data:image/png;base64,{{ $('EditFields_').item.json.image_base64 }}\"],\n  \"output_dimension\": 1024\n  }",
        "options": {}
      },
      "id": "d6e57743-3033-4037-9d0f-2332248474dc",
      "name": "CohereImageEmbeddings",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        1888
      ],
      "typeVersion": 4.2,
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ba2dbe6f-d433-4ed8-9727-e4258017b79a",
              "name": "id",
              "type": "number",
              "value": "={{ $json.images[0].width }}{{ $json.images[0].height }}{{ $json.images[0].bit_depth }}"
            },
            {
              "id": "e6b1d194-49fb-4b1b-8f8c-046209ed5b4b",
              "name": "embedding",
              "type": "array",
              "value": "={{ $json.embeddings.float[0] }}"
            },
            {
              "id": "3b800637-a814-40a3-bd80-553640845302",
              "name": "annotation",
              "value": "={{ $('EditFields_').item.json.image_annotation }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "79674c36-d60f-4957-aad4-891b347f4650",
      "name": "PreparePoints",
      "type": "n8n-nodes-base.set",
      "position": [
        1376,
        2160
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "points",
        "options": {}
      },
      "id": "47c85511-defd-4cbc-a4ea-d8d053316a3f",
      "name": "AggregatePoints",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1552,
        2160
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "textSplittingMode": "custom",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        2304,
        1840
      ],
      "id": "7db59f83-1a52-438c-a2b8-8189e64f0c62",
      "name": "DataLoader_01"
    },
    {
      "parameters": {
        "chunkSize": 1600,
        "chunkOverlap": 240,
        "options": {
          "splitCode": "markdown"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        2304,
        1984
      ],
      "id": "14ae58e2-8b1f-437f-b3ce-b9edde1a7c26",
      "name": "RecursiveTextCharacterSplitter"
    },
    {
      "parameters": {
        "content": "# Lesson Plan & Outline Generator\n\n## Transforms raw chapter content into structured course modules via instructional design AI. Outputs lesson titles, outlines, and ILOs following pedagogical best practices.",
        "height": 256,
        "width": 560,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4448,
        2128
      ],
      "typeVersion": 1,
      "id": "1a9df2e3-73c0-4cca-ac34-906a1662b6df",
      "name": "Sticky Note22"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        2960,
        1648
      ],
      "id": "f87117e9-4abc-4aee-984b-f00953668113",
      "name": "Merge_01",
      "executeOnce": false
    },
    {
      "parameters": {
        "model": "pixtral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        3296,
        1520
      ],
      "id": "be32de4b-6caf-475c-b254-5e1020780ea0",
      "name": "MistralCloud_03",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Search the web for current information, pedagogical best practices, or supplementary context to enhance lesson design. Use sparingly and only when chapter content would benefit from external enrichment.",
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "count": 5,
        "additionalParameters": {}
      },
      "type": "@brave/n8n-nodes-brave-search.braveSearchTool",
      "typeVersion": 1,
      "position": [
        3696,
        1504
      ],
      "id": "12e194e4-9ec7-4772-b6d8-f9c92c093993",
      "name": "BraveSearch_01",
      "credentials": {
        "braveSearchApi": {
          "id": "4yKxSu1Rx4YYMObx",
          "name": "Brave Search Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        3552,
        2176
      ],
      "id": "3981fdbc-fdff-411a-941e-b13236da93a0",
      "name": "MistralCloud_04",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3136,
        1648
      ],
      "id": "fda90f12-0bf9-474e-bea2-f615a53059a7",
      "name": "RandomStringGenerator_01",
      "executeOnce": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Chapter: {{ $('GetPDFChaptersFromGoogleSheet').first().json.Module.split(\".pdf\")[0] }}\n\nQuery the vector store to retrieve the full chapter content, then design 6-12 sequential lessons covering all material.",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are an Instructional Design Agent specializing in transforming book chapters into structured online course modules.\n\nYOUR TASK:\n1. Query the connected vector store to retrieve and understand the chapter content\n2. Analyze the material's scope, complexity, and natural divisions\n3. Design 6-12 sequential lessons that comprehensively cover the chapter\n4. Optionally use web search to enhance lesson design with current best practices or supplementary context\n\nLESSON DESIGN PRINCIPLES:\n- Each lesson should represent a single coherent concept or skill\n- Lessons should follow a logical progression (foundational → advanced)\n- Lesson titles should be clear, specific, and action-oriented where possible\n- Outlines should provide enough detail for a course creator to develop full content\n- Learning outcomes must be measurable and use action verbs (Bloom's Taxonomy: identify, explain, apply, analyze, evaluate, create)\n\nINTENDED LEARNING OUTCOMES (ILO) RULES:\n- Write 2-4 ILOs per lesson\n- Start each ILO with an action verb\n- Make ILOs specific and assessable\n- Format: \"By the end of this lesson, the learner will be able to [action verb] [specific skill/knowledge]\"\n\nLESSON OUTLINE RULES:\n- Provide 3-6 bullet points per lesson\n- Cover: key concepts, examples/applications, and transitions to next lesson\n- Be specific enough to guide content creation\n\nPROCESS:\n1. FIRST: Query the vector store thoroughly to understand the full chapter\n2. THEN: Identify natural topic divisions and learning progression\n3. OPTIONALLY: Search web for pedagogical approaches or current context if beneficial\n4. FINALLY: Structure into 6-12 lessons with complete metadata\n\nOUTPUT RULES (CRITICAL — READ CAREFULLY):\nYou MUST output valid JSON matching the EXACT schema. Field names are case-sensitive and must match exactly.\n\nREQUIRED FIELD NAMES (USE THESE EXACTLY):\n- \"chapter_name\" (string)\n- \"total_lessons\" (integer, 6-12)\n- \"lessons\" (array of lesson objects)\n\nEACH LESSON OBJECT MUST CONTAIN EXACTLY THESE FIELDS:\n- \"lesson_number\" (integer, starting from 1)\n- \"lesson_title\" (string) — NOT \"title\", NOT \"name\"\n- \"lesson_outline\" (array of 3-6 strings) — NOT \"outline\", NOT \"outline_points\"\n- \"intended_learning_outcomes\" (array of 2-4 strings) — NOT \"learning_outcomes\", NOT \"outcomes\", NOT \"ILOs\"\n\nFORBIDDEN FIELD NAMES (DO NOT USE):\n- \"title\" — use \"lesson_title\"\n- \"outline\" — use \"lesson_outline\"\n- \"learning_outcomes\" — use \"intended_learning_outcomes\"\n- \"outcomes\" — use \"intended_learning_outcomes\"\n- \"ILOs\" — use \"intended_learning_outcomes\"\n- \"name\" — use \"lesson_title\"\n- Any field not listed in the schema\n\nVALIDATION CHECKLIST (VERIFY BEFORE OUTPUT):\n✓ chapter_name is present\n✓ total_lessons is between 6 and 12\n✓ lessons array has 6-12 items\n✓ Each lesson has lesson_number (sequential from 1)\n✓ Each lesson has lesson_title (NOT \"title\")\n✓ Each lesson has lesson_outline with 3-6 items (NOT \"outline\")\n✓ Each lesson has intended_learning_outcomes with 2-4 items (NOT \"learning_outcomes\")\n✓ No additional fields exist\n\nAny deviation from the exact field names is a critical failure.",
          "maxIterations": 15
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        3440,
        1648
      ],
      "id": "74c7c402-fd3c-4140-8733-a389bc5242c1",
      "name": "LessonPlannerAIAgent",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"name\": \"chapter_to_module\",\n  \"strict\": true,\n  \"schema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"chapter_name\": {\n        \"type\": \"string\",\n        \"description\": \"The chapter name being converted\"\n      },\n      \"total_lessons\": {\n        \"type\": \"integer\",\n        \"minimum\": 6,\n        \"maximum\": 12,\n        \"description\": \"Total number of lessons in this module (6-12)\"\n      },\n      \"lessons\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"lesson_number\": {\n              \"type\": \"integer\",\n              \"minimum\": 1,\n              \"description\": \"Sequential lesson number starting from 1\"\n            },\n            \"lesson_title\": {\n              \"type\": \"string\",\n              \"description\": \"Clear, specific title for the lesson\"\n            },\n            \"lesson_outline\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\"\n              },\n              \"minItems\": 3,\n              \"maxItems\": 6,\n              \"description\": \"3-6 bullet points covering key concepts and structure\"\n            },\n            \"intended_learning_outcomes\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\"\n              },\n              \"minItems\": 2,\n              \"maxItems\": 4,\n              \"description\": \"2-4 measurable learning outcomes using action verbs\"\n            }\n          },\n          \"required\": [\"lesson_number\", \"lesson_title\", \"lesson_outline\", \"intended_learning_outcomes\"],\n          \"additionalProperties\": false\n        },\n        \"minItems\": 6,\n        \"maxItems\": 12\n      }\n    },\n    \"required\": [\"chapter_name\", \"total_lessons\", \"lessons\"],\n    \"additionalProperties\": false\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        3552,
        1968
      ],
      "id": "e9ac4edf-65f7-444a-925e-81cb30d3cdcb",
      "name": "StructuredOutputParser_02"
    },
    {
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "typeVersion": 1,
      "position": [
        2176,
        1840
      ],
      "id": "8f7ce806-75f4-44d5-bf5b-9463f5d1f69f",
      "name": "CohereEmbeddings_01",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "typeVersion": 1,
      "position": [
        3168,
        2064
      ],
      "id": "188391e9-de6c-4d73-a9fc-4e07683c0e15",
      "name": "CohereEmbeddings_02",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "modelName": "rerank-english-v3.0",
        "topN": 10
      },
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "typeVersion": 1,
      "position": [
        3280,
        2064
      ],
      "id": "8ea5708b-ed2c-4fa7-b1da-23f5c211634a",
      "name": "CohereReranker_01",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolDescription": "Retrieves content from the current book chapter. Use this to understand the chapter material before designing lessons. Query multiple times with different search terms to ensure comprehensive coverage of all topics.",
        "qdrantCollection": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').item.json.constants.course_name }}",
          "mode": "id"
        },
        "topK": 30,
        "includeDocumentMetadata": false,
        "useReranker": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        3216,
        1904
      ],
      "id": "4e57ef5d-04df-452b-94ba-28c3e2fba463",
      "name": "QueryVectorStore_01",
      "credentials": {
        "qdrantApi": {
          "id": "f4OYPtbhAv74DCJ1",
          "name": "Qdrant API"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "U0A3JV13SKX",
          "mode": "list",
          "cachedResultName": "hesham"
        },
        "text": "=## ERROR ## ERROR ## ERROR ##\n\n## Workflow ##\n\nhttps://n8n.vps.betterbrainlab.org/workflow/{{ $workflow.id }}\n\n## ERROR ## ERROR ## ERROR ##\n",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -16,
        2032
      ],
      "id": "48f2623e-d3c8-44d4-aec3-3bfd058ea411",
      "name": "SlackErrorMessage_01",
      "webhookId": "ebcbd315-bc0c-483c-9933-cdf7aeeebd95",
      "credentials": {
        "slackOAuth2Api": {
          "id": "kMQbs66UgbBArT3U",
          "name": "Slack Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "U0A3JV13SKX",
          "mode": "list",
          "cachedResultName": "hesham"
        },
        "text": "=## ERROR ## ERROR ## ERROR ##\n\n## Workflow ##\n\nhttps://n8n.vps.betterbrainlab.org/workflow/{{ $workflow.id }}\n\n## ERROR ## ERROR ## ERROR ##\n",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        4144,
        1856
      ],
      "id": "e32fb6dc-e74f-46d1-a212-2624328a5657",
      "name": "SlackErrorMessage_02",
      "webhookId": "ebcbd315-bc0c-483c-9933-cdf7aeeebd95",
      "credentials": {
        "slackOAuth2Api": {
          "id": "kMQbs66UgbBArT3U",
          "name": "Slack Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "amount": 15
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        4160,
        2032
      ],
      "id": "74cb2240-4408-4dfc-a125-7fa7499b7c8e",
      "name": "Wait_02",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {
          "thinking": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        3408,
        1440
      ],
      "id": "bce96145-a8d8-429c-80fd-026a7c51b09c",
      "name": "AnthropicChat_01",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.lessons",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        3984,
        1632
      ],
      "id": "50900a72-20ea-4c06-b28e-503594caa310",
      "name": "SplitOut_03"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5f1417d7-cdae-410a-a88a-74b4b3e5b848",
              "name": "total lesson count",
              "value": "={{ $('LessonPlannerAIAgent').item.json.output.total_lessons }}",
              "type": "number"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        4144,
        1632
      ],
      "id": "8b1abe4a-3526-49a8-a640-d85dcdc6b344",
      "name": "EditFields_02"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_4 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_02').first().json.constants.Status_1 }}",
            "M": "={{ $('GetPDFChaptersFromGoogleSheet').first().json['Chapter Number'] }}",
            "L": "={{ $json.lesson_number }}",
            "Leson Title": "={{ $json.lesson_title || $json.title }}",
            "ILOs": "={{ $json.intended_learning_outcomes[0] }}{{ '\\n' }}{{ '\\n' }}{{ $json.intended_learning_outcomes[1] }}{{ '\\n' }}{{ '\\n' }}{{ $json.intended_learning_outcomes[2] }}{{ '\\n' }}{{ '\\n' }}{{ $json.intended_learning_outcomes[3] }}",
            "PDF_ID": "={{ $('GetPDFChaptersFromGoogleSheet').first().json['file_id'] }}",
            "Outline": "={{ $json.lesson_outline[0] }}{{ '\\n'}}{{ '\\n'}}{{ $json.lesson_outline[1] }}{{ '\\n'}}{{ '\\n'}}{{ $json.lesson_outline[2] }}{{ '\\n'}}{{ '\\n'}}{{ $json.lesson_outline[3] }}{{ '\\n'}}{{ '\\n'}}{{ $json.lesson_outline[4] }}",
            "Total Lesson Count": "={{ $json['total lesson count'] }}",
            "Chapter Title": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.Module.split('.pdf')[0] }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Lesson Count",
              "displayName": "Total Lesson Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Chapter Title",
              "displayName": "Chapter Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Leson Title",
              "displayName": "Leson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ILOs",
              "displayName": "ILOs",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Outline",
              "displayName": "Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC NARRATION",
              "displayName": "QC NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "PDF_ID",
              "displayName": "PDF_ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        4384,
        1632
      ],
      "id": "687ebfaa-9245-4435-a3ab-a5b2062009d6",
      "name": "AppendLessonListOutlines",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_4 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_02').first().json.constants.Status_8 }}",
            "M": "={{ $('GlobalConstants_02').first().json.constants.Status_8 }}",
            "L": "={{ $('GlobalConstants_02').first().json.constants.Status_8 }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Lesson Count",
              "displayName": "Total Lesson Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Title",
              "displayName": "Chapter Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Leson Title",
              "displayName": "Leson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ILOs",
              "displayName": "ILOs",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Outline",
              "displayName": "Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC NARRATION",
              "displayName": "QC NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PDF_ID",
              "displayName": "PDF_ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        4608,
        1632
      ],
      "id": "bc3a0390-bf36-4b25-9f45-f01e9333ad4b",
      "name": "AppendSTOPRow_02",
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_4 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $('GlobalConstants_07').first().json.constants.Status_1 }}"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3760,
        3616
      ],
      "id": "5722f761-4356-4af1-bca5-2bb1f12921b3",
      "name": "GetLessonOutlineListFromGoogleSheet",
      "executeOnce": true,
      "retryOnFail": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -3392,
        3616
      ],
      "id": "6aa6dd81-f225-4a04-b6b2-a273e216bed0",
      "name": "LoopOverItems_01"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_07').first().json.constants.Status_7 }}",
            "row_number": "={{ $json.row_number }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "file_id",
              "displayName": "file_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module",
              "displayName": "Module",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Verdict",
              "displayName": "Verdict",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3008,
        3600
      ],
      "id": "80f8c2fa-77a9-4f1d-bf3d-2671da9f46dd",
      "name": "UpdateGoogleSheetRow_01",
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_07').first().json.constants.Status_8 }}",
            "M": "={{ $('GlobalConstants_07').first().json.constants.Status_8 }}",
            "L": "={{ $('GlobalConstants_07').first().json.constants.Status_8 }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -2816,
        3600
      ],
      "id": "14f8fadc-b1a9-4fe1-9884-921639a075c9",
      "name": "AppendSTOPRow_03",
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5678/webhook/59796ba8-e1b4-4592-b39d-90f345b33f67",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -2640,
        3600
      ],
      "id": "0b3ac440-b1b3-4237-8cae-fcae1190c295",
      "name": "ActivateWebhook_02",
      "executeOnce": true
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2800,
        3904
      ],
      "id": "83eab0ae-84ce-48eb-97a6-90122a344788",
      "name": "RandomStringGenerator_02"
    },
    {
      "parameters": {
        "jsCode": "// Define all possible opening styles WITHOUT examples\nconst openingStyles = [\n  {\n    style: \"direct_statement\",\n    instruction: \"Start with a bold, clear statement of fact or assertion. Make it attention-grabbing and relevant to the lesson topic. Do NOT use questions or 'imagine' phrases.\"\n  },\n  {\n    style: \"question\",\n    instruction: \"Open with an engaging, thought-provoking question that makes the viewer curious about the topic. Avoid cliché openings like 'Have you ever' or 'What if'.\"\n  },\n  {\n    style: \"story\",\n    instruction: \"Begin with a brief narrative, anecdote, or historical moment that relates to the lesson. Use specific, vivid details to draw the viewer in.\"\n  },\n  {\n    style: \"surprising_fact\",\n    instruction: \"Lead with an unexpected, attention-grabbing statistic or truth that relates to the lesson. Make it concrete, specific, and genuinely surprising.\"\n  },\n  {\n    style: \"problem_statement\",\n    instruction: \"Present a clear problem, challenge, or limitation that the lesson will address. Frame it as a struggle or obstacle worth overcoming.\"\n  },\n  {\n    style: \"personal_address\",\n    instruction: \"Speak directly to the viewer's experience, knowledge, or situation. Connect the lesson topic to something they likely already know or have encountered.\"\n  },\n  {\n    style: \"contrast\",\n    instruction: \"Compare two different approaches, methods, eras, or concepts to highlight a key difference. Show the distinction between old and new, simple and complex, or two competing ideas.\"\n  },\n  {\n    style: \"action_oriented\",\n    instruction: \"Invite immediate engagement or exploration of the topic. Use active, dynamic language that creates momentum from the first sentence.\"\n  },\n  {\n    style: \"scenario_based\",\n    instruction: \"Start with a concrete real-world situation, use case, or application of the lesson concept. Paint a vivid picture of the context where this matters.\"\n  },\n  {\n    style: \"historical_context\",\n    instruction: \"Begin with relevant background, evolution, or the journey that led to this concept. Use temporal framing to show how ideas developed over time.\"\n  }\n];\n\n// Randomly select one style\nconst randomIndex = Math.floor(Math.random() * openingStyles.length);\nconst selectedOpening = openingStyles[randomIndex];\n\n// Get the input data\nconst inputData = items[0].json;\n\n// Add the opening style instruction to the data\nreturn [{\n  json: {\n    ...inputData,\n    opening_style: selectedOpening.style,\n    opening_instruction: selectedOpening.instruction,\n    opening_style_full_name: selectedOpening.style.replace(/_/g, ' ')\n  }\n}];\n```\n\n## Why This Is Better\n\n**Forces creativity:**\n- No templates to copy\n- AI must interpret the style freshly for each script\n- Each direct statement will be genuinely different\n- Each question will be uniquely phrased\n\n**Prevents new patterns:**\n- Can't fall back on \"Neural networks changed...\"\n- Can't reuse \"What makes X better than Y?\"\n- Must create original openings every time\n\n**Maintains variety:**\n- Style descriptions are clear enough to guide\n- Vague enough to allow infinite variations\n- AI still knows what kind of opening to create\n\n## Comparison\n\n### ❌ **With Examples (Bad):**\n```\ninstruction: \"Start with a bold statement. Example: 'Neural networks revolutionized AI in 2012.'\"\n```\n**Result:** Scripts might start with:\n- \"Deep learning revolutionized computer vision in 2015.\"\n- \"Transformers revolutionized NLP in 2017.\"\n- \"Neural networks revolutionized medicine in 2020.\"\n*Same template, just different words!*\n\n### ✅ **Without Examples (Good):**\n```\ninstruction: \"Start with a bold, clear statement of fact or assertion.\""
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2608,
        3904
      ],
      "id": "10650fca-358b-422e-90f3-1f60cef29bdd",
      "name": "RandomOpeningSelector"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Module: {{ $('LoopOverItems_01').item.json['Chapter Title'] }}\nLesson Title: {{ $('LoopOverItems_01').item.json['Leson Title'] }}\nLesson Outline: {{ $('LoopOverItems_01').item.json.Outline }}\nIntended Learning Outcomes: {{ $('LoopOverItems_01').item.json.ILOs }}\n\nOPENING STYLE INSTRUCTION:\n{{ $('RandomOpeningSelector').item.json.opening_instruction }}\n\nRECENT OPENINGS TO AVOID:\n{{ $json.propertyName }}\n\nWrite a 1500-1800 word teleprompter-ready script for this lesson.",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are a Professional Course Scriptwriter specializing in certification exam preparation courses for platforms like Udemy.\n\nYOUR TASK:\nTransform chapter content from the vector store into a single, teleprompter-ready lesson script based on the provided Lesson Title, Outline, and Intended Learning Outcomes.\n\nSCRIPT SPECIFICATIONS:\n- Length: 1500-1800 words (10-12 minutes at 150 words/minute)\n- Format: Pure flowing prose, zero formatting\n- Delivery: Teleprompter-ready narration\n\nSTRICT FORMATTING RULES:\n- NO bullet points, numbered lists, or visual formatting\n- NO section headers or titles within the script\n- NO emojis, symbols, or special characters\n- NO parenthetical asides or bracketed content\n- NO \"Note:\" or \"Important:\" callouts\n- NO references to visuals (\"see below\", \"as shown above\")\n- Convert any list to flowing sentences (\"There are three key aspects. First... Second... Third...\")\n\nWRITING VOICE:\n- Address the viewer directly (\"you'll learn\", \"let's explore\")\n- Use natural conversational transitions (\"Now, let's look at...\", \"Here's the thing...\")\n- Vary sentence length for natural rhythm\n- Use contractions naturally (you'll, we're, it's)\n- Embed rhetorical questions naturally in prose\n- Build momentum through storytelling and woven examples\n\nREQUIRED CONTENT ELEMENTS:\n1. Opening: Follow the assigned opening style instruction exactly — do NOT default to \"Imagine this\" or \"Picture this\"\n2. Core Content: Cover all ILOs with explanations, examples, and exam tips interspersed naturally\n3. Practical Examples & Exam Tips: Weave 2-4 real-world scenarios or exam-style insights throughout (not stuffed at the end)\n4. Knowledge Check: End with 1-2 quick review questions embedded naturally in the narration\n5. Closing: Smooth transition to next lesson or module wrap-up\n\nOPENING RULES (CRITICAL):\n- You MUST follow the opening style instruction provided in the user message\n- Your opening MUST be completely different from all recent openings listed\n- If your opening resembles any recent opening in phrasing, structure, or pattern, rewrite it\n\nTOOL USAGE PRIORITY:\n1. Vector Store (5-10 queries): Primary source — retrieve chapter content, verify facts, find explanations\n2. Web Search (0-4 queries): Current statistics, modern examples, recent developments only\n\nPROCESS:\n1. Query vector store thoroughly to understand the lesson content\n2. Plan the narrative arc based on the Outline and ILOs\n3. Write the full script as continuous flowing prose\n4. Count words — must be 1500-1800\n5. Verify opening follows assigned style AND differs from recent openings\n6. Read mentally for natural speech rhythm\n7. Final check: no formatting, no bullets, teleprompter-ready\n\nOUTPUT RULES (CRITICAL — READ CAREFULLY):\n- You MUST output valid JSON matching the EXACT schema provided\n- You MUST wrap all output fields inside an \"output\" object\n- You MUST NOT add ANY fields beyond those specified in the schema\n- You MUST NOT include: \"tip\", \"explanation\", \"key_takeaways\", \"summary\", \"notes\", or ANY other fields\n- The ONLY permitted fields are: module_title, lesson_title, word_count, estimated_duration_minutes, opening_style_used, narration_script, practical_examples_and_exam_tips, knowledge_check_questions\n- practical_examples_and_exam_tips MUST be an array of 2-4 simple strings, NOT objects\n- knowledge_check_questions MUST be an array of 1-2 simple strings, NOT objects\n- word_count MUST be between 1500 and 1800\n- Any deviation from this schema is a critical failure",
          "maxIterations": 15,
          "returnIntermediateSteps": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -1888,
        3904
      ],
      "id": "b5c5ad0b-38ae-4f65-96a0-b0da315022b9",
      "name": "ScriptwritingAIAgent",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "get",
        "key": "={{ $('GlobalConstants_07').first().json.constants.redis_db1 }}",
        "keyType": "string",
        "options": {}
      },
      "type": "n8n-nodes-base.redis",
      "typeVersion": 1,
      "position": [
        -2368,
        3904
      ],
      "id": "47a4efae-cd9d-4ef4-abda-0e7210c83a8f",
      "name": "RecentOpeningsUsedSelector",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {
          "temperature": 0.9,
          "topP": 0.8
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1776,
        4224
      ],
      "id": "d2fd6876-cbf1-49f3-8af0-3952a120a28f",
      "name": "MistralCloud_05",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {
          "temperature": 0.7,
          "topP": 0.9
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1824,
        3568
      ],
      "id": "23fd5dbf-9019-4b5b-b5d6-eecf68492c28",
      "name": "MistralCloud_06",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1600,
        3104
      ],
      "id": "5486d501-77db-45c3-90bf-6c7a9b3372bb",
      "name": "MistralCloud_07",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -1424,
        3248
      ],
      "id": "34ae5e06-da0b-46d7-8487-ae0ac3e932a8",
      "name": "MistralCloud_08",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "pixtral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -96,
        3168
      ],
      "id": "1bb9484d-e261-45c0-a0f4-31f849157807",
      "name": "MistralCloud_09",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "pixtral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        -240,
        3168
      ],
      "id": "a6bcc220-9719-497e-b128-9b2b62a38066",
      "name": "MistralCloud_10",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "pixtral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        1056,
        3184
      ],
      "id": "9b92360c-3b77-435f-a65d-615c00886bd9",
      "name": "MistralCloud_11",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "pixtral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        1216,
        3184
      ],
      "id": "a5b729ce-1d01-4eeb-b181-1a0b7d07e430",
      "name": "MistralCloud_12",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-sonnet-4-5-20250929",
          "mode": "list",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {
          "temperature": 0.7
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        -1888,
        3744
      ],
      "id": "9b5d8137-7584-41e7-9007-b92ec0190148",
      "name": "AnthropicChat_02",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-sonnet-4-20250514",
          "mode": "list",
          "cachedResultName": "Claude Sonnet 4"
        },
        "options": {
          "thinking": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        -1536,
        2656
      ],
      "id": "44fe9963-362c-4f1b-95c8-0c545c60318a",
      "name": "AnthropicChat_03",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-sonnet-4-5-20250929",
          "mode": "list",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {
          "thinking": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        -336,
        2768
      ],
      "id": "e501aa77-ae45-4d8a-9ceb-d3bd27276e89",
      "name": "AnthropicChat_04",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-haiku-4-5-20251001",
          "mode": "list",
          "cachedResultName": "Claude Haiku 4.5"
        },
        "options": {
          "thinking": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        1040,
        2768
      ],
      "id": "a4f71371-59cc-40df-b0a3-82d91e540416",
      "name": "AnthropicChat_05",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "sessionTTL": 7200,
        "contextWindowLength": 15
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        3536,
        1504
      ],
      "id": "0912e475-f2af-442d-b4d0-f3da4e5e76a1",
      "name": "Memory_01",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('RandomStringGenerator_02').item.json.randomString }}",
        "sessionTTL": 7200,
        "contextWindowLength": 18
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        -1584,
        3728
      ],
      "id": "18b21266-1c63-4df0-9217-d47c4a1bb993",
      "name": "Memory_02",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "operation": "set",
        "key": "={{ $('GlobalConstants_07').first().json.constants.redis_db1 }}",
        "value": "={{ JSON.stringify($json.updated_openings_array) }}",
        "keyType": "string",
        "expire": true,
        "ttl": 2592000
      },
      "type": "n8n-nodes-base.redis",
      "typeVersion": 1,
      "position": [
        -992,
        3888
      ],
      "id": "cbd592d2-89f6-4b54-97cc-c87244cb35b6",
      "name": "RedisOpeningsDB",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Extract the rewritten script from the AI Agent node\n\nconst script = $('ScriptwritingAIAgent').first().json.output.narration_script;\n\n// Get first 15 words (or first sentence if shorter)\nconst words = script.trim().split(/\\s+/);\nlet opening = '';\n\nif (words.length <= 15) {\n  // If script is very short, take it all\n  opening = script;\n} else {\n  // Take first 15 words\n  opening = words.slice(0, 15).join(' ');\n  \n  // If it doesn't end with punctuation, find the end of the sentence\n  if (!opening.match(/[.!?]$/)) {\n    // Find first sentence ending within first 25 words\n    const extendedWords = words.slice(0, 25).join(' ');\n    const sentenceMatch = extendedWords.match(/^[^.!?]+[.!?]/);\n    \n    if (sentenceMatch) {\n      opening = sentenceMatch[0];\n    } else {\n      // Just add ellipsis if no sentence end found\n      opening = opening + '...';\n    }\n  }\n}\n\n// Get the existing recent openings array from current input\nlet recentOpenings = $json.recent_openings_array || [];\n\n// Add this new opening to the start of the array\nrecentOpenings.unshift(opening);\n\n// Keep only the last 20 openings\nif (recentOpenings.length > 20) {\n  recentOpenings = recentOpenings.slice(0, 20);\n}\n\n// Pass everything forward\nreturn {\n  json: {\n    ...$json,\n    current_opening: opening,\n    updated_openings_array: recentOpenings\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1152,
        3888
      ],
      "id": "731f41b7-cb4f-46bd-9109-8c25745083e6",
      "name": "ScriptOpeningExtractor"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_07').first().json.constants.Status_4 }}",
            "M": "={{ $('LoopOverItems_01').item.json.M }}",
            "L": "={{ $('LoopOverItems_01').item.json.L }}",
            "NARRATION": "={{ $('ScriptwritingAIAgent').item.json.output.narration_script }}",
            "opening_style_used": "={{ $('ScriptwritingAIAgent').item.json.output.opening_style_used }}",
            "practical_examples_and_exam_tips": "={{ $('ScriptwritingAIAgent').item.json.output.practical_examples_and_exam_tips }}",
            "knowledge_check_questions": "={{ $('ScriptwritingAIAgent').item.json.output.knowledge_check_questions }}",
            "Module Title": "={{ $('ScriptwritingAIAgent').item.json.output.module_title }}",
            "Lesson Title": "={{ $('ScriptwritingAIAgent').item.json.output.lesson_title }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1520,
        3888
      ],
      "id": "1b42ec8a-56c8-4315-82df-bd4c6f47c38d",
      "name": "AppendLessonScriptDetailed",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_4 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_07').first().json.constants.Status_9 }}",
            "row_number": "={{ $('LoopOverItems_01').item.json.row_number }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Total Lesson Count",
              "displayName": "Total Lesson Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Title",
              "displayName": "Chapter Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Leson Title",
              "displayName": "Leson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ILOs",
              "displayName": "ILOs",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Outline",
              "displayName": "Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC NARRATION",
              "displayName": "QC NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PDF_ID",
              "displayName": "PDF_ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1136,
        4160
      ],
      "id": "107504db-2db6-4638-a440-bb59fb4746b1",
      "name": "GoogleSheetErrorUpdate_01",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetGeneratedVideoScripts').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_03').first().json.constants.Status_9 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1120,
        3232
      ],
      "id": "4337117c-c01c-45ce-941c-334dc4c036de",
      "name": "GoogleSheetErrorUpdate_02",
      "retryOnFail": true,
      "executeOnce": false,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "sessionTTL": 7200,
        "contextWindowLength": 12
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        -1328,
        2672
      ],
      "id": "e885003e-613d-46c1-b457-6c9794efe73e",
      "name": "Memory_03",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 20
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1200,
        2752
      ],
      "id": "67267627-8d78-4b36-a97e-1f19f5442f6f",
      "name": "Memory_04"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetGeneratedVideoScripts').first().json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_03').first().json.constants.Status_9 }}",
            "QC_PASS": "={{ $('GlobalConstants_03').first().json.constants.Status_9 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1904,
        2608
      ],
      "id": "4fa81c18-e718-4b1b-8168-a470dcf8da10",
      "name": "GoogleSheetErrorUpdate_03",
      "retryOnFail": true,
      "executeOnce": false,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2752,
        3088
      ],
      "id": "4ff034f3-8005-4954-9d4c-76d2020c3e81",
      "name": "Wait_03",
      "webhookId": "72a03133-990c-4472-a5d0-28cbf25d3433",
      "executeOnce": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5678/webhook/59796ba8-e1b4-4592-b39d-90f345b33f67",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        3008,
        3088
      ],
      "id": "17eb4e63-11f0-4e34-a722-f346310a3430",
      "name": "ActivateWebhook_03",
      "executeOnce": true
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 22
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -112,
        2768
      ],
      "id": "dced1f3e-8482-4368-b280-d02eb9b0bf1c",
      "name": "Memory_06"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        944,
        2896
      ],
      "id": "370e7b5b-e928-4af7-96d1-ba82bfb79b07",
      "name": "RandomStringGenerator_03"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -432,
        2912
      ],
      "id": "d90eb781-6391-4b4f-945f-81dfce4227da",
      "name": "RandomStringGenerator_04"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1824,
        2896
      ],
      "id": "bbd23607-3acc-4e70-aa9d-e7944413af46",
      "name": "RandomStringGenerator_05"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolDescription": "Retrieves content from the course textbook/guide. Use this as your primary source for lesson content. Query 5-10 times with different terms to ensure comprehensive coverage of the lesson topic.",
        "qdrantCollection": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.course_name }}",
          "mode": "id"
        },
        "topK": 25,
        "includeDocumentMetadata": false,
        "useReranker": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        -2080,
        4096
      ],
      "id": "0fe502d4-bfc6-4fac-9799-29c53a99cca8",
      "name": "QueryVectorStore_02",
      "credentials": {
        "qdrantApi": {
          "id": "f4OYPtbhAv74DCJ1",
          "name": "Qdrant API"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"name\": \"lesson_script\",\n  \"strict\": true,\n  \"schema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"output\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"module_title\": {\n            \"type\": \"string\",\n            \"description\": \"The chapter/module this lesson belongs to — copy exactly from user input\"\n          },\n          \"lesson_title\": {\n            \"type\": \"string\",\n            \"description\": \"The title of this lesson — copy exactly from user input\"\n          },\n          \"word_count\": {\n            \"type\": \"integer\",\n            \"minimum\": 1500,\n            \"maximum\": 1800,\n            \"description\": \"Total word count of narration_script (must be 1500-1800)\"\n          },\n          \"estimated_duration_minutes\": {\n            \"type\": \"number\",\n            \"minimum\": 10,\n            \"maximum\": 12,\n            \"description\": \"Estimated narration time in minutes (word_count / 150)\"\n          },\n          \"opening_style_used\": {\n            \"type\": \"string\",\n            \"description\": \"Brief description of the opening style applied\"\n          },\n          \"narration_script\": {\n            \"type\": \"string\",\n            \"description\": \"Complete teleprompter-ready script as continuous flowing prose with zero formatting\"\n          },\n          \"practical_examples_and_exam_tips\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"minItems\": 2,\n            \"maxItems\": 4,\n            \"description\": \"2-4 practical examples or exam tips as simple strings only\"\n          },\n          \"knowledge_check_questions\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"minItems\": 1,\n            \"maxItems\": 2,\n            \"description\": \"1-2 knowledge check questions as simple strings only\"\n          }\n        },\n        \"required\": [\n          \"module_title\",\n          \"lesson_title\",\n          \"word_count\",\n          \"estimated_duration_minutes\",\n          \"opening_style_used\",\n          \"narration_script\",\n          \"practical_examples_and_exam_tips\",\n          \"knowledge_check_questions\"\n        ],\n        \"additionalProperties\": false\n      }\n    },\n    \"required\": [\"output\"],\n    \"additionalProperties\": false\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1776,
        4064
      ],
      "id": "614892f3-7f7c-4842-be90-00fcd116b175",
      "name": "StructuredOutputParser_03"
    },
    {
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "typeVersion": 1,
      "position": [
        -2080,
        4224
      ],
      "id": "2c6865ec-bcc2-4b36-82c4-d35be5f5aa5a",
      "name": "CohereEmbeddings_03",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "modelName": "rerank-english-v3.0",
        "topN": 12
      },
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "typeVersion": 1,
      "position": [
        -2048,
        3968
      ],
      "id": "b51a88e5-8ab2-4b46-a2ee-0e8b116016bc",
      "name": "CohereReranker_02",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_4 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_07').first().json.constants.Status_7 }}",
            "row_number": "={{ $('LoopOverItems_01').item.json.row_number }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Total Lesson Count",
              "displayName": "Total Lesson Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Title",
              "displayName": "Chapter Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Leson Title",
              "displayName": "Leson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ILOs",
              "displayName": "ILOs",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Outline",
              "displayName": "Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC NARRATION",
              "displayName": "QC NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PDF_ID",
              "displayName": "PDF_ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1344,
        3888
      ],
      "id": "952116d1-7fa3-4caf-919c-2e0d5d7f6b09",
      "name": "UpdateGoogleSheet_02",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.row_number }}",
            "Verdict": "={{ $json.output.classification }}",
            "STATUS": "={{ $('GlobalConstants_02').first().json.constants.Status_10 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "file_id",
              "displayName": "file_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module",
              "displayName": "Module",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Verdict",
              "displayName": "Verdict",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -896,
        1584
      ],
      "id": "7e355f85-e59a-46ee-a360-8cc328ee8dac",
      "name": "UpdateGoogleSheet_01",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "content": "# Scriptwriting Maverick\n\n## Converts lesson titles, outlines, and ILOs into polished 10-12 minute narration scripts. Uses vector store retrieval and optional web search to ensure accuracy and relevance. Generates unique openings based on style instructions and avoids repetition across lessons. Produces teleprompter-ready prose with interspersed exam tips and closing knowledge checks.",
        "height": 368,
        "width": 672,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3088,
        4128
      ],
      "typeVersion": 1,
      "id": "acdd9425-1d4d-4f72-8a71-4c395b7b3627",
      "name": "Sticky Note23"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "59796ba8-e1b4-4592-b39d-90f345b33f67",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2976,
        2880
      ],
      "id": "d4ff86a2-26df-4b7f-9371-5161f263a44d",
      "name": "Webhook_02",
      "webhookId": "59796ba8-e1b4-4592-b39d-90f345b33f67"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -2432,
        2880
      ],
      "id": "a9a2b68d-fb50-4ed1-aa85-86c4c1196542",
      "name": "GlobalConstants_03",
      "executeOnce": true,
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"pass_fail\": {\n      \"type\": \"string\",\n      \"enum\": [\"PASS\", \"FAIL\"]\n    },\n    \"overall_score\": {\n      \"type\": \"integer\",\n      \"minimum\": 1,\n      \"maximum\": 10\n    },\n    \"overall_feedback\": {\n      \"type\": \"string\"\n    },\n    \"areas_for_improvement\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"criterion_feedback\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"criterion\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"clarity_comprehension\",\n              \"engagement_retention\",\n              \"structure_flow\",\n              \"educational_effectiveness\",\n              \"production_readiness\",\n              \"tone_delivery\"\n            ]\n          },\n          \"score\": {\n            \"type\": \"integer\",\n            \"minimum\": 1,\n            \"maximum\": 10\n          },\n          \"feedback\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\"criterion\", \"score\", \"feedback\"],\n        \"additionalProperties\": false\n      },\n      \"minItems\": 6,\n      \"maxItems\": 6\n    }\n  },\n  \"required\": [\n    \"pass_fail\",\n    \"overall_score\",\n    \"overall_feedback\",\n    \"areas_for_improvement\",\n    \"criterion_feedback\"\n  ],\n  \"additionalProperties\": false\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1424,
        3104
      ],
      "id": "3aaf381f-1a0f-45cd-9865-68de7c8755f7",
      "name": "StructuredOutputParser_05"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetGeneratedVideoScripts').item.json.row_number }}",
            "QC_PASS": "=QC_{{ $json.output.pass_fail }}",
            "AI NOTES": "=Overall Score: {{ $json.output.overall_score }}{{ \"\\n\" }}{{ \"\\n\" }}Overall Assessment: {{ $json.output.overall_feedback }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1024,
        2608
      ],
      "id": "4010903c-16df-4b7d-97c0-5486756df784",
      "name": "UpdateGoogleSheet_03",
      "retryOnFail": true,
      "executeOnce": false,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -944,
        3232
      ],
      "id": "bb4e06ab-11cd-459a-a1c2-acfdb9095fbe",
      "name": "Wait_04",
      "webhookId": "181cc694-577c-4cc1-a603-673759b07967",
      "executeOnce": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5678/webhook/59796ba8-e1b4-4592-b39d-90f345b33f67",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -752,
        3232
      ],
      "id": "5942ac07-9556-4e46-a2d0-564067a34038",
      "name": "ActivateWebhook_04",
      "executeOnce": true
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.QC_PASS }}",
                    "rightValue": "QC_PASS",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "1ad64539-52f2-4752-841e-a39707210a85"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "QC_PASS"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "f8acb959-298a-408a-aa70-4f2e3445e355",
                    "leftValue": "={{ $json.QC_PASS }}",
                    "rightValue": "QC_",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ERROR"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4c36bde3-3b5a-47b3-96b0-db3fd0b45d0d",
                    "leftValue": "={{ $json.QC_PASS }}",
                    "rightValue": "QC_FAIL",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "QC_FAIL"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -752,
        2592
      ],
      "id": "fedc1f45-2244-40ee-86bc-4fccd46eb825",
      "name": "SwitchBoard_01"
    },
    {
      "parameters": {
        "content": "# Script QC Evaluation\n\n## AI reviewer assesses each script against quality standards and lesson requirements. Checks word count, ILO coverage, formatting compliance, and opening uniqueness. Flags scripts that need revision and identifies specific areas for improvement. Only scripts meeting all criteria proceed to final output.",
        "height": 288,
        "width": 784,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        3168
      ],
      "typeVersion": 1,
      "id": "c922a830-e542-456b-b2a3-6e9677214ee9",
      "name": "Sticky Note24"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Here is the script:\n\n{{ $('GetGeneratedVideoScripts').item.json.NARRATION }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are an expert video script evaluator specializing in online educational content. Your role is to provide thorough, constructive appraisals of video scripts for online courses.\n\nEVALUATION CRITERIA:\n\n1. CLARITY & COMPREHENSION\n- Is the content easy to understand for the target audience?\n- Are concepts explained clearly with appropriate examples?\n- Is technical jargon either avoided or properly explained?\n\n2. ENGAGEMENT & RETENTION\n- Does the script capture and maintain viewer attention?\n- Are there hooks, questions, or engagement techniques used?\n- Is the pacing appropriate (not too fast or too slow)?\n\n3. STRUCTURE & FLOW\n- Does the script follow a logical progression?\n- Are transitions between topics smooth and natural?\n- Is there a clear introduction, body, and conclusion?\n\n4. EDUCATIONAL EFFECTIVENESS\n- Are learning objectives clear and achievable?\n- Is information presented in a pedagogically sound manner?\n- Are there opportunities for knowledge application or practice?\n\n5. PRODUCTION READINESS\n- Is the script written in a conversational, spoken style?\n- Are visual cues or on-screen elements properly indicated?\n- Is the length appropriate for the content (typically 5-15 minutes)?\n\n6. TONE & DELIVERY\n- Is the tone appropriate for the subject and audience?\n- Does the script sound natural when read aloud?\n- Is it free from awkward phrasing or overly formal language?\n\nPASS/FAIL CRITERIA:\n- PASS: Overall score ≥ 7/10, no critical issues present, educational effectiveness ≥ 7/10\n- FAIL: Overall score < 7/10, OR critical issues present, OR educational effectiveness < 7/10\n\nEVALUATION APPROACH:\n- Be constructive and specific in your feedback\n- Rate each dimension on a scale of 1-10\n- Identify key areas for improvement\n- Provide clear, actionable feedback for each criterion\n- Deliver an overall assessment that summarizes the script's quality\n\nOUTPUT REQUIREMENTS:\n- Provide evaluation in valid JSON format only\n- Use the exact field names specified in the schema\n- The criterion_feedback array must contain exactly 6 objects with these criterion values: \"clarity_comprehension\", \"engagement_retention\", \"structure_flow\", \"educational_effectiveness\", \"production_readiness\", \"tone_delivery\"\n- pass_fail must be either \"PASS\" or \"FAIL\"\n- All scores must be integers between 1 and 10"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -1536,
        2896
      ],
      "id": "7f63f124-a455-4b61-8a71-ca3f282c88e0",
      "name": "VideoScriptAIEvaluator",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "4a937b1b-d266-4f17-a812-a0280f5e961f",
              "leftValue": "={{ $json.STATUS }}",
              "rightValue": "={{ $('GlobalConstants_03').first().json.constants.Status_8 }}",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -2080,
        2880
      ],
      "id": "24411831-3642-47fc-9e47-073af4e90d40",
      "name": "If_05"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $json.constants.Status_4 }}"
            },
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $json.constants.Status_8 }}"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -2240,
        2880
      ],
      "id": "be9cfc43-0417-4653-a13d-a876f40a9d31",
      "name": "GetGeneratedVideoScripts",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 2,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        224,
        3040
      ],
      "id": "144d8087-faaf-4db4-b9cc-31b72993865c",
      "name": "If_06"
    },
    {
      "parameters": {
        "amount": 60
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        512,
        3120
      ],
      "id": "cd076035-6a37-4329-bf05-76a0f009b754",
      "name": "Wait_06",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Here is the script:\n\n{{ $('GetGeneratedVideoScripts').item.json['NARRATION'] }}\n\nFeedback:\n\n{{ $('UpdateGoogleSheet_03').item.json['AI NOTES'] }}\n\nRevise the script to address all feedback while maintaining teleprompter-ready format.",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are a Script Revision Specialist. Your task is to rewrite and improve course narration scripts based on provided feedback.\n\nYOUR TASK:\n1. Analyze the original script and the feedback provided\n2. Apply all feedback points to produce an improved version\n3. Maintain the original script's core content and learning objectives\n4. Preserve the teleprompter-ready format\n\nREVISION RULES:\n- Address every piece of feedback provided\n- Maintain word count within 1500-1800 words unless feedback specifies otherwise\n- Preserve factual accuracy — do not invent new technical claims\n- Keep the same lesson structure unless feedback requires reorganization\n\nFORMATTING RULES (PRESERVE):\n- NO bullet points, numbered lists, or visual formatting\n- NO section headers or titles within the script\n- NO emojis, symbols, or special characters\n- Continuous flowing prose only\n- Teleprompter-ready output\n\nWRITING QUALITY:\n- Improve clarity and flow where possible\n- Tighten verbose passages\n- Enhance transitions between ideas\n- Strengthen opening and closing if weak\n- Make language more engaging while maintaining professionalism\n\nOUTPUT RULES (STRICT):\n- Output valid JSON matching the exact schema provided\n- List every change made in the changes_made array\n- Confirm each feedback point was addressed in feedback_addressed array"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -208,
        2912
      ],
      "id": "8ec66224-58f8-4e44-9064-aa9579293e00",
      "name": "RewriterAIAgent",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetGeneratedVideoScripts').item.json.row_number }}",
            "NARRATION": "={{ $json.output.revised_script }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        400,
        2896
      ],
      "id": "ce813787-b08c-4d19-b045-7c13944ac048",
      "name": "UpdateRowRevisedScript",
      "retryOnFail": true,
      "executeOnce": false,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "U0A3JV13SKX",
          "mode": "list",
          "cachedResultName": "hesham"
        },
        "text": "=## ERROR ## ERROR ## ERROR ##\n\n## Workflow ##\n\nhttps://n8n.vps.betterbrainlab.org/workflow/{{ $workflow.id }}\n\n## ERROR ## ERROR ## ERROR ##\n",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        480,
        3408
      ],
      "id": "e7b4df08-14a6-45e6-a45a-2dcd41a278a7",
      "name": "SlackErrorMessage_03",
      "webhookId": "ebcbd315-bc0c-483c-9933-cdf7aeeebd95",
      "credentials": {
        "slackOAuth2Api": {
          "id": "kMQbs66UgbBArT3U",
          "name": "Slack Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "height": 1184,
        "width": 1296,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        2544
      ],
      "typeVersion": 1,
      "id": "5c213352-564a-43d6-bc9b-a2bda9f73e9e",
      "name": "Sticky Note11"
    },
    {
      "parameters": {
        "content": "# Script Revision\n\n## Catches scripts that fail evaluation and rewrites them based on feedback. Addresses identified issues while preserving core content and lesson structure. Maintains teleprompter-ready formatting and word count requirements. Revised scripts loop back through evaluation until they pass.",
        "height": 320,
        "width": 640,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        3360
      ],
      "typeVersion": 1,
      "id": "2ed64e60-b66f-439c-8d27-7f1b394ffeb3",
      "name": "Sticky Note25"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 160,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4112,
        1824
      ],
      "typeVersion": 1,
      "id": "31ed76cc-2297-4726-ba50-65d22741a647",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 160,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        3184
      ],
      "typeVersion": 1,
      "id": "520ce3dd-e24e-4a29-a41b-525fa7fe6b83",
      "name": "Sticky Note12"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 752,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3056,
        2832
      ],
      "typeVersion": 1,
      "id": "32896839-d2d3-450d-a855-2f6270039a20",
      "name": "Sticky Note13"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 160,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        3360
      ],
      "typeVersion": 1,
      "id": "9623cfc4-3a95-401d-ba18-4e7085161091",
      "name": "Sticky Note14"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Here is the script:\n\n{{ $('GetGeneratedVideoScripts').item.json['NARRATION'] }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are a script segmentation specialist. Your ONLY job is to split a script into segments at natural breakpoints. You must preserve the original text EXACTLY.\n\nCRITICAL RULES - READ CAREFULLY:\n\nRULE 1: ZERO EDITING ALLOWED\n- DO NOT rephrase, reword, paraphrase, or summarize ANY part of the script\n- DO NOT fix grammar, spelling, or punctuation\n- DO NOT improve sentence structure or clarity\n- DO NOT remove redundancies or repetition\n- The ONLY changes allowed: Remove the literal string \"/n\" (not actual line breaks), remove zero-width characters, remove duplicate spaces, trim leading/trailing whitespace\n- This is a SPLITTING task, not a writing task\n\nRULE 2: WORD COUNT MUST MATCH\n- Count words in the original input script\n- After segmentation, count words across all segments combined\n- These counts MUST be equal (within 1-2 words for whitespace handling)\n- If word counts don't match, you have edited the text - THIS IS FORBIDDEN\n\nRULE 3: SEGMENT AT NATURAL BREAKPOINTS ONLY\n- Find existing sentence boundaries where topics shift\n- Look for: section transitions, topic changes, \"Now let's...\", \"Next...\", etc.\n- Each segment = one slide's worth of narration\n- Target 8-16 segments total\n- Each segment must be 80+ words\n- No segment should exceed 15% of total script length\n- Always start segments at sentence beginnings\n- Always end segments at sentence ends (full stops)\n\nYOUR PROCESS:\n1. Read the entire script WITHOUT making any changes\n2. Identify natural breakpoints (topic shifts, transitions)\n3. Split the script at these breakpoints\n4. Verify each segment starts and ends at sentence boundaries\n5. BEFORE OUTPUTTING: Count words in your segments vs. original input\n6. If counts don't match, you've edited - start over\n\nOUTPUT REQUIREMENTS:\n- Provide segmentation in valid JSON format\n- Each segment must include segment_number, text, and word_count\n- total_word_count must equal original_word_count (within 2 words)\n- word_count_match should be true if counts match\n- Segments must be numbered sequentially starting from 1\n\nQUALITY CHECKS:\n✓ 8-16 segments total\n✓ Sequential segment_numbers starting from 1\n✓ Each segment ≥80 words\n✓ No segment >15% of total length\n✓ Word count matches original (within 2 words)\n✓ All segments start and end at sentence boundaries\n✓ NO text has been reworded, rephrased, or edited\n\nREMEMBER: You are a SPLITTER, not a WRITER. Preserve the exact original text. Your job is to find the natural breakpoints where slides should change, nothing more."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1104,
        2896
      ],
      "id": "39405cb7-8ac0-4ced-b37f-0ed6c42c4e48",
      "name": "SegmentationAIAgent",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "content": "# Script Segmentation\n\n## Breaks approved scripts into discrete segments for video editing and animation. Each segment represents a natural division point in the narration flow. Enables granular post-production control over pacing, visuals, and transitions. Outputs timestamped segments ready for the editing pipeline.",
        "height": 208,
        "width": 1728,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        3488
      ],
      "typeVersion": 1,
      "id": "485b6755-2ddc-40b6-9642-a453cc393279",
      "name": "Sticky Note26"
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.segments",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1728,
        3088
      ],
      "id": "c22e1a7d-66ad-4bf3-91fb-452c72428bd8",
      "name": "SplitOut_04"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_03').first().json.constants.Status_2 }}",
            "M": "={{ $('GetGeneratedVideoScripts').item.json['M'] }}",
            "L": "={{ $('GetGeneratedVideoScripts').item.json['L'] }}",
            "S": "={{ $json.segment_number }}",
            "Lesson Title": "={{ $('GetGeneratedVideoScripts').item.json['Lesson Title'] }}",
            "Module Title": "={{ $('GetGeneratedVideoScripts').item.json['Module Title'] }}",
            "QC_NARRATION": "={{ $json.text }}",
            "CODE": "={{ $('GetGeneratedVideoScripts').item.json['M'] }}_{{ $('GetGeneratedVideoScripts').item.json['L'] }}_{{ $json.segment_number }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2096,
        3088
      ],
      "id": "e5e88ceb-62fd-424f-9fd5-5d609653de3f",
      "name": "AppendScriptSegmentsToGoogleSheet",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_2 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetGeneratedVideoScripts').item.json.row_number }}",
            "STATUS": "=FINISHED"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NARRATION",
              "displayName": "NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC",
              "displayName": "QC",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "opening_style_used",
              "displayName": "opening_style_used",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "practical_examples_and_exam_tips",
              "displayName": "practical_examples_and_exam_tips",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "knowledge_check_questions",
              "displayName": "knowledge_check_questions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_PASS",
              "displayName": "QC_PASS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "AI NOTES",
              "displayName": "AI NOTES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2528,
        3088
      ],
      "id": "a07d97e3-6249-4add-9cbe-9da8d17c902a",
      "name": "UpdateGoogleSheet_04",
      "retryOnFail": true,
      "executeOnce": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "=NEW LESSON",
            "Lesson Title": "=NEW LESSON NEW LESSON NEW LESSON",
            "Module Title": "=NEW LESSON NEW LESSON NEW LESSON",
            "QC_NARRATION": "=NEW LESSON NEW LESSON NEW LESSON",
            "M": "={{ $('GetGeneratedVideoScripts').item.json['M'] }}",
            "L": "={{ $('GetGeneratedVideoScripts').item.json['L'] }}",
            "S": "=XXX"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2320,
        3088
      ],
      "id": "d3e19de8-faf4-431a-88f1-3c53e7ab65d6",
      "name": "AppendScriptSegmentsToGoogleSheet1",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_03').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "={{ $('GlobalConstants_03').first().json.constants.Status_2 }}",
            "M": "={{ $('GetGeneratedVideoScripts').item.json['M'] }}",
            "L": "={{ $('GetGeneratedVideoScripts').item.json['L'] }}",
            "S": "=0",
            "Lesson Title": "={{ $('GetGeneratedVideoScripts').item.json['Lesson Title'] }}",
            "Module Title": "={{ $('GetGeneratedVideoScripts').item.json['Module Title'] }}",
            "CODE": "={{ $('GetGeneratedVideoScripts').item.json['M'] }}_{{ $('GetGeneratedVideoScripts').item.json['L'] }}_0"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        720,
        2896
      ],
      "id": "05d3c578-644d-4ab6-82d1-a3bffb66c162",
      "name": "AppendScriptSegmentsToGoogleSheet2",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "inputDataFieldName": "FIELD",
        "name": "=M{{ $('GetLessonSegments').item.json.M }}_L{{ $('GetLessonSegments').item.json.L }}_S{{ $('GetLessonSegments').item.json.S }}.mp3",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.elevenlabs_folder_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2144,
        4704
      ],
      "id": "cb98c8d3-8bcb-4b3d-9d91-80a42a409fc9",
      "name": "Upload file",
      "retryOnFail": true,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "YW5uoCGpLGXuL18x",
          "name": "Google Drive (SupergeniusCloud)"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "resource": "fileFolder",
        "queryString": "Course Jingle 1 ",
        "filter": {},
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1104,
        3904
      ],
      "id": "fb82f25a-7cff-4a7a-a666-fcefc98de512",
      "name": "Search files and folders",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "YW5uoCGpLGXuL18x",
          "name": "Google Drive (SupergeniusCloud)"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_04').item.json.constants.Status_3 }}",
            "TTS OUTPUT (ID)": "={{ $json.id }}",
            "TTS OUTPUT (URL)": "=https://drive.google.com/file/d/{{ $json.id }}/view?usp=sharing"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1344,
        3888
      ],
      "id": "433b31bd-84c2-48ec-ba1f-08930dce7a9c",
      "name": "Update row in sheet4",
      "retryOnFail": true,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $json.VIDEO_URL_CREATOMATE }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1200,
        4224
      ],
      "id": "cca69ff1-55a2-46e2-ae39-1e31ba780a2b",
      "name": "HTTP Request55",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"aa4a8c01-d137-4f8c-85ec-57f82ed3ea74\",\n  \"modifications\": {\n    \"Image.source\": \"{{ $('GetLessonSegments').item.json['Lesson Title'] }}\",\n    \"Title.text\": \"{{ $('GetLessonSegments').item.json['Lesson Title'] }}\",\n    \"Label.text\": \"MODULE {{ $('GetLessonSegments').item.json.M }} Lesson {{ $('GetLessonSegments').item.json.L }}\",\n    \"CTA-VFS.text\": \"{{ $('GlobalConstants_04').first().json.constants.course_name }}\",\n    \"Voiceover-TL7.source\": \"{{ $json['TTS OUTPUT (URL)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1632,
        3888
      ],
      "id": "e0b4177e-8fc0-4765-a674-73c0ab1291bd",
      "name": "HTTP Request13",
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "name": "=M{{ $('GetLessonSegments').item.json.M }}_L{{ $('GetLessonSegments').item.json.L }}_S{{ $('GetLessonSegments').item.json.S }}.mp4",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.creatomate_folder_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1488,
        4208
      ],
      "id": "a067e3e7-4d58-4012-94d7-15389af0dbe0",
      "name": "Upload file2",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "YW5uoCGpLGXuL18x",
          "name": "Google Drive (SupergeniusCloud)"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "VIDEO_URL_CREATOMATE": "={{ $json.url }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1840,
        3888
      ],
      "id": "512a84f7-fd24-4a60-8657-81694e165137",
      "name": "Update row in sheet5",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').item.json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').item.json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "Choice of Layout": "={{ $json.output }}",
            "STATUS": "={{ $('GlobalConstants_04').item.json.constants.Status_6 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        3376,
        4704
      ],
      "id": "7c943802-8768-4221-8d2a-85f60259c3f5",
      "name": "Update row in sheet80",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "Choice of Layout": "={{ $json.output.layout_id }}",
            "var(1)": "={{ $json.output.var_1 }}",
            "var(2)": "={{ $json.output.var_2 }}",
            "var(3)": "={{ $json.output.var_3 }}",
            "var(4)": "={{ $json.output.var_4 }}",
            "var(5)": "={{ $json.output.var_5 }}",
            "var(6)": "={{ $json.output.var_6 }}",
            "var(7)": "={{ $json.output.var_7 }}",
            "var(8)": "={{ $json.output.var_8 }}",
            "var(9)": "={{ $json.output.var_9 }}",
            "var(10)": "={{ $json.output.var_10 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        4400,
        4928
      ],
      "id": "589c6efb-956d-46af-b83c-5e611e8b6f2e",
      "name": "Update row in sheet86",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "share",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Update row in sheet8').item.json['TTS OUTPUT (ID)'] }}",
          "mode": "id"
        },
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone",
            "allowFileDiscovery": true
          }
        },
        "options": {}
      },
      "id": "c5cdbdea-d463-4125-bf67-24d6dd34f057",
      "name": "Set Access Permissions1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        944,
        5424
      ],
      "typeVersion": 3,
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $json.VIDEO_URL_CREATOMATE }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2432,
        5408
      ],
      "id": "5a57f05d-73ec-4468-9286-274b5b40c0a0",
      "name": "HTTP Request58",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "name": "=M{{ $('GetLessonSegments').item.json.M }}_L{{ $('GetLessonSegments').item.json.L }}_S{{ $('GetLessonSegments').item.json.S }}.mp4",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.creatomate_folder_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2784,
        5392
      ],
      "id": "116a3968-38f5-4081-bfdc-881795c26a9d",
      "name": "Upload file5",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "YW5uoCGpLGXuL18x",
          "name": "Google Drive (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "amount": 120
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2256,
        5408
      ],
      "id": "8d77309a-4035-4e21-86c0-99dcd73fec89",
      "name": "Wait7",
      "webhookId": "87d24cd5-5339-4f8b-8ac7-4529c991941d",
      "retryOnFail": false,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Use the Google Sheet Tool Node to know what Layouts have been selected for this lesson so far and attempt to introduce variety by avoiding selecting the same layout repeatedly.You will find these layout choices under a column header called \"Choice of Layout\"\n\nHere's the script:\n\n{{ $('GetLessonSegments').item.json.QC_NARRATION }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=I will provide the AI Agent with a piece of text that is a narration for an education course that I'm creating. The Assistant will then use this narration to choose one of nine layouts that is most appropriate for the text in that case, depending on the context of the narration.\n\nHere are the choices:\n\nLayout_001 = This is a basic slide with title text and summary body text.\nLayout_002 = This is a creative slide with a highlighted question/query/idea and an answer/exploration/description of the highlighted question/query/idea\nLayout_003 = This is a slide that presents 3 concepts which may or may not be related.\nLayout_004 = Comprised of a big bold statement followed by supporting text\nLayout_005 = This is a slide that presents 2 bullet points or ideas\nLayout_006 = This is a slide that presents 3 bullet points or ideas \nLayout_007 = This is a slide that presents 4 bullet points or ideas\nLayout_008 = This is a slide that has title text and a brief summary passage\nLayout_009 = Comprised of a big bold statement followed by two bullet points of text text\n\nShould you feel that a specific layout is the most appropriate for the narration you’ve been provided you, you will return the chosen Layout. For example, if your choice is Layout_004, you will return in the output nothing but “Layout_004”."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        2752,
        4720
      ],
      "id": "451b243d-ad23-4f3b-a3b8-7fc5e874100a",
      "name": "AI Agent9",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"$id\": \"https://example.com/schemas/slide-layout-choice.schema.json\",\n  \"title\": \"Slide Layout Choice\",\n  \"description\": \"Return exactly one layout identifier that best fits the provided narration.\",\n  \"type\": \"string\",\n  \"enum\": [\n    \"Layout_001\",\n    \"Layout_002\",\n    \"Layout_003\",\n    \"Layout_004\",\n    \"Layout_005\",\n    \"Layout_006\",\n    \"Layout_007\",\n    \"Layout_008\",\n    \"Layout_009\"\n  ],\n  \"oneOf\": [\n    { \"const\": \"Layout_001\", \"description\": \"Basic slide with title text and summary body text.\" },\n    { \"const\": \"Layout_002\", \"description\": \"Creative slide highlighting a question/query/idea and its answer/exploration/description.\" },\n    { \"const\": \"Layout_003\", \"description\": \"Slide presenting 3 concepts which may or may not be related.\" },\n    { \"const\": \"Layout_004\", \"description\": \"Big bold statement followed by supporting text.\" },\n    { \"const\": \"Layout_005\", \"description\": \"Slide presenting 2 bullet points or ideas.\" },\n    { \"const\": \"Layout_006\", \"description\": \"Slide presenting 3 bullet points or ideas.\" },\n    { \"const\": \"Layout_007\", \"description\": \"Slide presenting 4 bullet points or ideas.\" },\n    { \"const\": \"Layout_008\", \"description\": \"Slide with title text and a brief summary passage.\" },\n    { \"const\": \"Layout_009\", \"description\": \"Big bold statement followed by two bullet points of text.\" }\n  ],\n  \"examples\": [\"Layout_004\"]\n}\n",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        2768,
        4912
      ],
      "id": "3a928653-ee87-405c-a6e4-d39f5dc5081a",
      "name": "Structured Output Parser2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5678/webhook/92c89684-6997-4bcf-a77c-0966c56d9a92",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        3808,
        4368
      ],
      "id": "d635e195-0f6a-403e-b08d-5c2a47f21927",
      "name": "HTTP Request7",
      "executeOnce": true
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_04').item.json.constants.Status_3 }}",
            "TTS OUTPUT (ID)": "={{ $json.id }}",
            "TTS OUTPUT (URL)": "={{ $json.webContentLink }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2368,
        4720
      ],
      "id": "dd724f94-6003-433d-af0c-54fb6262fa43",
      "name": "Update row in sheet8",
      "retryOnFail": true,
      "executeOnce": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        2704,
        4896
      ],
      "id": "00b0100c-ed79-4254-90e0-2b15f5d19fc6",
      "name": "Mistral Cloud Chat Model4",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3632,
        4704
      ],
      "id": "76e4d047-4edd-4d08-a356-5a9e417a1fa5",
      "name": "Code in JavaScript8"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Choice of Layout: {{ $('Update row in sheet80').item.json['Choice of Layout'] }}\n\nNarration:\n{{ $('GetLessonSegments').item.json.QC_NARRATION }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=## Core Identity & Mission\n\n{{ $('GlobalConstants_04').first().json.constants.CreatorPersona }}\n\n## Input Structure\n\nEach request contains:\n1. **Narration**: Instructor's educational content (spoken format)\n2. **Layout Identifier**: Specific template code (Layout_001 through Layout_009)\n\n## Output Requirements\n\n### Structural Rules\n- **Always output exactly 10 variables** (`var_1` through `var_10`)\n- **Never alter the variable count or sequence**\n- **Unused variables must be empty strings** (`\"\"`)\n- **No markdown, delimiters, or special formatting** in values\n- **Output must be automation-ready** for direct Google Sheets integration via n8n\n\n### Content Quality Standards\n- **Tone**: Professional, authoritative, exam-focused\n- **Audience**: Cybersecurity professionals preparing for certification exams\n- **Style**: Clear, concise, actionable\n- **Accuracy**: Maintain technical precision from source narration\n- **Conciseness**: Respect all word count limits strictly\n\n### Image Prompt Guidelines\nWhen generating AI image prompts:\n- **Style**: Professional, modern, corporate aesthetic\n- **Relevance**: Directly supports the educational concept\n- **Specificity**: Include concrete visual elements (e.g., \"dashboard with security metrics\" not \"security concept\")\n- **Tone**: Professional workplace setting, avoid stock photo clichés\n- **Technical accuracy**: Use correct terminology and visual metaphors\n\n### Content Extraction Strategy\n1. Identify the core concept from narration\n2. Extract key technical terms and frameworks\n3. Distill into layout-appropriate chunks\n4. Ensure logical flow across variables\n5. Maintain exam-relevant emphasis\n\n## Layout Specifications\n\n### Layout_001: Simple Title + Body\n**Use case**: Concept introduction, definitions, transitions\n- `var_1`: **Title** (6–10 words) — Clear, specific concept name\n- `var_2`: **Body** (40–60 words) — Comprehensive explanation\n- `var_3` to `var_10`: `\"\"`\n\n### Layout_002: Visual Concept Introduction\n**Use case**: Thought-provoking questions, scenario setup\n- `var_1`: **AI image prompt** — Background visual setting the context\n- `var_2`: **Key question or idea** (6–8 words) — Attention-grabbing\n- `var_3`: **Supporting phrase** (≤8 words) — Clarifying context\n- `var_4`: **Context paragraph** (20–30 words) — Detailed explanation\n- `var_5` to `var_10`: `\"\"`\n\n### Layout_003: Three-Column Visual Breakdown\n**Use case**: Process steps, comparison of concepts, sequential learning\n- `var_1`: **Title** (6–10 words)\n- `var_2`: **Image prompt for column 1** (supports var_3 + var_4)\n- `var_3`: **Paragraph 1** (≤12 words) — Descriptive text\n- `var_4`: **Core idea 1** (≤6 words) — Key takeaway\n- `var_5`: **Image prompt for column 2** (supports var_6 + var_7)\n- `var_6`: **Paragraph 2** (≤12 words)\n- `var_7`: **Core idea 2** (≤6 words)\n- `var_8`: **Image prompt for column 3** (supports var_9 + var_10)\n- `var_9`: **Paragraph 3** (≤12 words)\n- `var_10`: **Core idea 3** (≤6 words)\n\n### Layout_004: Concise Title + Brief Body\n**Use case**: Quick facts, short definitions, transition slides\n- `var_1`: **Title** (6–8 words)\n- `var_2`: **Body** (≈20 words) — Brief explanation\n- `var_3` to `var_10`: `\"\"`\n\n### Layout_005: Visual + Two Key Points\n**Use case**: Highlighting two critical concepts with visual support\n- `var_1`: **AI image prompt** — Background visual\n- `var_2`: **Bullet point 1** (≤10 words) — First key concept\n- `var_3`: **Bullet point 2** (≤10 words) — Second key concept\n- `var_4` to `var_10`: `\"\"`\n\n### Layout_006: Title + Three Icon Bullets\n**Use case**: Feature lists, benefit breakdowns, three-part concepts\n- `var_1`: **Title** (6–10 words)\n- `var_2`: **Image prompt for bullet 1** — Icon/visual for var_5\n- `var_3`: **Image prompt for bullet 2** — Icon/visual for var_6\n- `var_4`: **Image prompt for bullet 3** — Icon/visual for var_7\n- `var_5`: **Bullet 1** (≤8 words)\n- `var_6`: **Bullet 2** (≤8 words)\n- `var_7`: **Bullet 3** (≤8 words)\n- `var_8` to `var_10`: `\"\"`\n\n### Layout_007: Four Short Bullets with Background\n**Use case**: Quick lists, enumerated items, rapid-fire concepts\n- `var_1`: **AI image prompt** — Background visual\n- `var_2`: **Bullet 1** (≤6 words)\n- `var_3`: **Bullet 2** (≤6 words)\n- `var_4`: **Bullet 3** (≤6 words)\n- `var_5`: **Bullet 4** (≤6 words)\n- `var_6` to `var_10`: `\"\"`\n\n### Layout_008: Title + Body + Background Image\n**Use case**: Visually supported explanations\n- `var_1`: **Title** (6–8 words)\n- `var_2`: **Body** (≈20 words)\n- `var_3`: **AI image prompt** — Background visual\n- `var_4` to `var_10`: `\"\"`\n\n### Layout_009: Title + Two Bullets (No Image)\n**Use case**: Simple lists, clean text-focused slides\n- `var_1`: **Title** (6–8 words)\n- `var_2`: **Bullet point 1** (≤10 words)\n- `var_3`: **Bullet point 2** (≤10 words)\n- `var_4` to `var_10`: `\"\"`\n\n## Critical Reminders\n\n- **Word limits are strict requirements**, not suggestions\n- **Empty variables must be `\"\"`**, never null or omitted\n- **Preserve technical accuracy** from the source narration\n- **No conversational artifacts** (e.g., \"um,\" \"you know,\" filler words)\n- **No instructional language** (e.g., \"students will learn\")\n- **Direct, declarative statements** only"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        3872,
        4704
      ],
      "id": "1269901b-18a4-4f2f-9d57-4b784b4a1019",
      "name": "AI Agent6",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"CybersecuritySlideContent\",\n  \"description\": \"Structured slide content for cybersecurity certification training courses\",\n  \"type\": \"object\",\n  \"required\": [\n    \"layout_id\",\n    \"var_1\",\n    \"var_2\",\n    \"var_3\",\n    \"var_4\",\n    \"var_5\",\n    \"var_6\",\n    \"var_7\",\n    \"var_8\",\n    \"var_9\",\n    \"var_10\"\n  ],\n  \"properties\": {\n    \"layout_id\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"Layout_001\",\n        \"Layout_002\",\n        \"Layout_003\",\n        \"Layout_004\",\n        \"Layout_005\",\n        \"Layout_006\",\n        \"Layout_007\",\n        \"Layout_008\",\n        \"Layout_009\"\n      ],\n      \"description\": \"The layout template identifier used for this slide\"\n    },\n    \"var_1\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 1\"\n    },\n    \"var_2\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 2\"\n    },\n    \"var_3\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 3\"\n    },\n    \"var_4\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 4\"\n    },\n    \"var_5\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 5\"\n    },\n    \"var_6\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 6\"\n    },\n    \"var_7\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 7\"\n    },\n    \"var_8\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 8\"\n    },\n    \"var_9\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 9\"\n    },\n    \"var_10\": {\n      \"type\": \"string\",\n      \"description\": \"Layout-specific content for variable 10\"\n    },\n    \"metadata\": {\n      \"type\": \"object\",\n      \"description\": \"Optional metadata for tracking and quality assurance\",\n      \"properties\": {\n        \"slide_number\": {\n          \"type\": \"integer\",\n          \"description\": \"Sequential slide number in the course\"\n        },\n        \"section_title\": {\n          \"type\": \"string\",\n          \"description\": \"The course section this slide belongs to\"\n        },\n        \"word_counts\": {\n          \"type\": \"object\",\n          \"description\": \"Word count validation for each variable\",\n          \"properties\": {\n            \"var_1_count\": {\"type\": \"integer\"},\n            \"var_2_count\": {\"type\": \"integer\"},\n            \"var_3_count\": {\"type\": \"integer\"},\n            \"var_4_count\": {\"type\": \"integer\"},\n            \"var_5_count\": {\"type\": \"integer\"},\n            \"var_6_count\": {\"type\": \"integer\"},\n            \"var_7_count\": {\"type\": \"integer\"},\n            \"var_8_count\": {\"type\": \"integer\"},\n            \"var_9_count\": {\"type\": \"integer\"},\n            \"var_10_count\": {\"type\": \"integer\"}\n          }\n        },\n        \"source_narration_length\": {\n          \"type\": \"integer\",\n          \"description\": \"Character count of original narration\"\n        },\n        \"generated_timestamp\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\",\n          \"description\": \"ISO 8601 timestamp of generation\"\n        }\n      }\n    }\n  },\n  \"additionalProperties\": false\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        3936,
        4816
      ],
      "id": "aea93bff-fba0-4888-a013-532d05396d9c",
      "name": "Structured Output Parser10"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        3920,
        4544
      ],
      "id": "2c2d4437-8c8f-4e41-8053-098225e9b9dc",
      "name": "Redis Chat Memory2",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        3936,
        4928
      ],
      "id": "f70bc83e-50b1-4e21-8940-4044e835c19f",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        3776,
        4864
      ],
      "id": "d0c089e1-0634-4ce6-9619-24fab474bf52",
      "name": "Mistral Cloud Chat Model5",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "=FINISHED",
            "VIDEO_URL_GDRIVE": "={{ $json.webContentLink }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3056,
        5392
      ],
      "id": "19d7cbc7-9b7f-412e-a055-d5bc49086e1a",
      "name": "Update row in sheet9",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_04').first().json.constants.Status_9 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3472,
        4368
      ],
      "id": "1a652321-30bc-4bcc-a594-0c019a73d386",
      "name": "Update row in sheet13",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_001",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "1a1c0e44-5e78-4e21-b7cd-9899237c7354"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 1"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "e1c69271-c30c-44e1-b9db-042b02c2a7db",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_002",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 2"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "f810c111-f7fa-4e1e-a168-dd1353fec444",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_003",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 3"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4cdf8398-eb9e-41fc-bc26-21f8381444f9",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_004",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 4"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "3bd5624f-58c9-4068-91a2-a70fc5f8fd77",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_005",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 5"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "8d4fe343-4a9d-422f-9d92-5b9e931e244f",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_006",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 6"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "132ba539-374d-49c2-ba6e-265ec76e945d",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_007",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 7"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "71aace87-0dfc-4617-8084-c8a9523aa8b6",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_008",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 8"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "5c277c73-5208-4e4c-8922-41709e926045",
                    "leftValue": "={{ $('Update row in sheet80').item.json['Choice of Layout'] }}",
                    "rightValue": "Layout_009",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Layout 9"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        1168,
        5312
      ],
      "id": "dc50b2a1-4d05-4d34-813f-395a865a5c4a",
      "name": "Switch3"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "VIDEO_URL_CREATOMATE": "={{ $json.url }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2048,
        5408
      ],
      "id": "8b2c216e-29a7-4f9d-a684-a5843f03a9cc",
      "name": "Update row in sheet75",
      "retryOnFail": true,
      "maxTries": 5,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"536fc610-6413-44b1-87a5-a568f85adac9\",\n  \"modifications\": {\n    \"Voiceover-FD4.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Message-XTS.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Title-6WN.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1392,
        5248
      ],
      "id": "395d2427-3e3d-4ad0-8eb7-4c69f67ffc1e",
      "name": "HTTP Request31",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"0039b783-79d8-4313-a21e-d248f72baa38\",\n  \"modifications\": {\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Background-Image.source\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Search-Keywords.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Result-Title.text\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\",\n    \"Result-Text.text\": \"{{ $('Update row in sheet86').item.json['var(4)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1552,
        5248
      ],
      "id": "0b64eda8-a9ca-43b4-a9da-861688bbb225",
      "name": "HTTP Request32",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"49a578b5-94c1-4a9b-9fbb-f02e3dccf23e\",\n  \"modifications\": {\n    \"Quote.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Name.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Name-KQN.text\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1712,
        5552
      ],
      "id": "a2894505-0add-48bf-bf49-28c9a1a7adc0",
      "name": "HTTP Request33",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"1efc28fd-2cbd-4156-9100-7e23bed6c943\",\n  \"modifications\": {\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Image-Z9S.source\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Message.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Message-HQQ.text\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\",\n    \"Message-V46.text\": \"{{ $('Update row in sheet86').item.json['var(4)'] }}\",\n    \"Message-SN3.text\": \"{{ $('Update row in sheet86').item.json['var(5)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1392,
        5552
      ],
      "id": "d420b524-57fa-4a47-b992-6a15cc57bc1d",
      "name": "HTTP Request34",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"8a12a564-641c-4687-a1f7-7a5e67a9f4e9\",\n  \"modifications\": {\n    \"Title.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Image-6LQ.source\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Image-C8M.source\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\",\n    \"Image-PMD.source\": \"{{ $('Update row in sheet86').item.json['var(4)'] }}\",\n    \"Message.text\": \"{{ $('Update row in sheet86').item.json['var(5)'] }}\",\n    \"Message-ZD9.text\": \"{{ $('Update row in sheet86').item.json['var(6)'] }}\",\n    \"Message-9ZF.text\": \"{{ $('Update row in sheet86').item.json['var(7)'] }}\",\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1712,
        5408
      ],
      "id": "a35dca77-e3df-4fe8-a3e1-884487f88845",
      "name": "HTTP Request35",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"953b5b7d-c871-4919-958c-cee0030b576f\",\n  \"modifications\": {\n    \"Image-B4C.source\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Text-C9X.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Text-CST.text\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\",\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1552,
        5408
      ],
      "id": "d5bcf895-0b34-40d7-9a88-cb7f53ba39d9",
      "name": "HTTP Request36",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"79dfcce2-c40f-46d5-acc9-28482cd318fb\",\n  \"modifications\": {\n    \"Quote.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Name.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1392,
        5408
      ],
      "id": "76980bc7-f5e0-4077-ade9-3f970020c34d",
      "name": "HTTP Request37",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"d8f3b080-3904-42e0-a449-4c5a95dc0252\",\n  \"modifications\": {\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Title.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Product-Image-CZP.source\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Product-Description-S88.text\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\",\n    \"Caption-89Q.text\": \"{{ $('Update row in sheet86').item.json['var(4)'] }}\",\n    \"Product-Image-N4Z.source\": \"{{ $('Update row in sheet86').item.json['var(5)'] }}\",\n    \"Product-Description-37X.text\": \"{{ $('Update row in sheet86').item.json['var(6)'] }}\",\n    \"Caption-P72.text\": \"{{ $('Update row in sheet86').item.json['var(7)'] }}\",\n    \"Product-Image-2CK.source\": \"{{ $('Update row in sheet86').item.json['var(8)'] }}\",\n    \"Product-Description-6VT.text\": \"{{ $('Update row in sheet86').item.json['var(9)'] }}\",\n    \"Caption-QSF.text\": \"{{ $('Update row in sheet86').item.json['var(10)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1712,
        5248
      ],
      "id": "a0169145-f007-4b16-b3a2-28ea8ab2785a",
      "name": "HTTP Request38",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "width": 192,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3760,
        4352
      ],
      "typeVersion": 1,
      "id": "5a018a3e-3bdc-4e33-9495-03ff90da23c6",
      "name": "Sticky Note27"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.creatomate.com/v2/renders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"template_id\": \"df0574fc-8d9f-4a25-a4c6-3f7984ad0436\",\n  \"modifications\": {\n    \"Voiceover-TL7.source\": \"{{ $('Update row in sheet8').item.json['TTS OUTPUT (URL)'] }}\",\n    \"Heading-1.text\": \"{{ $('Update row in sheet86').item.json['var(1)'] }}\",\n    \"Text-1.text\": \"{{ $('Update row in sheet86').item.json['var(2)'] }}\",\n    \"Image-1.source\": \"{{ $('Update row in sheet86').item.json['var(3)'] }}\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1552,
        5552
      ],
      "id": "0d4b8ee3-f8b6-4603-892d-825973621163",
      "name": "HTTP Request",
      "retryOnFail": true,
      "credentials": {
        "httpHeaderAuth": {
          "id": "VOfIR0v33YsFBe5U",
          "name": "Creatomate Authentication"
        }
      }
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/d04bee53-b8b3-405c-8974-b7164eaa5008",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1824,
        2656
      ],
      "id": "d143b5a6-ac28-4f0d-aa40-d7dcc13cb52f",
      "name": "ActivateWebhook_05",
      "executeOnce": true
    },
    {
      "parameters": {
        "content": "",
        "height": 720,
        "width": 150,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        3808
      ],
      "typeVersion": 1,
      "id": "2d87723f-afce-4779-b843-3419063710f8",
      "name": "Sticky Note36"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "92c89684-6997-4bcf-a77c-0966c56d9a92",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -512,
        3888
      ],
      "id": "9cf93909-d3bd-4ad6-a5ed-015b10b7e2a8",
      "name": "Webhook_05",
      "webhookId": "92c89684-6997-4bcf-a77c-0877c56d9a92"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        112,
        4368
      ],
      "id": "2395f718-9d3d-46aa-aa0d-f131767cdfef",
      "name": "GlobalConstants_04",
      "executeOnce": true,
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $json.constants.Status_2 }}"
            },
            {
              "lookupColumn": "STATUS",
              "lookupValue": "NEW LESSON"
            },
            {
              "lookupColumn": "STATUS",
              "lookupValue": "NEW MODULE"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        304,
        4368
      ],
      "id": "06c327d3-18b5-4584-be6b-701506167968",
      "name": "GetLessonSegments",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "alwaysOutputData": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "height": 240,
        "width": 150,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        4304
      ],
      "typeVersion": 1,
      "id": "951fbf5e-a066-43c6-9469-951d7dadfd6d",
      "name": "Sticky Note37"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "77dcf2e1-7f92-4f20-8081-e88f41d2dd4e",
              "leftValue": "={{ $('GetLessonSegments').first().json.S }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        816,
        4336
      ],
      "id": "2e25c715-5815-4764-b2f0-c885e9222549",
      "name": "If_07"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.fish.audio/v1/tts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "s1"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.body) }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "=FIELD"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        1904,
        4720
      ],
      "id": "e17f6acc-9c11-420e-9936-fce1941a0c47",
      "name": "TTSFromVoiceClone",
      "credentials": {
        "httpHeaderAuth": {
          "id": "Sof12gLZVJuYAKg7",
          "name": "FishAudio"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        -4080,
        4336
      ],
      "id": "06a1e205-7813-464e-9811-743b553f5bb5",
      "name": "Limit"
    },
    {
      "parameters": {
        "height": 288,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4160,
        4208
      ],
      "typeVersion": 1,
      "id": "7e270536-142d-4ca4-ab20-955102a1c9fc",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 576,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4416,
        3568
      ],
      "typeVersion": 1,
      "id": "405e1f2f-444f-4e72-a648-b66b7bdc2e71",
      "name": "Sticky Note32"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -4016,
        3616
      ],
      "id": "422ade52-6953-4b8f-b174-edc53548a100",
      "name": "GlobalConstants_07",
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "path": "0cf3c425-d214-4f0f-afd5-6101d332477f",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -4368,
        3616
      ],
      "id": "785543b5-6d8a-4b00-90c8-5716e78e4a62",
      "name": "Webhook",
      "webhookId": "0cf3c425-d214-4f0f-afd5-6101d332477f"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/0cf3c425-d214-4f0f-afd5-6101d332477f",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        4848,
        1632
      ],
      "id": "ff8189dd-cd3f-481f-9e18-24c5ee1272cb",
      "name": "ActivateWebhook_09",
      "executeOnce": true
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_07').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "={{ $('GlobalConstants_07').first().json.constants.Status_1 }}"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3200,
        3600
      ],
      "id": "b076a42e-3c5e-47f4-b7f5-611ba3f28230",
      "name": "GetChapterListFromGoogleSheet",
      "executeOnce": true,
      "retryOnFail": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 160,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1856,
        2608
      ],
      "typeVersion": 1,
      "id": "e98011b0-e91c-495a-a9c9-5aa316b06fb6",
      "name": "Sticky Note33"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        288,
        816
      ],
      "id": "04c67a32-993e-4c32-aefb-caa039cca211",
      "name": "No Operation, do nothing"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2608,
        2176
      ],
      "id": "8b48655a-58a8-4c38-aa14-8983743d8e61",
      "name": "HTTP Request2",
      "executeOnce": true
    },
    {
      "parameters": {
        "content": "",
        "height": 224,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2528,
        2128
      ],
      "typeVersion": 1,
      "id": "892578fe-edc6-46f6-8e21-f1d1a551cf48",
      "name": "Sticky Note34"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_02').first().json.constants.Sheet_1 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetPDFChaptersFromGoogleSheet').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_02').first().json.constants.Status_10 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "file_id",
              "displayName": "file_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Chapter Number",
              "displayName": "Chapter Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module",
              "displayName": "Module",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Verdict",
              "displayName": "Verdict",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2336,
        2176
      ],
      "id": "f9226434-dc31-4306-b665-b6d3537ef4dc",
      "name": "UpdateGoogleSheet_",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "batchSize": 5,
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        2000,
        1648
      ],
      "id": "9265ec4c-ab5b-4648-9e9b-2a4a681d327f",
      "name": "Loop Over Items"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2656,
        1760
      ],
      "id": "aad9ded3-dd4e-46f8-898c-8f97271afad8",
      "name": "Wait",
      "webhookId": "83c200a3-87c4-4a8a-b3fe-ccdb704b3bec"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        768
      ],
      "typeVersion": 1,
      "id": "99da300d-7103-4771-ba4c-4dc0aada8072",
      "name": "Sticky Note38"
    },
    {
      "parameters": {
        "content": "",
        "height": 224,
        "width": 256,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4768,
        1584
      ],
      "typeVersion": 1,
      "id": "15c9f59b-f5ab-41cd-9703-c732947a7145",
      "name": "Sticky Note39"
    },
    {
      "parameters": {
        "content": "",
        "height": 208,
        "width": 1056,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3232,
        1728
      ],
      "typeVersion": 1,
      "id": "aeda1462-5608-4826-bfac-45c1114c2243",
      "name": "Sticky Note40"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 5,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        1504,
        4352
      ],
      "id": "c2d32aba-7661-4e42-ba8f-5640b0bd218e",
      "name": "If_"
    },
    {
      "parameters": {
        "amount": 60
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1712,
        4336
      ],
      "id": "af1406c0-bc7e-4b8b-a07e-0848dedcb8c9",
      "name": "Wait_",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "U0A3JV13SKX",
          "mode": "list",
          "cachedResultName": "hesham"
        },
        "text": "=## ERROR ## ERROR ## ERROR ##\n\n## Workflow ##\n\nhttps://n8n.vps.betterbrainlab.org/workflow/{{ $workflow.id }}\n\n## ERROR ## ERROR ## ERROR ##\n",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        1920,
        4368
      ],
      "id": "1b030a23-ddae-4eed-b6a5-ea41e8447b7b",
      "name": "SlackErrorMessage_",
      "webhookId": "ebcbd315-bc0c-483c-9933-cdf7aeeebd95",
      "credentials": {
        "slackOAuth2Api": {
          "id": "kMQbs66UgbBArT3U",
          "name": "Slack Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "=FINISHED"
            },
            {
              "lookupColumn": "S",
              "lookupValue": "0"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -2336,
        5008
      ],
      "id": "ce39aea8-873e-4fac-bb97-237d584342a2",
      "name": "Get row(s) in sheet3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "fileSelector": "={{ $('Code in JavaScript3').item.json.output_path }}",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1.1,
      "position": [
        -1536,
        5072
      ],
      "id": "05603606-21b5-40b2-8ee3-643a96207b97",
      "name": "Read/Write Files from Disk",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 5,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        2608,
        5568
      ],
      "id": "c119ee84-a38c-44d7-b4de-d7b06d641441",
      "name": "If_1"
    },
    {
      "parameters": {
        "amount": 60
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2800,
        5552
      ],
      "id": "12fa3722-3c28-4e7c-a2c2-291202d10abe",
      "name": "Wait_1",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "user",
        "user": {
          "__rl": true,
          "value": "U0A3JV13SKX",
          "mode": "list",
          "cachedResultName": "hesham"
        },
        "text": "=## ERROR ## ERROR ## ERROR ##\n\n## Workflow ##\n\nhttps://n8n.vps.betterbrainlab.org/workflow/{{ $workflow.id }}\n\n## ERROR ## ERROR ## ERROR ##\n",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        3072,
        5584
      ],
      "id": "17ab1341-57e2-4743-bb4c-bc5f71bf2067",
      "name": "SlackErrorMessage_1",
      "webhookId": "ebcbd315-bc0c-483c-9933-cdf7aeeebd95",
      "credentials": {
        "slackOAuth2Api": {
          "id": "kMQbs66UgbBArT3U",
          "name": "Slack Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3008,
        5552
      ],
      "typeVersion": 1,
      "id": "011cbcb5-7525-4dd1-ae04-1ab637551343",
      "name": "Sticky Note31"
    },
    {
      "parameters": {
        "content": "",
        "height": 2192,
        "width": 4400,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        3808
      ],
      "typeVersion": 1,
      "id": "5cfbb989-d94b-45cf-8884-805cde8eca5b",
      "name": "Sticky Note28"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "={{ $('GlobalConstants_04').first().json.constants.Status_9 }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        4416,
        5584
      ],
      "id": "694392a7-19cf-4b09-bc98-1d5132bd82bc",
      "name": "Update row in sheet",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5678/webhook/92c89684-6997-4bcf-a77c-0966c56d9a92",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        4736,
        5392
      ],
      "id": "0173e0b8-fbdf-4887-b3b1-56f925d442af",
      "name": "HTTP Request9",
      "executeOnce": true
    },
    {
      "parameters": {
        "content": "",
        "width": 192,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4688,
        5376
      ],
      "typeVersion": 1,
      "id": "95079fb7-d92b-4b75-9b84-bd112c719282",
      "name": "Sticky Note30"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('GetLessonSegments').item.json.row_number }}",
            "STATUS": "=FINISHED",
            "VIDEO_URL_GDRIVE": "={{ $json.webContentLink }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2896,
        4192
      ],
      "id": "a418347e-13c9-49eb-a46a-b909f3868970",
      "name": "Update row in sheet7",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "content": "# Video Creator via Creatomate\n\n## Sends segmented scripts to Creatomate for automated video rendering. Each segment becomes an individually rendered video clip with synchronized visuals. Rendering jobs run in parallel to maximize throughput. Outputs download URLs for each rendered segment ready for concatenation.",
        "height": 304,
        "width": 736,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3664,
        4016
      ],
      "typeVersion": 1,
      "id": "eac4d8d7-5500-43bd-a2be-51af14d64e6a",
      "name": "Sticky Note29"
    },
    {
      "parameters": {
        "content": "#  1",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4320,
        1952
      ],
      "typeVersion": 1,
      "id": "2c6310e3-ece9-45d2-b058-3f821a869816",
      "name": "Sticky Note42"
    },
    {
      "parameters": {
        "content": "#  2",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        2064
      ],
      "typeVersion": 1,
      "id": "1328f5ff-e541-4285-9ebc-25e4cb65d54f",
      "name": "Sticky Note43"
    },
    {
      "parameters": {
        "content": "#  3",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        1968
      ],
      "typeVersion": 1,
      "id": "f52ea2b1-5351-4288-a572-7623603f2b9a",
      "name": "Sticky Note44"
    },
    {
      "parameters": {
        "content": "#  4",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4448,
        2032
      ],
      "typeVersion": 1,
      "id": "507117f4-e720-405d-8c5a-c18d8f5e4e78",
      "name": "Sticky Note45"
    },
    {
      "parameters": {
        "content": "#  5",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3088,
        4032
      ],
      "typeVersion": 1,
      "id": "a80db37a-3ddb-44d0-8875-da74dc86553e",
      "name": "Sticky Note46"
    },
    {
      "parameters": {
        "content": "#  6",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        3072
      ],
      "typeVersion": 1,
      "id": "492de52d-c6af-4b02-8c74-5566c0eb4674",
      "name": "Sticky Note47"
    },
    {
      "parameters": {
        "content": "#  7",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        3264
      ],
      "typeVersion": 1,
      "id": "24a42fb9-6e5d-40e1-a0d4-1cf23725b8db",
      "name": "Sticky Note48"
    },
    {
      "parameters": {
        "content": "#  8",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        3392
      ],
      "typeVersion": 1,
      "id": "3548def7-035d-4d01-9008-fb54002c84d7",
      "name": "Sticky Note50"
    },
    {
      "parameters": {
        "content": "#  9",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3664,
        3920
      ],
      "typeVersion": 1,
      "id": "d3f9b4bf-f75d-413b-81a1-f7b7b52ff913",
      "name": "Sticky Note51"
    },
    {
      "parameters": {
        "command": "=ffmpeg {{ $json.ffmpeg_command }}"
      },
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        -1728,
        5072
      ],
      "id": "be01e3b4-2ec8-47a3-936b-94637b017302",
      "name": "Execute Command2"
    },
    {
      "parameters": {
        "content": "",
        "height": 1072,
        "width": 3520,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3152,
        4608
      ],
      "typeVersion": 1,
      "id": "f80acd8a-5209-4c5f-9477-d981f0cd7259",
      "name": "Sticky Note49"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "b186f1c9-ff15-4df5-b8c1-b9fd11c99567",
              "leftValue": "={{ $json['Are you a Taylor Swift fan?'] }}",
              "rightValue": "EtCTVANpQyh1OQbXQKHz9UeFsZJi7twtS2fn7uxiUt08G2rbMfQV3ncZxLJ5IN3nmq4RgRDcE13ILdoQzIYT2CoYmZjbuhr1hperoqZ3nrHX5pBU1pH6wnu4HpyknilGfhDItV0Jep3pT0RtskUMaU7KGze29xo3yN23KpBWWVWNlzdEuSW1URr2z17UuPr6zCbbZK0USSpaS4vcMXdHEoG0nH2cRpcm1jkwuHZgibtQ0vx3t0dm878bU09glXNs",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "5807c8f3-5e64-44e7-8bc6-f0e1562a237d",
              "leftValue": "={{ $json['Do you hate Donald Trump?'] }}",
              "rightValue": "UeAZGqAXHXd2X6eAEBMoGg1UCKbfAORhId8oyyywntIbl2xfdL5xxA9gQ4vnkNUdyUnh0yvt5Vfb5sAvE2R8Z6suUVqhB6qc6RrD4xLUnrasWS4yj5FqSV3f5PIzrUweCZ4jTAC7JFTzdiHO5sN4bQ2jMtbu22GAHCQ5D33MYF9o8wqUIDoYNTORnexf54MDdMt9t9xwUKB6KiVwbSsn0xeclRmOrBhErGlHqAKDxuu8GGs0I5G3OH8unCwfli7X",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "83646ca2-93f6-4809-b4cd-50cea2b5b375",
              "leftValue": "={{ $json['What\\'s your email?'] }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              }
            },
            {
              "id": "545de046-3d03-4640-82b4-3b5a0ce3fbf8",
              "leftValue": "={{ $json['What\\'s your phone number?'] }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -4320,
        1552
      ],
      "id": "1d3599d6-17eb-4909-898d-662401a650c6",
      "name": "If"
    },
    {
      "parameters": {
        "path": "d04bee53-b8b3-405c-8974-b7164eaa5008",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -768,
        3968
      ],
      "id": "500e61b9-e0fa-4c65-9e16-e80ac5c60fe7",
      "name": "Webhook1",
      "webhookId": "d04bee53-b8b3-405c-8974-b7164eaa5008"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -528,
        4208
      ],
      "id": "b4f63121-4943-4782-8e8e-5bd467d44b7d",
      "name": "GlobalConstants_10",
      "executeOnce": true,
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_10').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_10').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "=NEW MODULE",
            "Module Title": "=NEW MODULE",
            "Lesson Title": "=NEW MODULE"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -304,
        4368
      ],
      "id": "6a3203cd-9330-4cb9-9913-9ef3860ed361",
      "name": "AppendModuleDividers",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.STATUS }}",
                    "rightValue": "={{ $('GlobalConstants_04').first().json.constants.Status_2 }}",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "667a08b5-a813-4347-a509-7cb198e966fb"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "=TTS PENDING"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "b90280c4-4f24-4120-9e43-34c1fda04a37",
                    "leftValue": "={{ $json.STATUS }}",
                    "rightValue": "NEW LESSON",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "NEW LESSON"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "d958ef46-45c1-4305-a001-e4b2116ce399",
                    "leftValue": "={{ $json.STATUS }}",
                    "rightValue": "NEW MODULE",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "NEW MODULE"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        464,
        4352
      ],
      "id": "ff45107b-046e-46ae-a6aa-43d45facc62c",
      "name": "Switch"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/cac7c713-85ab-43dd-8e9e-6cf2d1d1c2d7",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        800,
        4624
      ],
      "id": "f55d965c-2259-4ad2-bcd1-3625859e71e4",
      "name": "HTTP Request10",
      "executeOnce": true
    },
    {
      "parameters": {
        "content": "# Video Renderer via FFMPEG\n\n## Final assembly stage where segment clips are merged into full lesson videos. ffmpeg handles concatenation with re-encoding for consistent output quality. Rendered files pass through a staging directory for n8n compatibility with cloud upload. Automated cleanup removes local copies once Google Drive upload confirms success.",
        "height": 304,
        "width": 688,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        4672
      ],
      "typeVersion": 1,
      "id": "911a5c15-87fd-49ba-b924-d5d6b167033f",
      "name": "Sticky Note41"
    },
    {
      "parameters": {
        "content": "#  10",
        "height": 80,
        "width": 150,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        4688
      ],
      "typeVersion": 1,
      "id": "8dd0090a-915f-46d8-aa1a-65c9ac45c855",
      "name": "Sticky Note52"
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        5216
      ],
      "typeVersion": 1,
      "id": "d91a029d-f6cf-4a73-81be-7e9893202943",
      "name": "Sticky Note53"
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        4576
      ],
      "typeVersion": 1,
      "id": "c142702c-2fe0-49f9-88b8-f76680a9a54b",
      "name": "Sticky Note54"
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2448,
        4336
      ],
      "typeVersion": 1,
      "id": "1b53b8d8-0a2a-48df-8408-f4c273135fc8",
      "name": "Sticky Note55"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\nreturn { randomString: result };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2544,
        4720
      ],
      "id": "9e3c5c1e-c839-4cda-875d-c9b054af3a73",
      "name": "Code in JavaScript9"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "sessionTTL": 7200,
        "contextWindowLength": 15
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        2736,
        4608
      ],
      "id": "265141de-c778-4b29-a24f-d751baac377e",
      "name": "Redis Chat Memory",
      "credentials": {
        "redis": {
          "id": "w1nYJN6Fl7n4lwSC",
          "name": "Redis (EXPIRES)"
        }
      }
    },
    {
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        2768,
        5088
      ],
      "id": "e24330bb-4056-4798-a42e-1938426f0c29",
      "name": "Mistral Cloud Chat Model6",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_04').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "M",
              "lookupValue": "={{ $('GetLessonSegments').first().json.M }}"
            },
            {
              "lookupColumn": "L",
              "lookupValue": "={{ $('GetLessonSegments').first().json.L }}"
            },
            {
              "lookupColumn": "STATUS",
              "lookupValue": "FINISHED"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        2864,
        5088
      ],
      "id": "1c8754df-6e83-4115-b566-779902d30a5c",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -3232,
        3184
      ],
      "id": "3fd12a09-0536-422c-9ab4-f56df10821d9",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        112,
        4144
      ],
      "id": "4cc737ba-e036-459d-97b6-2c46501e2b4d",
      "name": "Schedule Trigger1"
    },
    {
      "parameters": {
        "jsCode": "const text = $json.QC_NARRATION\n  .replace(/\\n/g, ' ')\n  .replace(/\\s+/g, ' ')\n  .replace(/\"/g, '\"')\n  .replace(/\"/g, '\"');\n\nreturn {\n  body: {\n    text: text,\n    temperature: 0.9,\n    top_p: 0.85,\n    reference_id: $('GlobalConstants_04').first().json.constants.voide_id,\n    prosody: {\n      speed: 1,\n      volume: 0\n    },\n    chunk_length: 225,\n    normalize: false,\n    format: \"mp3\",\n    sample_rate: 44100,\n    mp3_bitrate: 128,\n    latency: \"normal\",\n    max_new_tokens: 1024,\n    repetition_penalty: 1.2,\n    min_chunk_length: 50,\n    condition_on_previous_chunks: true,\n    early_stop_threshold: 1\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1072,
        4576
      ],
      "id": "6f1fdf5f-f6de-42d2-aab2-f3a771abaa20",
      "name": "Code in JavaScript1"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-globals.globalConstants",
      "typeVersion": 1,
      "position": [
        -2576,
        5008
      ],
      "id": "1686b62e-9dd4-455a-8825-32f52571a9b7",
      "name": "GlobalConstants_",
      "executeOnce": true,
      "credentials": {
        "globalConstantsApi": {
          "id": "JSzJUsH8Uy5bsaoy",
          "name": "ULTIMA Online Course Creation"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -2912,
        5008
      ],
      "id": "dd1f3b3b-cb36-4c3e-9013-41c522db4342",
      "name": "Schedule Trigger2"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "=FINISHED"
            },
            {
              "lookupColumn": "M",
              "lookupValue": "={{ $json.M }}"
            },
            {
              "lookupColumn": "L",
              "lookupValue": "={{ $json.L }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1952,
        4800
      ],
      "id": "baa1204d-fa0a-4819-a0c1-34ac96a7b95f",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ct43So3ZtM1GNuoa",
          "name": "Google Sheet (SupergeniusCloud)"
        }
      }
    },
    {
      "parameters": {
        "operation": "share",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.VIDEO_URL_GDRIVE.split('id=')[1].split('&')[0] }}",
          "mode": "id"
        },
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone",
            "allowFileDiscovery": true
          }
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1760,
        4800
      ],
      "id": "e6240a73-8058-458e-a943-97c271f6f4eb",
      "name": "Share file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "write",
        "fileName": "=/files/temp_{{ $('Get row(s) in sheet3').first().json.M }}_{{ $('Get row(s) in sheet3').first().json.L }}_{{ $runIndex }}.mp4",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1.1,
      "position": [
        -1024,
        4896
      ],
      "id": "e6b8a55e-47d0-46ea-9afe-f3db41a49457",
      "name": "Read/Write Files from Disk1",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Get row(s) in sheet').item.json.VIDEO_URL_GDRIVE.split('id=')[1].split('&')[0] }}",
          "mode": "id"
        },
        "options": {
          "fileName": "=CompTIA_SECURITY_{{ $('Get row(s) in sheet').item.json.CODE }}.mp4"
        }
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1584,
        4800
      ],
      "id": "494f3368-1989-42d7-97c9-c6b0826a5a01",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -1312,
        4800
      ],
      "id": "ac30578d-dff3-4377-8c12-ef64bae5e2f1",
      "name": "Loop Over Items1"
    },
    {
      "parameters": {
        "jsCode": "const count = $input.all().length; // number of items/videos\nconst moduleNum = $('Get row(s) in sheet3').first().json.M;\nconst lessonNum = $('Get row(s) in sheet3').first().json.L;\nconst courseName = $('GlobalConstants_').first().json.constants.course_name;\n\n// Build -i inputs from local files matching your naming pattern\nconst inputs = Array.from({length: count}, (_, i) => `-i \"/files/temp_${moduleNum}_${lessonNum}_${i}.mp4\"`).join(' ');\n\n// Build filter streams\nconst streams = Array.from({length: count}, (_, i) => `[${i}:v][${i}:a]`).join('');\n\n// Output path\nconst filename = `M${moduleNum}_L${lessonNum}_${courseName}.mp4`;\nconst outputPath = `/files/${filename}`;\n\nconst command = `-y ${inputs} -filter_complex \"${streams}concat=n=${count}:v=1:a=1[outv][outa]\" -map \"[outv]\" -map \"[outa]\" -c:v libx264 -c:a aac \"${outputPath}\"`;\n\nreturn {\n  json: {\n    ffmpeg_command: command,\n    output_path: outputPath,\n    filename: filename,\n    video_count: count,\n    module: moduleNum,\n    lesson: lessonNum\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1936,
        5072
      ],
      "id": "47b82daa-a605-4af6-81a5-27f9f774654a",
      "name": "Code in JavaScript3"
    },
    {
      "parameters": {
        "name": "={{ $json.fileName.split('C')[0] }}_{{ $('Get row(s) in sheet3').first().json['Lesson Title'] }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.ffmpeg_folder_id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1280,
        5264
      ],
      "id": "bb02737a-27e4-4704-b23e-ab9003e244e4",
      "name": "Upload file3",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "3f30573f-e58a-4303-917a-0fab8f8eec64",
              "leftValue": "={{ $runIndex }}",
              "rightValue": 2,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1280,
        5376
      ],
      "id": "ea9611fb-dd58-415c-a2fb-5682f5f1a09f",
      "name": "If_4"
    },
    {
      "parameters": {
        "amount": 60
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1280,
        5408
      ],
      "id": "09c5d995-c2be-46af-b972-113ab4680f8c",
      "name": "Wait_4",
      "webhookId": "a24980a8-9da8-445b-81cb-c04a66975901"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "CAPICHE",
            "CODE": "={{ $('Get row(s) in sheet3').first().json.CODE }}"
          },
          "matchingColumns": [
            "CODE"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -1040,
        5248
      ],
      "id": "0cc4d4df-a864-466b-8900-87c43ed9fd98",
      "name": "Update row in sheet88",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "ERROR 3",
            "CODE": "={{ $('Get row(s) in sheet3').first().json.CODE }}"
          },
          "matchingColumns": [
            "CODE"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -624,
        5088
      ],
      "id": "769dae80-2c99-4d71-b1f5-8b6a66ed25b3",
      "name": "Update row in sheet89",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "path": "06bbc241-aa86-474f-8212-bf22e1d3dc1d",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2912,
        4768
      ],
      "id": "50c49d2b-8ca8-450a-b414-1d127e0e0399",
      "name": "Webhook2",
      "webhookId": "06bbc241-aa86-474f-8212-bf22e1d3dc1d"
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/06bbc241-aa86-474f-8212-bf22e1d3dc1d",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -352,
        5248
      ],
      "id": "8320a2f7-4e03-4126-8681-588d6e0974a9",
      "name": "ActivateWebhook_",
      "executeOnce": true
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "={{ $('GlobalConstants_').first().json.constants.Sheet_3 }}",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "ERROR 3",
            "CODE": "={{ $('Get row(s) in sheet3').first().json.CODE }}"
          },
          "matchingColumns": [
            "CODE"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CODE",
              "displayName": "CODE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "M",
              "displayName": "M",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "L",
              "displayName": "L",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "S",
              "displayName": "S",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Module Title",
              "displayName": "Module Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Title",
              "displayName": "Lesson Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Lesson Outline",
              "displayName": "Lesson Outline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "OBJECTIVES",
              "displayName": "OBJECTIVES",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "QC_NARRATION",
              "displayName": "QC_NARRATION",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (URL)",
              "displayName": "TTS OUTPUT (URL)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TTS OUTPUT (ID)",
              "displayName": "TTS OUTPUT (ID)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Choice of Layout",
              "displayName": "Choice of Layout",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(1)",
              "displayName": "var(1)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(2)",
              "displayName": "var(2)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(3)",
              "displayName": "var(3)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(4)",
              "displayName": "var(4)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(5)",
              "displayName": "var(5)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(6)",
              "displayName": "var(6)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(7)",
              "displayName": "var(7)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(8)",
              "displayName": "var(8)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(9)",
              "displayName": "var(9)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "var(10)",
              "displayName": "var(10)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_CREATOMATE",
              "displayName": "VIDEO_URL_CREATOMATE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "VIDEO_URL_GDRIVE",
              "displayName": "VIDEO_URL_GDRIVE",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -1936,
        5264
      ],
      "id": "2c316fc3-ca17-4a5c-92b4-1e0f5b9f57ac",
      "name": "Update row in sheet90",
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "executeOnce": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "url": "=http://localhost:5678/webhook/06bbc241-aa86-474f-8212-bf22e1d3dc1d",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1712,
        5264
      ],
      "id": "4048b27b-2564-472d-91dd-b1fcd2c2b399",
      "name": "ActivateWebhook_1",
      "executeOnce": true
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        5232
      ],
      "typeVersion": 1,
      "id": "0eeb6f5d-6cf2-4aa5-9e80-7716bd9923c9",
      "name": "Sticky Note56"
    },
    {
      "parameters": {
        "content": "",
        "height": 192,
        "width": 224,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2976,
        4720
      ],
      "typeVersion": 1,
      "id": "6bbac621-882e-4eb2-a6c8-054b2107b20a",
      "name": "Sticky Note57"
    }
  ],
  "pinData": {},
  "connections": {
    "Compress": {
      "main": [
        [
          {
            "node": "SplitUpBinaryData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If7": {
      "main": [
        [
          {
            "node": "Wait_02",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SlackErrorMessage_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brave Search1": {
      "ai_tool": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "LoopOverItems_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "SegmentationAIAgent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser6": {
      "ai_outputParser": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Sort_01": {
      "main": [
        [
          {
            "node": "AppendPDFChaptersIntoGoogleSheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDFAttachmentUpload": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitPDFByChapter": {
      "main": [
        [
          {
            "node": "Compress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitUpBinaryData": {
      "main": [
        [
          {
            "node": "GlobalConstants_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_01": {
      "main": [
        [
          {
            "node": "UploadSplitPDFs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UploadSplitPDFs": {
      "main": [
        [
          {
            "node": "Sort_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendPDFChaptersIntoGoogleSheet": {
      "main": [
        [
          {
            "node": "AppendSTOPRow_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendSTOPRow_01": {
      "main": [
        [
          {
            "node": "ActivateWebhook_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook_01": {
      "main": [
        [
          {
            "node": "GlobalConstants_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_02": {
      "main": [
        [
          {
            "node": "GetPDFChaptersFromGoogleSheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetPDFChaptersFromGoogleSheet": {
      "main": [
        [
          {
            "node": "If_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_01": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "FilterIncidentalBookSections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FilterIncidentalBookSections": {
      "main": [
        [
          {
            "node": "If_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_01": {
      "ai_languageModel": [
        [
          {
            "node": "FilterIncidentalBookSections",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_02": {
      "ai_languageModel": [
        [
          {
            "node": "StructuredOutputParser_01",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "StructuredOutputParser_01": {
      "ai_outputParser": [
        [
          {
            "node": "FilterIncidentalBookSections",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "If_02": {
      "main": [
        [
          {
            "node": "UpdateGoogleSheet_01",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "UpdateBookChapterGoogleSheet_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateBookChapterGoogleSheet_02": {
      "main": [
        [
          {
            "node": "DeleteVectorStoreCollection_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeleteVectorStoreCollection_01": {
      "main": [
        [
          {
            "node": "CreateCollection_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CreateCollection_01": {
      "main": [
        [
          {
            "node": "DownloadPDFChapterPDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DownloadPDFChapterPDF": {
      "main": [
        [
          {
            "node": "MistralOCR_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_03": {
      "main": [
        [
          {
            "node": "Wait_01",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SlackErrorMessage_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_01": {
      "main": [
        [
          {
            "node": "CreateCollection_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralOCR_01": {
      "main": [
        [
          {
            "node": "MistralOCR_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralOCR_02": {
      "main": [
        [
          {
            "node": "MistralOCR_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralOCR_03": {
      "main": [
        [
          {
            "node": "SplitOut_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitOut_01": {
      "main": [
        [
          {
            "node": "Javascript_01",
            "type": "main",
            "index": 0
          },
          {
            "node": "SplitOut_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QdrantVectorStore_01": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QdrantVectorStore_02": {
      "main": [
        [
          {
            "node": "Merge_01",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "UpdateGoogleSheet_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Javascript_01": {
      "main": [
        [
          {
            "node": "EditFields_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EditFields_01": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EditFields_": {
      "main": [
        [
          {
            "node": "ConvertBase64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitOut_02": {
      "main": [
        [
          {
            "node": "EditFields_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ConvertBase64": {
      "main": [
        [
          {
            "node": "CohereImageEmbeddings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CohereImageEmbeddings": {
      "main": [
        [
          {
            "node": "PreparePoints",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PreparePoints": {
      "main": [
        [
          {
            "node": "AggregatePoints",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AggregatePoints": {
      "main": [
        [
          {
            "node": "QdrantVectorStore_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DataLoader_01": {
      "ai_document": [
        [
          {
            "node": "QdrantVectorStore_01",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "RecursiveTextCharacterSplitter": {
      "ai_textSplitter": [
        [
          {
            "node": "DataLoader_01",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Merge_01": {
      "main": [
        [
          {
            "node": "RandomStringGenerator_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_03": {
      "ai_languageModel": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "BraveSearch_01": {
      "ai_tool": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_04": {
      "ai_languageModel": [
        [
          {
            "node": "StructuredOutputParser_02",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "RandomStringGenerator_01": {
      "main": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LessonPlannerAIAgent": {
      "main": [
        [
          {
            "node": "SplitOut_03",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "StructuredOutputParser_02": {
      "ai_outputParser": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "CohereEmbeddings_01": {
      "ai_embedding": [
        [
          {
            "node": "QdrantVectorStore_01",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "CohereEmbeddings_02": {
      "ai_embedding": [
        [
          {
            "node": "QueryVectorStore_01",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "CohereReranker_01": {
      "ai_reranker": [
        [
          {
            "node": "QueryVectorStore_01",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "QueryVectorStore_01": {
      "ai_tool": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wait_02": {
      "main": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnthropicChat_01": {
      "ai_languageModel": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "SplitOut_03": {
      "main": [
        [
          {
            "node": "EditFields_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EditFields_02": {
      "main": [
        [
          {
            "node": "AppendLessonListOutlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendLessonListOutlines": {
      "main": [
        [
          {
            "node": "AppendSTOPRow_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendSTOPRow_02": {
      "main": [
        [
          {
            "node": "ActivateWebhook_09",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetLessonOutlineListFromGoogleSheet": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LoopOverItems_01": {
      "main": [
        [
          {
            "node": "GetChapterListFromGoogleSheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "RandomStringGenerator_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheetRow_01": {
      "main": [
        [
          {
            "node": "AppendSTOPRow_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendSTOPRow_03": {
      "main": [
        [
          {
            "node": "ActivateWebhook_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RandomStringGenerator_02": {
      "main": [
        [
          {
            "node": "RandomOpeningSelector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RandomOpeningSelector": {
      "main": [
        [
          {
            "node": "RecentOpeningsUsedSelector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScriptwritingAIAgent": {
      "main": [
        [
          {
            "node": "AppendLessonScriptDetailed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GoogleSheetErrorUpdate_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RecentOpeningsUsedSelector": {
      "main": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_05": {
      "ai_languageModel": [
        [
          {
            "node": "StructuredOutputParser_03",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_06": {
      "ai_languageModel": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "MistralCloud_07": {
      "ai_languageModel": [
        [
          {
            "node": "VideoScriptAIEvaluator",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "MistralCloud_08": {
      "ai_languageModel": [
        [
          {
            "node": "StructuredOutputParser_05",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_09": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser6",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_10": {
      "ai_languageModel": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "MistralCloud_11": {
      "ai_languageModel": [
        [
          {
            "node": "SegmentationAIAgent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MistralCloud_12": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AnthropicChat_02": {
      "ai_languageModel": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AnthropicChat_03": {
      "ai_languageModel": [
        [
          {
            "node": "VideoScriptAIEvaluator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AnthropicChat_04": {
      "ai_languageModel": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AnthropicChat_05": {
      "ai_languageModel": [
        [
          {
            "node": "SegmentationAIAgent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Memory_01": {
      "ai_memory": [
        [
          {
            "node": "LessonPlannerAIAgent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Memory_02": {
      "ai_memory": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "RedisOpeningsDB": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScriptOpeningExtractor": {
      "main": [
        [
          {
            "node": "RedisOpeningsDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendLessonScriptDetailed": {
      "main": [
        [
          {
            "node": "UpdateGoogleSheet_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GoogleSheetErrorUpdate_01": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GoogleSheetErrorUpdate_02": {
      "main": [
        [
          {
            "node": "Wait_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Memory_03": {
      "ai_memory": [
        [
          {
            "node": "VideoScriptAIEvaluator",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Memory_04": {
      "ai_memory": [
        [
          {
            "node": "SegmentationAIAgent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "GoogleSheetErrorUpdate_03": {
      "main": [
        [
          {
            "node": "Wait_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_03": {
      "main": [
        [
          {
            "node": "ActivateWebhook_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Memory_06": {
      "ai_memory": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "RandomStringGenerator_03": {
      "main": [
        [
          {
            "node": "SegmentationAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RandomStringGenerator_04": {
      "main": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RandomStringGenerator_05": {
      "main": [
        [
          {
            "node": "VideoScriptAIEvaluator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QueryVectorStore_02": {
      "ai_tool": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "StructuredOutputParser_03": {
      "ai_outputParser": [
        [
          {
            "node": "ScriptwritingAIAgent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "CohereEmbeddings_03": {
      "ai_embedding": [
        [
          {
            "node": "QueryVectorStore_02",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "CohereReranker_02": {
      "ai_reranker": [
        [
          {
            "node": "QueryVectorStore_02",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheet_02": {
      "main": [
        [
          {
            "node": "ScriptOpeningExtractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheet_01": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook_02": {
      "main": [
        [
          {
            "node": "GlobalConstants_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_03": {
      "main": [
        [
          {
            "node": "GetGeneratedVideoScripts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "StructuredOutputParser_05": {
      "ai_outputParser": [
        [
          {
            "node": "VideoScriptAIEvaluator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheet_03": {
      "main": [
        [
          {
            "node": "SwitchBoard_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_04": {
      "main": [
        [
          {
            "node": "ActivateWebhook_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SwitchBoard_01": {
      "main": [
        [
          {
            "node": "AppendScriptSegmentsToGoogleSheet2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GoogleSheetErrorUpdate_03",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "RandomStringGenerator_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VideoScriptAIEvaluator": {
      "main": [
        [
          {
            "node": "UpdateGoogleSheet_03",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GoogleSheetErrorUpdate_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_05": {
      "main": [
        [
          {
            "node": "ActivateWebhook_05",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "RandomStringGenerator_05",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetGeneratedVideoScripts": {
      "main": [
        [
          {
            "node": "If_05",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_06": {
      "main": [
        [
          {
            "node": "Wait_06",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SlackErrorMessage_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_06": {
      "main": [
        [
          {
            "node": "RewriterAIAgent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RewriterAIAgent": {
      "main": [
        [
          {
            "node": "UpdateRowRevisedScript",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If_06",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateRowRevisedScript": {
      "main": [
        [
          {
            "node": "AppendScriptSegmentsToGoogleSheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SegmentationAIAgent": {
      "main": [
        [
          {
            "node": "SplitOut_04",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GoogleSheetErrorUpdate_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitOut_04": {
      "main": [
        [
          {
            "node": "AppendScriptSegmentsToGoogleSheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendScriptSegmentsToGoogleSheet": {
      "main": [
        [
          {
            "node": "AppendScriptSegmentsToGoogleSheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheet_04": {
      "main": [
        [
          {
            "node": "Wait_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendScriptSegmentsToGoogleSheet1": {
      "main": [
        [
          {
            "node": "UpdateGoogleSheet_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendScriptSegmentsToGoogleSheet2": {
      "main": [
        [
          {
            "node": "RandomStringGenerator_03",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Update row in sheet8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Update row in sheet4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet4": {
      "main": [
        [
          {
            "node": "HTTP Request13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request55": {
      "main": [
        [
          {
            "node": "Upload file2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request13": {
      "main": [
        [
          {
            "node": "Update row in sheet5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file2": {
      "main": [
        [
          {
            "node": "Update row in sheet7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet5": {
      "main": [
        [
          {
            "node": "HTTP Request55",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet80": {
      "main": [
        [
          {
            "node": "Code in JavaScript8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet86": {
      "main": [
        [
          {
            "node": "Set Access Permissions1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Access Permissions1": {
      "main": [
        [
          {
            "node": "Switch3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request58": {
      "main": [
        [
          {
            "node": "Upload file5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file5": {
      "main": [
        [
          {
            "node": "Update row in sheet9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait7": {
      "main": [
        [
          {
            "node": "HTTP Request58",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent9": {
      "main": [
        [
          {
            "node": "Update row in sheet80",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent9",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet8": {
      "main": [
        [
          {
            "node": "Code in JavaScript9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent9",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript8": {
      "main": [
        [
          {
            "node": "AI Agent6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent6": {
      "main": [
        [
          {
            "node": "Update row in sheet86",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser10": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent6",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory2": {
      "ai_memory": [
        [
          {
            "node": "AI Agent6",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser10",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent6",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet9": {
      "main": [
        [
          {
            "node": "HTTP Request9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet13": {
      "main": [
        [
          {
            "node": "HTTP Request7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch3": {
      "main": [
        [
          {
            "node": "HTTP Request31",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request32",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request38",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request37",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request36",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request35",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request34",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request33",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet75": {
      "main": [
        [
          {
            "node": "Wait7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request31": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request32": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request33": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request34": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request35": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request36": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request37": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request38": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Update row in sheet75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook_05": {
      "main": [
        [
          {
            "node": "GlobalConstants_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_04": {
      "main": [
        [
          {
            "node": "GetLessonSegments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetLessonSegments": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_07": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TTSFromVoiceClone": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "LoopOverItems_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_07": {
      "main": [
        [
          {
            "node": "GetLessonOutlineListFromGoogleSheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "GlobalConstants_07",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetChapterListFromGoogleSheet": {
      "main": [
        [
          {
            "node": "UpdateGoogleSheetRow_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UpdateGoogleSheet_": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Merge_01",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "QdrantVectorStore_01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_": {
      "main": [
        [
          {
            "node": "Wait_",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SlackErrorMessage_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_": {
      "main": [
        [
          {
            "node": "HTTP Request55",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SlackErrorMessage_": {
      "main": [
        [
          {
            "node": "Update row in sheet13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet3": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet90",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Upload file3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet89",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_1": {
      "main": [
        [
          {
            "node": "Wait_1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SlackErrorMessage_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_1": {
      "main": [
        [
          {
            "node": "HTTP Request58",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SlackErrorMessage_1": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "HTTP Request9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet7": {
      "main": [
        [
          {
            "node": "HTTP Request7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Command2": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "SplitPDFByChapter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "GlobalConstants_10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalConstants_10": {
      "main": [
        [
          {
            "node": "AppendModuleDividers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AppendModuleDividers": {
      "main": [
        [
          {
            "node": "GlobalConstants_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "If_07",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [
          {
            "node": "HTTP Request10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript9": {
      "main": [
        [
          {
            "node": "AI Agent9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent9",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent9",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "ActivateWebhook_02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "GlobalConstants_04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "TTSFromVoiceClone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger2": {
      "main": [
        []
      ]
    },
    "GlobalConstants_": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Share file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share file": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Code in JavaScript3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Read/Write Files from Disk1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet89",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript3": {
      "main": [
        [
          {
            "node": "Execute Command2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file3": {
      "main": [
        [
          {
            "node": "Update row in sheet88",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If_4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_4": {
      "main": [
        [
          {
            "node": "Wait_4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet89",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait_4": {
      "main": [
        [
          {
            "node": "Upload file3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet88": {
      "main": [
        [
          {
            "node": "ActivateWebhook_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet89": {
      "main": [
        [
          {
            "node": "ActivateWebhook_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook2": {
      "main": [
        [
          {
            "node": "GlobalConstants_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet90": {
      "main": [
        [
          {
            "node": "ActivateWebhook_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "f1918567-82a5-4d9b-834f-85a352f3d553",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "5ff5a5992c4c72af22abbdcfa574d8cdf93dc14d57eb9f66e3d9ef2a3e2dbb6c"
  },
  "id": "tgmtKSeRkMoWHH2B",
  "tags": []
}