{
  "name": "YouTube Idea Factory",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -2704,
        1472
      ],
      "id": "22456de7-afa9-4afd-bcc5-827ddaf60bb9",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        176,
        1920
      ],
      "id": "fc72fe33-6ff5-464b-a967-30626052339a",
      "name": "Download file2",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "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": [
        -1408,
        2176
      ],
      "id": "d93d2f99-931e-4144-9e29-2a125589037b",
      "name": "HTTP Request9",
      "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": [
        -1184,
        2176
      ],
      "id": "625a950a-7263-4ed7-af81-a2f91a586629",
      "name": "HTTP Request10",
      "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": [
        -944,
        2176
      ],
      "id": "b5144bda-95d9-4401-ae6d-bcdf45f0396e",
      "name": "HTTP Request11",
      "credentials": {
        "mistralCloudApi": {
          "id": "feG0p0tu1GwMlA1h",
          "name": "Mistral Cloud Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "pages",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -672,
        2176
      ],
      "id": "3ee5d8ee-fc36-47d6-b835-f01e4c2d8d21",
      "name": "Split Out5"
    },
    {
      "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": [
        -272,
        2176
      ],
      "id": "b51f9d68-727e-490d-a38c-c5294084d53e",
      "name": "Code2"
    },
    {
      "parameters": {
        "fieldToSplitOut": "images",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -1520,
        2384
      ],
      "id": "8c0320af-3abe-4a42-944d-438a0974a0dd",
      "name": "Split Out6"
    },
    {
      "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": "={{ $('Split Out6').item.json.image_base64.split(',')[1] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1296,
        2384
      ],
      "id": "4d28f3d3-cf73-42f9-9e70-44656d0b8d97",
      "name": "Edit Fields2"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "image_base64",
        "options": {
          "fileName": "={{ $('Edit Fields2').item.json.file_name }}"
        }
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        -784,
        2384
      ],
      "id": "6693a74c-e4fc-454c-b7f3-30aeb1fac037",
      "name": "Convert to File2"
    },
    {
      "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,{{ $('Edit Fields2').item.json.image_base64 }}\"],\n  \"output_dimension\": 1024\n  }",
        "options": {}
      },
      "id": "5f3826f2-bccc-4687-b669-225965e4883d",
      "name": "Image Embeddings with Cohere Embed 5",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -288,
        2384
      ],
      "typeVersion": 4.2,
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "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": [
        -80,
        2176
      ],
      "id": "c0acd2a3-e9b2-4c0a-b72b-c4655d8e2998",
      "name": "Edit Fields3"
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "linking_words",
          "mode": "list",
          "cachedResultName": "linking_words"
        },
        "embeddingBatchSize": 96,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        96,
        2176
      ],
      "id": "e011a6b1-0913-46e9-b437-5a8ce55c4923",
      "name": "Qdrant Vector Store1",
      "credentials": {
        "qdrantApi": {
          "id": "f4OYPtbhAv74DCJ1",
          "name": "Qdrant API"
        }
      }
    },
    {
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "typeVersion": 1,
      "position": [
        16,
        2352
      ],
      "id": "d9a8f33e-02ad-4def-9690-6e7a2f5a79d3",
      "name": "Embeddings Cohere4",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "textSplittingMode": "custom",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        144,
        2352
      ],
      "id": "1d891731-b779-4abc-8314-5c4689e75055",
      "name": "Default Data Loader2"
    },
    {
      "parameters": {
        "chunkSize": 600,
        "chunkOverlap": 120,
        "options": {
          "splitCode": "markdown"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        144,
        2496
      ],
      "id": "4a5cc896-77d5-449c-a0ce-eaf854354edb",
      "name": "Recursive Character Text Splitter2"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        784,
        2704
      ],
      "id": "c0d51dd5-4ce9-477b-9891-e51fd9dcf558",
      "name": "Merge3",
      "executeOnce": false
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "points",
        "options": {}
      },
      "id": "ccc0227a-f708-43d6-95e5-ca76c5ddb79e",
      "name": "Aggregate Points2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -688,
        2720
      ],
      "typeVersion": 1
    },
    {
      "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": "={{ $('Edit Fields2').item.json.image_annotation }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "01cf332c-a94f-49b8-be08-c2e9a1f133b6",
      "name": "Prepare Points4",
      "type": "n8n-nodes-base.set",
      "position": [
        -1168,
        2720
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "resource": "point",
        "operation": "upsertPoints",
        "collectionName": {
          "__rl": true,
          "value": "=linking_words",
          "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": "3631de37-2add-4151-af16-2bb0064fcf9d",
      "name": "Insert Points",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        432,
        2720
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "=1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 836344211,
          "mode": "list",
          "cachedResultName": "40 Popular YouTube Videos Short Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=836344211"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "DONE"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1440,
        1056
      ],
      "id": "0f9dc94d-bdd9-4c14-994e-d68c87e4e53e",
      "name": "Get row(s) in sheet"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -1232,
        1056
      ],
      "id": "31041671-472f-4b67-97af-a491411607b5",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "name": "={{ $('Loop Over Items').item.json.Link }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "=1Y5Z69Wn38-64KR5hw7J5_uYLJvrzyLmR",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -464,
        1280
      ],
      "id": "05b93477-fd63-4d7a-95e2-0b5681decad9",
      "name": "Upload file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "amount": 15
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -272,
        1280
      ],
      "id": "b3ce87f4-04b1-4fd2-9c61-031d792d4849",
      "name": "Wait",
      "webhookId": "11e29704-de76-419c-a028-78e744cd5c2b"
    },
    {
      "parameters": {
        "resource": "fileFolder",
        "filter": {
          "folderId": {
            "__rl": true,
            "value": "=11utrMNPwOfjfNWxyTw7zwo95fRrfXDDJ",
            "mode": "id"
          }
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1760,
        1904
      ],
      "id": "3715cc7e-33e5-4d2e-926f-5439034143ba",
      "name": "Search files and folders",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "tIDDMV7A8FksccHm",
          "name": "Google Drive (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "toText",
        "sourceProperty": "Transcript",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        -1024,
        1152
      ],
      "id": "8b17452a-8246-4d68-8610-0c6817a89616",
      "name": "Convert to File"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://stirling.vps.betterbrainlab.org/api/v1/convert/file/pdf",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "*/*"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "fileInput",
              "inputDataFieldName": "data"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -816,
        1152
      ],
      "id": "36c76608-1795-408d-b9c4-9e53ed543555",
      "name": "HTTP Request",
      "credentials": {
        "httpHeaderAuth": {
          "id": "qBzrJCdw85CRgbPJ",
          "name": "Stirling PDF Key"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -1568,
        1904
      ],
      "id": "5779fe4c-654b-478c-9fd9-21fe7021a53a",
      "name": "Loop Over Items1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Please start.",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You are a specialized AI agent designed to identify and extract high-quality linking phrases from content. Your primary function is to analyze YouTube video transcripts and Substack blog posts to find natural, engaging transitional phrases that connect ideas smoothly.\n\n## Your Task\n\nIdentify linking phrases that serve as bridges between two distinct ideas, statements, or topics. These phrases should:\n\n1. Create smooth, natural transitions between concepts\n2. Maintain audience engagement and flow\n3. Be versatile enough to work in conversational (YouTube) or written (Substack) contexts\n4. Feel organic rather than forced or mechanical\n\n## What Constitutes a Good Linking Phrase\n\nLook for phrases that:\n- Connect logically disparate ideas\n- Signal shifts in topic, perspective, or depth\n- Maintain narrative momentum\n- Sound natural in spoken or written form\n- Are reusable across different content contexts\n\nExamples include:\n- \"Now, here's where it gets interesting...\"\n- \"But that's only half the story...\"\n- \"Let me put this another way...\"\n- \"Which brings us to...\"\n- \"The flip side of this is...\"\n\n## Output Requirements\n\nFor each linking phrase you identify, provide:\n\n1. **The linking phrase itself** - The exact transitional language used\n2. **Statement before** - The complete sentence or idea that comes immediately before the linking phrase (provides context for what's being transitioned FROM)\n3. **Statement after** - The complete sentence or idea that comes immediately after the linking phrase (shows what's being transitioned TO)\n4. **Usage description** - A concise 10-15 word explanation of HOW this linking phrase functions (e.g., \"Signals a shift from problem to solution while building anticipation\")\n\n## Quality Standards\n\n- Extract phrases that are genuinely transitional, not just conjunctions\n- Ensure examples show clear context on both sides\n- Prioritize phrases that feel engaging and dynamic\n- Focus on phrases that enhance rather than simply connect\n- Avoid overly common or generic transitions unless they're used in an interesting way\n\n## Analysis Process\n\nWhen analyzing content from the Qdrant vector store:\n1. Identify moments where the speaker/writer shifts between ideas\n2. Isolate the exact language used to make that transition\n3. Capture sufficient context before and after to demonstrate the transition clearly\n4. Evaluate whether the phrase is reusable and engaging enough to include\n5. Describe the functional purpose of the transition\n\nYour output must be valid JSON conforming to the provided schema."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -1936,
        1472
      ],
      "id": "2dcf179d-d95b-4a73-bbd8-0597b0b94dc3",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"required\": [\"linking_phrases\"],\n  \"properties\": {\n    \"linking_phrases\": {\n      \"type\": \"array\",\n      \"description\": \"Array of identified linking phrases with context and usage\",\n      \"items\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"linking_phrase\",\n          \"statement_before\",\n          \"statement_after\",\n          \"usage_description\"\n        ],\n        \"properties\": {\n          \"linking_phrase\": {\n            \"type\": \"string\",\n            \"description\": \"The exact transitional phrase used to connect ideas\",\n            \"minLength\": 2,\n            \"maxLength\": 200\n          },\n          \"statement_before\": {\n            \"type\": \"string\",\n            \"description\": \"The complete statement or idea that appears immediately before the linking phrase\",\n            \"minLength\": 10,\n            \"maxLength\": 500\n          },\n          \"statement_after\": {\n            \"type\": \"string\",\n            \"description\": \"The complete statement or idea that appears immediately after the linking phrase\",\n            \"minLength\": 10,\n            \"maxLength\": 500\n          },\n          \"usage_description\": {\n            \"type\": \"string\",\n            \"description\": \"Concise 10-15 word explanation of how this linking phrase functions\",\n            \"minLength\": 10,\n            \"maxLength\": 100\n          },\n          \"source_type\": {\n            \"type\": \"string\",\n            \"enum\": [\"youtube_transcript\", \"substack_post\", \"unknown\"],\n            \"description\": \"The type of content source where this phrase was found\"\n          },\n          \"transition_type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"topic_shift\",\n              \"elaboration\",\n              \"contrast\",\n              \"causation\",\n              \"exemplification\",\n              \"summary\",\n              \"anticipation\",\n              \"clarification\"\n            ],\n            \"description\": \"The functional category of the transition\"\n          }\n        },\n        \"additionalProperties\": false\n      }\n    },\n    \"metadata\": {\n      \"type\": \"object\",\n      \"description\": \"Optional metadata about the extraction process\",\n      \"properties\": {\n        \"total_phrases_found\": {\n          \"type\": \"integer\",\n          \"description\": \"Total number of linking phrases identified\"\n        },\n        \"content_analyzed\": {\n          \"type\": \"string\",\n          \"description\": \"Brief description of the content source analyzed\"\n        },\n        \"extraction_timestamp\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\",\n          \"description\": \"ISO 8601 timestamp of when extraction occurred\"\n        }\n      }\n    }\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1792,
        1648
      ],
      "id": "2e889655-3cee-4264-9a49-8ce5a073c33d",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -1792,
        1776
      ],
      "id": "65f78348-88a5-4d99-8b11-a1de461ae4df",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -2000,
        1648
      ],
      "id": "2e507cc0-163e-4409-9772-272b24d87d00",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "={{ $json.randomString }}",
        "sessionKey": "",
        "contextWindowLength": 24
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        -1888,
        1648
      ],
      "id": "3a63d86f-fe82-498c-8527-5ac685a1d7b7",
      "name": "Redis Chat Memory"
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 24; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2432,
        1472
      ],
      "id": "6cad8a89-1ca9-4e89-8831-5bd7702203f2",
      "name": "Code4",
      "executeOnce": true
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolDescription": "Provides text inputs to the AI agent allowing to identifying linking phrases and complete the necessary tasks.",
        "qdrantCollection": {
          "__rl": true,
          "value": "linking_words",
          "mode": "list",
          "cachedResultName": "linking_words"
        },
        "topK": 20,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        -1936,
        1296
      ],
      "id": "fd510d31-db7b-4948-a2c2-54cff416d2d7",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "id": "f4OYPtbhAv74DCJ1",
          "name": "Qdrant API"
        }
      }
    },
    {
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "typeVersion": 1,
      "position": [
        -1936,
        1248
      ],
      "id": "7d16006a-13cb-4b29-af6a-2fcd60afd9fe",
      "name": "Embeddings Cohere",
      "credentials": {
        "cohereApi": {
          "id": "2KLyMaAZiNcfpMpr",
          "name": "CohereApi account"
        }
      }
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1.3,
      "position": [
        -976,
        1744
      ],
      "id": "268a65bd-ea03-4646-a273-7a6999b74431",
      "name": "Supabase Vector Store",
      "disabled": true
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        -976,
        1760
      ],
      "id": "26d1582e-3dd5-4d1d-8e94-ec92f1dc8a14",
      "name": "Create a row in Supabase",
      "disabled": true
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 48; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2544,
        1184
      ],
      "id": "b9e0dda1-3d56-44d4-8823-e6e4e1745a96",
      "name": "Code",
      "executeOnce": true
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -2400,
        3072
      ],
      "id": "1ff36bce-223d-4c90-bb38-3640e32a627f",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -4032,
        2096
      ],
      "id": "1a3c7924-0b33-4109-8e4e-c59915d16f3e",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Transcript:\n\n{{ $('Loop Over Items2').item.json.Transcript }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=You are a specialized AI agent designed to analyze and extract insights from 5-second video hooks. Your primary function is to evaluate short-form content hooks (typically from YouTube Shorts, TikTok, Instagram Reels, or the opening of longer YouTube videos) and provide actionable analysis on why they work and how to replicate their success.\n\n## Your Task\n\nAnalyze the provided 5-second hook and its transcript to:\n\n1. Identify the core hook mechanism being used\n2. Explain WHY this hook is effective at capturing attention\n3. Provide strategic guidance on HOW to apply this hook pattern\n4. Categorize the hook type and psychological triggers employed\n5. Extract the key elements that make it work\n6. **Analyze the narrative flow and how it propels the story forward**\n\n## What Makes an Effective Hook\n\nStrong hooks typically employ one or more of these elements:\n\n- **Pattern Interrupts**: Unexpected statements or visuals that break scrolling autopilot\n- **Curiosity Gaps**: Posing questions or incomplete information that demands resolution\n- **Bold Claims**: Provocative or controversial statements that challenge assumptions\n- **Personal Stakes**: \"You\" language that makes it immediately relevant to the viewer\n- **Urgency/Scarcity**: Time-sensitive or exclusive information\n- **Relatability**: \"If you've ever...\" moments that create instant connection\n- **Contrast/Paradox**: Juxtaposing unexpected elements\n- **Social Proof**: References to widespread behavior or trending topics\n- **Emotional Triggers**: Fear, excitement, frustration, curiosity, FOMO\n\n## Narrative Flow Analysis\n\nEvery effective hook establishes a narrative trajectory that propels viewers into the content. Analyze:\n\n- **Setup/Promise**: What journey or payoff does the hook implicitly promise?\n- **Momentum Creation**: How does it create forward motion that makes stopping feel unsatisfying?\n- **Mental Positioning**: Where does it leave the viewer's mind? (Questioning, anticipating, concerned, excited)\n- **Implied Structure**: What content structure does this hook set up? (problem-solution, question-answer, story arc, step-by-step, reveal, transformation)\n- **Tension/Resolution Dynamic**: What gap or tension is opened that demands closure?\n- **Viewer Expectation**: What does the audience now expect to see/learn/experience next?\n\nThe narrative flow should explain not just how the hook grabs attention, but how it creates an irresistible pull INTO the rest of the content.\n\n## Analysis Framework\n\nFor each hook provided, you must:\n\n1. **Extract the Hook**: Identify the exact hook statement/question/claim being made\n2. **Hook Type**: Categorize the primary mechanism (question, claim, pattern interrupt, etc.)\n3. **Why It Works**: Provide 2-4 specific psychological or structural reasons this hook is effective (50-100 words)\n4. **Narrative Flow**: Explain how this hook establishes momentum and propels the story forward (50-100 words)\n5. **Usage Guidelines**: Explain how to adapt this hook pattern to other topics/contexts (50-100 words)\n6. **Key Elements**: Break down the specific components that can be replicated\n7. **Target Audience Appeal**: Identify what type of viewer this hook resonates with\n8. **Emotional Trigger**: Name the primary emotion or psychological driver\n\n## Quality Standards\n\nYour analysis should:\n- Be specific and actionable, not generic\n- Focus on replicable patterns, not just description\n- Identify the underlying psychology, not just surface features\n- Provide practical guidance for content creators\n- Explain the narrative momentum and content structure implied by the hook\n- Be concise but comprehensive\n\n## Output Requirements\n\nYour analysis must be formatted as valid JSON conforming to the provided schema. Each hook analysis should provide creators with a clear understanding of both WHY the hook works and HOW to apply similar techniques, including how it drives narrative momentum.\n\n## Analysis Depth\n\nGo beyond surface-level observations:\n- Don't just say \"it asks a question\" - explain WHY that particular question structure works\n- Don't just say \"it's relatable\" - identify the specific pain point or experience being tapped\n- Don't just describe what happens - explain the psychological mechanism being activated\n- Don't just note that it creates curiosity - explain what narrative journey it promises and how it establishes forward momentum\n\nYour goal is to help content creators understand hook mechanics at a deep enough level to create their own effective hooks with strong narrative flow."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -3040,
        2112
      ],
      "id": "d408d5d1-0ec5-4572-9c54-c960daae83a9",
      "name": "AI Agent1"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"required\": [\"hook_analysis\"],\n  \"properties\": {\n    \"hook_analysis\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"original_transcript\",\n        \"hook_statement\",\n        \"hook_type\",\n        \"why_it_works\",\n        \"narrative_flow\",\n        \"usage_guidelines\",\n        \"key_elements\",\n        \"psychological_triggers\"\n      ],\n      \"properties\": {\n        \"original_transcript\": {\n          \"type\": \"string\",\n          \"description\": \"The exact transcript of the 5-second hook as provided\",\n          \"minLength\": 5,\n          \"maxLength\": 500\n        },\n        \"hook_statement\": {\n          \"type\": \"string\",\n          \"description\": \"The core hook extracted - the specific phrase/question/claim that does the heavy lifting\",\n          \"minLength\": 5,\n          \"maxLength\": 300\n        },\n        \"hook_type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"question\",\n            \"bold_claim\",\n            \"pattern_interrupt\",\n            \"curiosity_gap\",\n            \"problem_statement\",\n            \"controversial_take\",\n            \"relatable_scenario\",\n            \"shocking_statistic\",\n            \"personal_story_tease\",\n            \"challenge_assumption\",\n            \"urgent_warning\",\n            \"secret_reveal\"\n          ],\n          \"description\": \"Primary categorization of the hook mechanism\"\n        },\n        \"why_it_works\": {\n          \"type\": \"string\",\n          \"description\": \"Detailed explanation of 2-4 specific reasons this hook is effective (50-100 words)\",\n          \"minLength\": 50,\n          \"maxLength\": 500\n        },\n        \"narrative_flow\": {\n          \"type\": \"object\",\n          \"required\": [\n            \"flow_description\",\n            \"implied_structure\",\n            \"momentum_mechanism\",\n            \"viewer_mental_state\"\n          ],\n          \"description\": \"Analysis of how the hook establishes narrative trajectory and propels content forward\",\n          \"properties\": {\n            \"flow_description\": {\n              \"type\": \"string\",\n              \"description\": \"Detailed explanation of how this hook creates narrative momentum (50-100 words)\",\n              \"minLength\": 50,\n              \"maxLength\": 500\n            },\n            \"implied_structure\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"problem_solution\",\n                \"question_answer\",\n                \"before_after\",\n                \"mistake_correction\",\n                \"story_arc\",\n                \"step_by_step_tutorial\",\n                \"reveal_payoff\",\n                \"list_countdown\",\n                \"comparison_contrast\",\n                \"transformation_journey\",\n                \"challenge_resolution\",\n                \"mystery_unveiling\"\n              ],\n              \"description\": \"The content structure that this hook naturally sets up\"\n            },\n            \"momentum_mechanism\": {\n              \"type\": \"string\",\n              \"description\": \"Specific explanation of what creates the forward pull (e.g., 'Opens information gap that demands closure', 'Creates problem requiring solution')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"viewer_mental_state\": {\n              \"type\": \"string\",\n              \"description\": \"Where the hook leaves the viewer's mind (e.g., 'Questioning their current methods', 'Eager to see the reveal', 'Anxious about missing information')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"expected_payoff\": {\n              \"type\": \"string\",\n              \"description\": \"What the viewer now expects to receive from continuing (e.g., 'A specific technique demonstration', 'Validation of their suspicions', 'The secret being teased')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"tension_opened\": {\n              \"type\": \"string\",\n              \"description\": \"The specific gap, question, or tension that requires resolution\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            }\n          }\n        },\n        \"usage_guidelines\": {\n          \"type\": \"string\",\n          \"description\": \"Practical guidance on how to adapt and apply this hook pattern (50-100 words)\",\n          \"minLength\": 50,\n          \"maxLength\": 500\n        },\n        \"key_elements\": {\n          \"type\": \"array\",\n          \"description\": \"Specific replicable components of this hook\",\n          \"minItems\": 2,\n          \"maxItems\": 6,\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\"element\", \"description\"],\n            \"properties\": {\n              \"element\": {\n                \"type\": \"string\",\n                \"description\": \"Name of the hook element (e.g., 'Second-person address', 'Specific number')\",\n                \"minLength\": 3,\n                \"maxLength\": 100\n              },\n              \"description\": {\n                \"type\": \"string\",\n                \"description\": \"Brief explanation of how this element contributes to effectiveness\",\n                \"minLength\": 10,\n                \"maxLength\": 200\n              }\n            }\n          }\n        },\n        \"psychological_triggers\": {\n          \"type\": \"array\",\n          \"description\": \"Primary psychological or emotional drivers activated by this hook\",\n          \"minItems\": 1,\n          \"maxItems\": 4,\n          \"items\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"curiosity\",\n              \"fear_of_missing_out\",\n              \"fear\",\n              \"excitement\",\n              \"frustration\",\n              \"validation\",\n              \"self_interest\",\n              \"surprise\",\n              \"anger\",\n              \"hope\",\n              \"insecurity\",\n              \"desire_for_improvement\",\n              \"social_belonging\",\n              \"status_anxiety\"\n            ]\n          }\n        },\n        \"target_audience_appeal\": {\n          \"type\": \"string\",\n          \"description\": \"Description of who this hook resonates with and why\",\n          \"minLength\": 20,\n          \"maxLength\": 200\n        },\n        \"effectiveness_score\": {\n          \"type\": \"integer\",\n          \"description\": \"Subjective rating of hook strength from 1-10\",\n          \"minimum\": 1,\n          \"maximum\": 10\n        },\n        \"improvement_suggestions\": {\n          \"type\": \"string\",\n          \"description\": \"Optional suggestions for how this hook could be made even stronger\",\n          \"maxLength\": 300\n        },\n        \"similar_hook_examples\": {\n          \"type\": \"array\",\n          \"description\": \"2-3 examples of how this hook pattern could be adapted to different topics\",\n          \"minItems\": 2,\n          \"maxItems\": 4,\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\"topic\", \"adapted_hook\"],\n            \"properties\": {\n              \"topic\": {\n                \"type\": \"string\",\n                \"description\": \"The subject area (e.g., 'Fitness', 'Productivity', 'Cooking')\"\n              },\n              \"adapted_hook\": {\n                \"type\": \"string\",\n                \"description\": \"Example of this hook pattern applied to that topic\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"metadata\": {\n      \"type\": \"object\",\n      \"description\": \"Optional metadata about the analysis\",\n      \"properties\": {\n        \"analysis_timestamp\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\",\n          \"description\": \"ISO 8601 timestamp of when analysis was performed\"\n        },\n        \"content_platform\": {\n          \"type\": \"string\",\n          \"enum\": [\"youtube\", \"tiktok\", \"instagram\", \"youtube_short\", \"unknown\"],\n          \"description\": \"Platform where this hook was originally used\"\n        },\n        \"content_category\": {\n          \"type\": \"string\",\n          \"description\": \"Content category (e.g., 'business', 'fitness', 'tech', 'lifestyle')\"\n        }\n      }\n    }\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -2928,
        2256
      ],
      "id": "89ee209e-7e21-479d-a386-d2689c2d8c01",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -2928,
        2368
      ],
      "id": "abee0c14-cfa9-4a34-b37d-513da61cbd7e",
      "name": "OpenAI Chat Model2",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -2992,
        1968
      ],
      "id": "88f24889-3234-4ef4-b6ba-2a8915411391",
      "name": "OpenAI Chat Model3",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 24; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -3216,
        2112
      ],
      "id": "f882c1f2-d876-47aa-90fa-186895f1ed70",
      "name": "Code5",
      "executeOnce": true
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "=1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 836344211,
          "mode": "list",
          "cachedResultName": "40 Popular YouTube Videos Short Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=836344211"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "DONE"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -3696,
        2096
      ],
      "id": "929768df-1f18-4761-900a-92c8c438c9cb",
      "name": "Get row(s) in sheet1",
      "retryOnFail": true,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        -2816,
        1968
      ],
      "id": "21e8b08b-be7a-4c9a-a850-8eebedd70147",
      "name": "Redis Chat Memory1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -3440,
        2096
      ],
      "id": "29f88870-885f-41e5-9472-194336a49c4c",
      "name": "Loop Over Items2"
    },
    {
      "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": [
        -3040,
        2256
      ],
      "id": "14a51779-89c1-49ff-b99f-46c8f72d7206",
      "name": "Anthropic Chat Model",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 792322845,
          "mode": "list",
          "cachedResultName": "Sheet4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=792322845"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "DONE",
            "original_transcript": "={{ $json.output.hook_analysis.original_transcript }}",
            "hook_statement": "={{ $json.output.hook_analysis.hook_statement }}",
            "hook_type": "={{ $json.output.hook_analysis.hook_type }}",
            "why_it_works": "={{ $json.output.hook_analysis.why_it_works }}",
            "flow_description": "={{ $json.output.hook_analysis.narrative_flow.flow_description }}",
            "implied_structure": "={{ $json.output.hook_analysis.narrative_flow.implied_structure }}",
            "momentum_mechanism": "={{ $json.output.hook_analysis.narrative_flow.momentum_mechanism }}",
            "viewer_mental_state": "={{ $json.output.hook_analysis.narrative_flow.viewer_mental_state }}",
            "expected_payoff": "={{ $json.output.hook_analysis.narrative_flow.expected_payoff }}",
            "tension_opened": "={{ $json.output.hook_analysis.narrative_flow.tension_opened }}",
            "usage_guidelines": "={{ $json.output.hook_analysis.usage_guidelines }}",
            "key_elements": "=(a) {{ $json.output.hook_analysis.key_elements[0].element }}: {{ $json.output.hook_analysis.key_elements[0].description }}{{ \"\\n\" }}{{ \"\\n\" }}(b) {{ $json.output.hook_analysis.key_elements[1].element }}: {{ $json.output.hook_analysis.key_elements[1].description }}{{ \"\\n\" }}{{ \"\\n\" }}(c) {{ $json.output.hook_analysis.key_elements[2].element }}: {{ $json.output.hook_analysis.key_elements[2].description }}",
            "psychological_triggers": "={{ $json.output.hook_analysis.psychological_triggers[0] }} // {{ $json.output.hook_analysis.psychological_triggers[1] }} // {{ $json.output.hook_analysis.psychological_triggers[2] }} // {{ $json.output.hook_analysis.psychological_triggers[3] }}",
            "similar_hook_examples": "=(a) {{ $json.output.hook_analysis.similar_hook_examples[0].topic }}: {{ $json.output.hook_analysis.similar_hook_examples[0].adapted_hook }}{{ \"\\n\" }}{{ \"\\n\" }}(b) {{ $json.output.hook_analysis.similar_hook_examples[1].topic }}: {{ $json.output.hook_analysis.similar_hook_examples[1].adapted_hook }}{{ \"\\n\" }}{{ \"\\n\" }}(c) {{ $json.output.hook_analysis.similar_hook_examples[2].topic }}: {{ $json.output.hook_analysis.similar_hook_examples[2].adapted_hook }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "original_transcript",
              "displayName": "original_transcript",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "hook_statement",
              "displayName": "hook_statement",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "hook_type",
              "displayName": "hook_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "why_it_works",
              "displayName": "why_it_works",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "flow_description",
              "displayName": "flow_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "implied_structure",
              "displayName": "implied_structure",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "momentum_mechanism",
              "displayName": "momentum_mechanism",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "viewer_mental_state",
              "displayName": "viewer_mental_state",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "expected_payoff",
              "displayName": "expected_payoff",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "tension_opened",
              "displayName": "tension_opened",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "usage_guidelines",
              "displayName": "usage_guidelines",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "key_elements",
              "displayName": "key_elements",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "psychological_triggers",
              "displayName": "psychological_triggers",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "similar_hook_examples",
              "displayName": "similar_hook_examples",
              "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": [
        -2416,
        2400
      ],
      "id": "fb9d6bad-b081-4ef7-b949-da2f63bd8a77",
      "name": "Append row in sheet1",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "list",
          "cachedResultName": "YouTube (NeuroEverything) Master Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 836344211,
          "mode": "list",
          "cachedResultName": "40 Popular YouTube Videos Short Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=836344211"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('Loop Over Items2').item.json.row_number }}",
            "STATUS": "FLIP"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Creator",
              "displayName": "Creator",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Transcript",
              "displayName": "Transcript",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Length",
              "displayName": "Length",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "5s Hook",
              "displayName": "5s Hook",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Language Style",
              "displayName": "Language Style",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Human Elements",
              "displayName": "Human Elements",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Emotional Triggers",
              "displayName": "Emotional Triggers",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Pacing",
              "displayName": "Pacing",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Key Moments",
              "displayName": "Key Moments",
              "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": [
        -2224,
        2400
      ],
      "id": "54037d9f-094e-4046-a4a3-8394a2371db2",
      "name": "Update row in sheet",
      "retryOnFail": true,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "TO BE VETTED"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        1440,
        1328
      ],
      "id": "09b1a5a2-18f4-4d4c-97a4-2f71fe2f463b",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "TO BE VETTED",
            "linking_phrase": "={{ $json.linking_phrase }}",
            "statement_before": "={{ $json.statement_before }}",
            "statement_after": "={{ $json.statement_after }}",
            "usage_description": "={{ $json.usage_description }}",
            "transition_type": "={{ $json.transition_type }}",
            "verified_unique": "={{ $json.verified_unique }}"
          },
          "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,
              "removed": false
            },
            {
              "id": "linking_phrase",
              "displayName": "linking_phrase",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "statement_before",
              "displayName": "statement_before",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "statement_after",
              "displayName": "statement_after",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "usage_description",
              "displayName": "usage_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "transition_type",
              "displayName": "transition_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "verified_unique",
              "displayName": "verified_unique",
              "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": [
        2688,
        1712
      ],
      "id": "df510b33-e071-476b-a944-cd015e527c22",
      "name": "Append row in sheet",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.results",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1984,
        992
      ],
      "id": "4c7f7274-9264-4ed1-bed6-1551202a6877",
      "name": "Split Out"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "4fc11998-08cb-47ed-a25a-e4ba44592d0e",
              "leftValue": "={{ $json.confidence }}",
              "rightValue": "high",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2192,
        992
      ],
      "id": "d4c9c742-ba40-43bc-b187-e3146e9a7964",
      "name": "If"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7edb2066-fed5-4717-88d3-b68dca491f53",
              "leftValue": "={{ $json.similarity_type }}",
              "rightValue": "exact",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2432,
        816
      ],
      "id": "b0f162c7-401c-42c9-9570-f884dadf48a2",
      "name": "If1"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $json.row_number }}",
            "STATUS": "REPLICATE"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "fragment",
              "displayName": "fragment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_before",
              "displayName": "statement_before",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_after",
              "displayName": "statement_after",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "usage_description",
              "displayName": "usage_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "transition_type",
              "displayName": "transition_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "verified_unique",
              "displayName": "verified_unique",
              "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": [
        2640,
        832
      ],
      "id": "d8043a3f-fe17-4050-9981-09653da1585e",
      "name": "Update row in sheet1",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $json.row_number }}",
            "STATUS": "REPLICATE"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "fragment",
              "displayName": "fragment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_before",
              "displayName": "statement_before",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_after",
              "displayName": "statement_after",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "usage_description",
              "displayName": "usage_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "transition_type",
              "displayName": "transition_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "verified_unique",
              "displayName": "verified_unique",
              "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": [
        2512,
        1152
      ],
      "id": "d9acc82f-6592-4742-a19a-f81c81a3c66d",
      "name": "Update row in sheet2",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "path": "97f7f672-173a-4ef4-aeb8-770755db7b3b",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        592,
        960
      ],
      "id": "ed4bb4e7-559e-4a06-a867-da48dd23dc1c",
      "name": "Webhook",
      "webhookId": "97f7f672-173a-4ef4-aeb8-770755db7b3b"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7edb2066-fed5-4717-88d3-b68dca491f53",
              "leftValue": "={{ $json.output.matches_found }}",
              "rightValue": "exact",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1792,
        1168
      ],
      "id": "fed53754-ce9b-4906-88fc-a1cbff261a05",
      "name": "If2"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('Get row(s) in sheet3').item.json.row_number }}",
            "STATUS": "UNIQUE"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "fragment",
              "displayName": "fragment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_before",
              "displayName": "statement_before",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_after",
              "displayName": "statement_after",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "usage_description",
              "displayName": "usage_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "transition_type",
              "displayName": "transition_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "verified_unique",
              "displayName": "verified_unique",
              "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": [
        2512,
        1376
      ],
      "id": "683d89d8-aac4-4204-957f-186f21573110",
      "name": "Update row in sheet3",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "numberInputs": 4
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        3136,
        608
      ],
      "id": "ae5ab2f1-3c23-45cd-9b72-5f4720c76c8e",
      "name": "Merge"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Transcript:\n\n{{ $('Get row(s) in sheet2').item.json.Transcript }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=You are a specialized AI agent designed to analyze and extract insights from 5-second video hooks. Your primary function is to evaluate short-form content hooks (typically from YouTube Shorts, TikTok, Instagram Reels, or the opening of longer YouTube videos) and provide actionable analysis on why they work and how to replicate their success.\n\n## Your Task\n\nAnalyze the provided 5-second hook and its transcript to:\n\n1. Identify the core hook mechanism being used\n2. Explain WHY this hook is effective at capturing attention\n3. Provide strategic guidance on HOW to apply this hook pattern\n4. Categorize the hook type and psychological triggers employed\n5. Extract the key elements that make it work\n6. **Analyze the narrative flow and how it propels the story forward**\n\n## What Makes an Effective Hook\n\nStrong hooks typically employ one or more of these elements:\n\n- **Pattern Interrupts**: Unexpected statements or visuals that break scrolling autopilot\n- **Curiosity Gaps**: Posing questions or incomplete information that demands resolution\n- **Bold Claims**: Provocative or controversial statements that challenge assumptions\n- **Personal Stakes**: \"You\" language that makes it immediately relevant to the viewer\n- **Urgency/Scarcity**: Time-sensitive or exclusive information\n- **Relatability**: \"If you've ever...\" moments that create instant connection\n- **Contrast/Paradox**: Juxtaposing unexpected elements\n- **Social Proof**: References to widespread behavior or trending topics\n- **Emotional Triggers**: Fear, excitement, frustration, curiosity, FOMO\n\n## Narrative Flow Analysis\n\nEvery effective hook establishes a narrative trajectory that propels viewers into the content. Analyze:\n\n- **Setup/Promise**: What journey or payoff does the hook implicitly promise?\n- **Momentum Creation**: How does it create forward motion that makes stopping feel unsatisfying?\n- **Mental Positioning**: Where does it leave the viewer's mind? (Questioning, anticipating, concerned, excited)\n- **Implied Structure**: What content structure does this hook set up? (problem-solution, question-answer, story arc, step-by-step, reveal, transformation)\n- **Tension/Resolution Dynamic**: What gap or tension is opened that demands closure?\n- **Viewer Expectation**: What does the audience now expect to see/learn/experience next?\n\nThe narrative flow should explain not just how the hook grabs attention, but how it creates an irresistible pull INTO the rest of the content.\n\n## Analysis Framework\n\nFor each hook provided, you must:\n\n1. **Extract the Hook**: Identify the exact hook statement/question/claim being made\n2. **Hook Type**: Categorize the primary mechanism (question, claim, pattern interrupt, etc.)\n3. **Why It Works**: Provide 2-4 specific psychological or structural reasons this hook is effective (50-100 words)\n4. **Narrative Flow**: Explain how this hook establishes momentum and propels the story forward (50-100 words)\n5. **Usage Guidelines**: Explain how to adapt this hook pattern to other topics/contexts (50-100 words)\n6. **Key Elements**: Break down the specific components that can be replicated\n7. **Target Audience Appeal**: Identify what type of viewer this hook resonates with\n8. **Emotional Trigger**: Name the primary emotion or psychological driver\n\n## Quality Standards\n\nYour analysis should:\n- Be specific and actionable, not generic\n- Focus on replicable patterns, not just description\n- Identify the underlying psychology, not just surface features\n- Provide practical guidance for content creators\n- Explain the narrative momentum and content structure implied by the hook\n- Be concise but comprehensive\n\n## Output Requirements\n\nYour analysis must be formatted as valid JSON conforming to the provided schema. Each hook analysis should provide creators with a clear understanding of both WHY the hook works and HOW to apply similar techniques, including how it drives narrative momentum.\n\n## Analysis Depth\n\nGo beyond surface-level observations:\n- Don't just say \"it asks a question\" - explain WHY that particular question structure works\n- Don't just say \"it's relatable\" - identify the specific pain point or experience being tapped\n- Don't just describe what happens - explain the psychological mechanism being activated\n- Don't just note that it creates curiosity - explain what narrative journey it promises and how it establishes forward momentum\n\nYour goal is to help content creators understand hook mechanics at a deep enough level to create their own effective hooks with strong narrative flow."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1824,
        1888
      ],
      "id": "484c65f2-ffc7-4f48-a4b8-ce8f2ca7a030",
      "name": "AI Agent2",
      "disabled": true
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"required\": [\"hook_analysis\"],\n  \"properties\": {\n    \"hook_analysis\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"original_transcript\",\n        \"hook_statement\",\n        \"hook_type\",\n        \"why_it_works\",\n        \"narrative_flow\",\n        \"usage_guidelines\",\n        \"key_elements\",\n        \"psychological_triggers\"\n      ],\n      \"properties\": {\n        \"original_transcript\": {\n          \"type\": \"string\",\n          \"description\": \"The exact transcript of the 5-second hook as provided\",\n          \"minLength\": 5,\n          \"maxLength\": 500\n        },\n        \"hook_statement\": {\n          \"type\": \"string\",\n          \"description\": \"The core hook extracted - the specific phrase/question/claim that does the heavy lifting\",\n          \"minLength\": 5,\n          \"maxLength\": 300\n        },\n        \"hook_type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"question\",\n            \"bold_claim\",\n            \"pattern_interrupt\",\n            \"curiosity_gap\",\n            \"problem_statement\",\n            \"controversial_take\",\n            \"relatable_scenario\",\n            \"shocking_statistic\",\n            \"personal_story_tease\",\n            \"challenge_assumption\",\n            \"urgent_warning\",\n            \"secret_reveal\"\n          ],\n          \"description\": \"Primary categorization of the hook mechanism\"\n        },\n        \"why_it_works\": {\n          \"type\": \"string\",\n          \"description\": \"Detailed explanation of 2-4 specific reasons this hook is effective (50-100 words)\",\n          \"minLength\": 50,\n          \"maxLength\": 500\n        },\n        \"narrative_flow\": {\n          \"type\": \"object\",\n          \"required\": [\n            \"flow_description\",\n            \"implied_structure\",\n            \"momentum_mechanism\",\n            \"viewer_mental_state\"\n          ],\n          \"description\": \"Analysis of how the hook establishes narrative trajectory and propels content forward\",\n          \"properties\": {\n            \"flow_description\": {\n              \"type\": \"string\",\n              \"description\": \"Detailed explanation of how this hook creates narrative momentum (50-100 words)\",\n              \"minLength\": 50,\n              \"maxLength\": 500\n            },\n            \"implied_structure\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"problem_solution\",\n                \"question_answer\",\n                \"before_after\",\n                \"mistake_correction\",\n                \"story_arc\",\n                \"step_by_step_tutorial\",\n                \"reveal_payoff\",\n                \"list_countdown\",\n                \"comparison_contrast\",\n                \"transformation_journey\",\n                \"challenge_resolution\",\n                \"mystery_unveiling\"\n              ],\n              \"description\": \"The content structure that this hook naturally sets up\"\n            },\n            \"momentum_mechanism\": {\n              \"type\": \"string\",\n              \"description\": \"Specific explanation of what creates the forward pull (e.g., 'Opens information gap that demands closure', 'Creates problem requiring solution')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"viewer_mental_state\": {\n              \"type\": \"string\",\n              \"description\": \"Where the hook leaves the viewer's mind (e.g., 'Questioning their current methods', 'Eager to see the reveal', 'Anxious about missing information')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"expected_payoff\": {\n              \"type\": \"string\",\n              \"description\": \"What the viewer now expects to receive from continuing (e.g., 'A specific technique demonstration', 'Validation of their suspicions', 'The secret being teased')\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            },\n            \"tension_opened\": {\n              \"type\": \"string\",\n              \"description\": \"The specific gap, question, or tension that requires resolution\",\n              \"minLength\": 20,\n              \"maxLength\": 200\n            }\n          }\n        },\n        \"usage_guidelines\": {\n          \"type\": \"string\",\n          \"description\": \"Practical guidance on how to adapt and apply this hook pattern (50-100 words)\",\n          \"minLength\": 50,\n          \"maxLength\": 500\n        },\n        \"key_elements\": {\n          \"type\": \"array\",\n          \"description\": \"Specific replicable components of this hook\",\n          \"minItems\": 2,\n          \"maxItems\": 6,\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\"element\", \"description\"],\n            \"properties\": {\n              \"element\": {\n                \"type\": \"string\",\n                \"description\": \"Name of the hook element (e.g., 'Second-person address', 'Specific number')\",\n                \"minLength\": 3,\n                \"maxLength\": 100\n              },\n              \"description\": {\n                \"type\": \"string\",\n                \"description\": \"Brief explanation of how this element contributes to effectiveness\",\n                \"minLength\": 10,\n                \"maxLength\": 200\n              }\n            }\n          }\n        },\n        \"psychological_triggers\": {\n          \"type\": \"array\",\n          \"description\": \"Primary psychological or emotional drivers activated by this hook\",\n          \"minItems\": 1,\n          \"maxItems\": 4,\n          \"items\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"curiosity\",\n              \"fear_of_missing_out\",\n              \"fear\",\n              \"excitement\",\n              \"frustration\",\n              \"validation\",\n              \"self_interest\",\n              \"surprise\",\n              \"anger\",\n              \"hope\",\n              \"insecurity\",\n              \"desire_for_improvement\",\n              \"social_belonging\",\n              \"status_anxiety\"\n            ]\n          }\n        },\n        \"target_audience_appeal\": {\n          \"type\": \"string\",\n          \"description\": \"Description of who this hook resonates with and why\",\n          \"minLength\": 20,\n          \"maxLength\": 200\n        },\n        \"effectiveness_score\": {\n          \"type\": \"integer\",\n          \"description\": \"Subjective rating of hook strength from 1-10\",\n          \"minimum\": 1,\n          \"maximum\": 10\n        },\n        \"improvement_suggestions\": {\n          \"type\": \"string\",\n          \"description\": \"Optional suggestions for how this hook could be made even stronger\",\n          \"maxLength\": 300\n        },\n        \"similar_hook_examples\": {\n          \"type\": \"array\",\n          \"description\": \"2-3 examples of how this hook pattern could be adapted to different topics\",\n          \"minItems\": 2,\n          \"maxItems\": 4,\n          \"items\": {\n            \"type\": \"object\",\n            \"required\": [\"topic\", \"adapted_hook\"],\n            \"properties\": {\n              \"topic\": {\n                \"type\": \"string\",\n                \"description\": \"The subject area (e.g., 'Fitness', 'Productivity', 'Cooking')\"\n              },\n              \"adapted_hook\": {\n                \"type\": \"string\",\n                \"description\": \"Example of this hook pattern applied to that topic\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"metadata\": {\n      \"type\": \"object\",\n      \"description\": \"Optional metadata about the analysis\",\n      \"properties\": {\n        \"analysis_timestamp\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\",\n          \"description\": \"ISO 8601 timestamp of when analysis was performed\"\n        },\n        \"content_platform\": {\n          \"type\": \"string\",\n          \"enum\": [\"youtube\", \"tiktok\", \"instagram\", \"youtube_short\", \"unknown\"],\n          \"description\": \"Platform where this hook was originally used\"\n        },\n        \"content_category\": {\n          \"type\": \"string\",\n          \"description\": \"Content category (e.g., 'business', 'fitness', 'tech', 'lifestyle')\"\n        }\n      }\n    }\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1888,
        2016
      ],
      "id": "ddadccfc-e760-4fa4-9b65-582e6d4ec2f2",
      "name": "Structured Output Parser2",
      "disabled": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1888,
        2128
      ],
      "id": "a1e84677-52ed-4e31-9197-68999ee13bb9",
      "name": "OpenAI Chat Model4",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1824,
        1776
      ],
      "id": "a300432f-e22d-4973-b260-05f4ca52c43a",
      "name": "OpenAI Chat Model5",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 24; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1456,
        1888
      ],
      "id": "4cb74e62-0015-4740-ab23-d451502792a8",
      "name": "Code6",
      "executeOnce": true,
      "disabled": true
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        2464,
        2256
      ],
      "id": "c6e7085c-921a-4353-926c-984a27b09ca0",
      "name": "Simple Memory1",
      "disabled": true
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        1136,
        1888
      ],
      "id": "2f33844b-5623-462f-936d-22547f381288",
      "name": "Schedule Trigger1",
      "disabled": true
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "=1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 836344211,
          "mode": "list",
          "cachedResultName": "40 Popular YouTube Videos Short Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=836344211"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "DONE"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1328,
        1888
      ],
      "id": "7513e1fb-b692-412e-a2bd-97ed509b91f4",
      "name": "Get row(s) in sheet2",
      "disabled": true
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        1808,
        2016
      ],
      "id": "4da1c441-a376-4cfd-ab56-1c55aac01e7a",
      "name": "Redis Chat Memory2",
      "disabled": true
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "=1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "TO BE VETTED"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        544,
        1168
      ],
      "id": "15f3f015-8a54-480a-9cf9-be07f2072df8",
      "name": "Get row(s) in sheet3",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 24; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1248,
        1168
      ],
      "id": "b0ec2348-09c7-4f87-8fbe-0a3ba9926027",
      "name": "Code1",
      "executeOnce": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Linking Phrase:\n\n{{ $('Get row(s) in sheet3').item.json.fragment }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=Linking Phrase Detection Agent - Configuration\nSystem Message\nYou are a specialized AI agent designed to identify duplicate or semantically similar linking phrases within a Google Sheet database. Your primary function is to analyze input linking phrases and determine if they appear elsewhere in the sheet, even when they are not identical but carry the same meaning.\nCore Responsibilities\n\nReceive Input: Accept a linking phrase provided by the user\nSemantic Analysis: Use careful thinking to understand the meaning and function of the linking phrase\nDatabase Search: Query the Google Sheet to retrieve all existing linking phrases\nSimilarity Detection: Identify phrases that are semantically equivalent, even if worded differently\nOutput Results: Return structured JSON with row numbers where similar phrases appear\n\nUnderstanding Linking Phrases\nLinking phrases are transitional words or phrases that connect ideas, sentences, or paragraphs. Examples include:\n\n\"In addition\"\n\"Furthermore\"\n\"On the other hand\"\n\"As a result\"\n\"Moreover\"\n\"In contrast\"\n\nSemantic Matching Guidelines\nTwo linking phrases should be considered the same if they:\n\nServe the same logical function (e.g., both show contrast, both show addition)\nCan be substituted for each other without changing the meaning\nBelong to the same semantic category\n\nExamples of semantic equivalence:\n\n\"Furthermore\" = \"Moreover\" = \"In addition\" = \"Additionally\"\n\"However\" = \"On the other hand\" = \"Nevertheless\" = \"Conversely\"\n\"Therefore\" = \"As a result\" = \"Consequently\" = \"Thus\"\n\"For example\" = \"For instance\" = \"Such as\"\n\nExamples of non-equivalence:\n\n\"However\" ≠ \"Furthermore\" (contrast vs. addition)\n\"Therefore\" ≠ \"In addition\" (causation vs. addition)\n\nThinking Process\nBefore determining matches, you must engage in explicit thinking:\n\nAnalyze the input phrase: What is its primary function? (contrast, addition, causation, exemplification, etc.)\nConsider variations: What other phrases serve the same function?\nReview retrieved phrases: For each phrase in the Google Sheet, ask:\n\nDoes it serve the same logical function?\nWould it be interchangeable in context?\nIs it semantically equivalent?\n\n\nApply fuzzy matching: Account for:\n\nDifferent word forms (e.g., \"Additional\" vs. \"Additionally\")\nMinor punctuation differences\nCapitalization differences\n\n\n\nTool Usage\nYou have access to a google_sheets tool with the following capabilities:\n\nread_range: Read data from specified cells\nsearch: Search for phrases within the sheet\n\nRecommended approach:\n\nUse the tool to retrieve all linking phrases from the relevant column\nIterate through the results in your thinking\nIdentify semantic matches\n\nOutput Requirements\nYou must output valid JSON adhering to the schema below. Do not include any text outside the JSON structure.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1488,
        1168
      ],
      "id": "46549eb8-78f5-41c1-b392-9d23c776e3bc",
      "name": "AI Agent3"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"required\": [\"input_phrase\", \"matches_found\", \"results\", \"analysis\"],\n  \"properties\": {\n    \"input_phrase\": {\n      \"type\": \"string\",\n      \"description\": \"The original linking phrase provided as input\"\n    },\n    \"matches_found\": {\n      \"type\": \"boolean\",\n      \"description\": \"Whether any semantically similar phrases were found in the Google Sheet\"\n    },\n    \"results\": {\n      \"type\": \"array\",\n      \"description\": \"Array of matching phrases and their locations\",\n      \"items\": {\n        \"type\": \"object\",\n        \"required\": [\"row_number\", \"matching_phrase\", \"similarity_type\"],\n        \"properties\": {\n          \"row_number\": {\n            \"type\": \"integer\",\n            \"description\": \"The row number in the Google Sheet where the match was found\",\n            \"minimum\": 1\n          },\n          \"matching_phrase\": {\n            \"type\": \"string\",\n            \"description\": \"The actual phrase found in the sheet\"\n          },\n          \"similarity_type\": {\n            \"type\": \"string\",\n            \"enum\": [\"exact\", \"semantic\"],\n            \"description\": \"Whether this is an exact match or a semantic match\"\n          },\n          \"confidence\": {\n            \"type\": \"string\",\n            \"enum\": [\"high\", \"medium\", \"low\"],\n            \"description\": \"Confidence level in the semantic match\"\n          },\n          \"reasoning\": {\n            \"type\": \"string\",\n            \"description\": \"Brief explanation of why this phrase was considered a match\"\n          }\n        }\n      }\n    },\n    \"analysis\": {\n      \"type\": \"object\",\n      \"required\": [\"function_category\", \"total_matches\"],\n      \"properties\": {\n        \"function_category\": {\n          \"type\": \"string\",\n          \"description\": \"The primary function of the linking phrase (e.g., 'addition', 'contrast', 'causation', 'exemplification', 'temporal', 'conclusion')\"\n        },\n        \"total_matches\": {\n          \"type\": \"integer\",\n          \"description\": \"Total number of matches found\",\n          \"minimum\": 0\n        },\n        \"exact_matches\": {\n          \"type\": \"integer\",\n          \"description\": \"Number of exact matches\",\n          \"minimum\": 0\n        },\n        \"semantic_matches\": {\n          \"type\": \"integer\",\n          \"description\": \"Number of semantic (non-exact) matches\",\n          \"minimum\": 0\n        }\n      }\n    }\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1552,
        1344
      ],
      "id": "7b3326bc-0cd0-4d7e-853a-45ed6e557dfd",
      "name": "Structured Output Parser3"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1568,
        1408
      ],
      "id": "968c643e-321e-416d-8701-e72df0766e35",
      "name": "OpenAI Chat Model6",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1",
          "mode": "list",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1488,
        1024
      ],
      "id": "8ac81997-81df-406e-acfa-7b874232642e",
      "name": "OpenAI Chat Model7",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        1632,
        1024
      ],
      "id": "ef96c3ca-b837-44f2-9ba1-b60de733c2c2",
      "name": "Redis Chat Memory3"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 236490528,
          "mode": "list",
          "cachedResultName": "Linking Phrases",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=236490528"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $json.row_number }}",
            "STATUS": "DUPLICATE"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "fragment",
              "displayName": "fragment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_before",
              "displayName": "statement_before",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "statement_after",
              "displayName": "statement_after",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "usage_description",
              "displayName": "usage_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "transition_type",
              "displayName": "transition_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "verified_unique",
              "displayName": "verified_unique",
              "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": [
        2640,
        656
      ],
      "id": "7e122fc2-3a4b-49c7-9383-b29b84fbed44",
      "name": "Update row in sheet4",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "url": "http://localhost:5678/webhook/97f7f672-173a-4ef4-aeb8-770755db7b3b",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        3040,
        1200
      ],
      "id": "c04c52f3-6f25-4685-a1e2-cab1bb5e0fc3",
      "name": "HTTP Request1",
      "alwaysOutputData": false,
      "executeOnce": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1008,
        912
      ],
      "id": "d1bb07a0-cb70-416e-8663-bed3145cc9e3",
      "name": "Loop Over Items3"
    },
    {
      "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": [
        -480,
        288
      ],
      "id": "e4944576-0892-4a2d-9c3b-e8f1cd5e8872",
      "name": "Anthropic Chat Model1",
      "credentials": {
        "anthropicApi": {
          "id": "5pMiFSPZL2r44q7L",
          "name": "Anthropic Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -1328,
        0
      ],
      "id": "21354450-e24d-48d4-a023-24350e4cf7ae",
      "name": "Schedule Trigger2"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "=1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "20 Popular YouTube Videos Long Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "STATUS",
              "lookupValue": "DONE"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1088,
        0
      ],
      "id": "b3f7fb00-2ef3-4330-ab02-47c1635e0fa4",
      "name": "Get row(s) in sheet4",
      "retryOnFail": true,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -896,
        0
      ],
      "id": "0efae535-eed2-407f-860c-08422534e6b3",
      "name": "Loop Over Items4"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Transcript:\n\n{{ $('Loop Over Items4').item.json.Transcript }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "options": {
          "systemMessage": "=## Your Task\n\nAnalyze the provided long-form transcript and:\n\n1. **Identify distinct narrative segments** - Break the transcript into 8-16 coherent sections based on what's actually present\n2. **Select appropriate frameworks** - Choose from the 24 (A->X) available frameworks to categorize each segment\n3. **Map the narrative flow** - Create a sequential representation (A→B→C→D→E...) showing how the narrative actually progresses\n4. **Explain the categorization** - Justify why each segment fits its assigned framework\n5. **Extract key content** - Summarize what happens in each narrative block\n\n## CRITICAL: Framework Selection Philosophy\n\n**DO NOT try to use all 36 frameworks.** You are selecting FROM a library of 36 possible frameworks, not fitting the transcript INTO all of them.\n\nYour job is to:\n- ✓ Identify what narrative structures are ACTUALLY PRESENT in the transcript\n- ✓ Select only the frameworks that genuinely match the content\n- ✓ Use between 8-16 blocks total (not 36!)\n- ✓ Repeat frameworks if they appear multiple times (e.g., two different Case Study Spotlight blocks)\n- ✗ Do NOT force frameworks that aren't there\n- ✗ Do NOT try to find examples of every framework\n- ✗ Do NOT stretch the transcript to fit more categories\n\n**Think of it this way:** You have a toolbox with 36 different tools. You're analyzing a transcript to see which 8-16 tools the creator actually used, in what order. Most tools will remain unused for any given transcript.\n\n## The 24 Available Narrative Frameworks\n\nYou may select from this library. Use only what fits:\n\nA. **Paradox** - An apparent contradiction that the episode resolves\nB. **Definition & Scope Lock** - Pin down slippery terms with operational definitions\nC. **Concept Genealogy** - Show where the idea came from and how it evolved\nD. **Comparative Anatomy** - Lay rival approaches side by side\nE. **Process Walkthrough** - \"How it actually works,\" step by step\nF. **Mechanism of Action** - Zoom inside the system to identify parts and flows\nG. **Fermi Estimate** - Size the problem with order-of-magnitude calculation\nH. **Data Story Walkthrough** - Let charts carry the narrative\nI. **Myth vs Reality** - Pick a misconception, explain why it survives, replace it\nJ. **Edge-Case Stress Test** - Drive the idea to extremes to expose brittleness\nK. **Case Study Spotlight** - Tell one specific, time-bounded story\nL. **Stakeholder Map** - Chart who wins, who loses, who blocks\nM. **Ethical Dilemma Lab** - Present trade-off with no clean solution\nN. **Thought Experiment** - Use idealized scenario to isolate a principle\nO. **Counterfactual What-If** - Ask what would change if one variable differed\nP. **Analogy Bridge** - Map structure from familiar domain to target concept\nQ. **Socratic Dialogue** - Advance through engineered questions and answers\nR. **Refutation Stack** - Build rebuttal with claim, grounds, warrant, backing\nS. **Pyramid Synthesis** - Start with conclusion, ladder supporting ideas underneath\nT. **ABT Micro-Arc** - Compose with And, But, Therefore pattern\nU. **Inverted Pyramid Recap** - Lead with most important takeaway, cascade context\nV. **Historical Context** - Position current topic within broader timeline\nW. **Evidence Evaluation** - Assess quality and reliability of supporting data\nX. **Synthesis Bridge** - Connect multiple concepts into unified understanding\n\n## Segmentation Guidelines\n\n**Number of Blocks**: You must identify between 8 and 16 narrative blocks total.\n\n**Selection Approach**:\n- Read the transcript and identify what narrative structures are genuinely present\n- Select ONLY the frameworks from the library of 24 that actually match the content\n- Most transcripts will use 8-12 different frameworks (with possible repeats)\n- A typical transcript will NOT use most of the 24 available frameworks\n\n\n**Block Boundaries**: Identify transitions where:\n- The narrative function shifts (from defining terms to comparing approaches)\n- A new major topic or sub-topic begins\n- The rhetorical mode changes (from explanation to case study to synthesis)\n- The speaker explicitly signals a transition (\"Now let's look at...\", \"But here's where it gets interesting...\")\n\n**Quality Standards**:\n- Each block should represent a meaningful narrative unit \n- Blocks should not be too granular (don't break every minor point into its own block)\n- The sequence should accurately reflect what the creator actually did\n- If a framework doesn't fit, don't use it—even if it seems like it \"should\" be there\n\n## Common Mistakes to Avoid\n\n❌ **Don't**: Try to find an example of every framework in the library\n❌ **Don't**: Force-fit a framework just because it seems like good pedagogy\n❌ **Don't**: Create artificial blocks to use more frameworks\n❌ **Don't**: Use 16 blocks just because that's the maximum\n\n✓ **Do**: Accurately reflect what narrative structures the creator actually employed\n✓ **Do**: Use the same framework twice if it genuinely appears twice\n✓ **Do**: Use fewer blocks (8-12) if that better represents the structure\n✓ **Do**: Leave most of the 36 frameworks unused for any given transcript\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -416,
        112
      ],
      "id": "44380c2b-9442-406f-9122-8c5d6e95ac59",
      "name": "AI Agent4"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"analysis\": {\n    \"total_blocks\": 10,\n    \"narrative_flow\": \"B→C→K→E→K→M→P→S→U→X\",\n    \"segments\": [\n      {\n        \"block_number\": 1,\n        \"framework_code\": \"B\",\n        \"framework_name\": \"Definition & Scope Lock\",\n        \"timestamp_range\": \"00:00-03:45\",\n        \"summary\": \"Speaker establishes operational definition of 'artificial intelligence' and distinguishes it from machine learning and deep learning\",\n        \"justification\": \"This segment clearly pins down slippery terminology with precise boundaries, which is the hallmark of Definition & Scope Lock\",\n        \"key_points\": [\n          \"AI defined as systems that exhibit intelligent behavior\",\n          \"Clear distinction made between AI, ML, and DL\"\n        ]\n      }\n    ],\n    \"framework_usage_summary\": {\n      \"frameworks_used\": [\n        {\n          \"code\": \"B\",\n          \"name\": \"Definition & Scope Lock\",\n          \"frequency\": 1\n        },\n        {\n          \"code\": \"K\",\n          \"name\": \"Case Study Spotlight\",\n          \"frequency\": 2\n        }\n      ],\n      \"frameworks_not_used\": [\"A\", \"D\", \"F\", \"G\", \"H\", \"I\", \"J\", \"L\", \"N\", \"O\", \"Q\", \"R\", \"T\", \"V\", \"W\"]\n    },\n    \"meta_analysis\": {\n      \"overall_narrative_strategy\": \"The transcript follows a foundational-to-applied structure, beginning with definitions, then illustrating with case studies, and synthesizing into actionable insights\",\n      \"dominant_frameworks\": [\"Case Study Spotlight (K)\", \"Process Walkthrough (E)\"],\n      \"structural_notes\": \"Heavy use of concrete examples (Case Studies) to illustrate abstract concepts. Ends with synthesis rather than recapping earlier points.\"\n    }\n  }\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -304,
        256
      ],
      "id": "6492337b-d63c-40c1-8867-a0ee79398ec3",
      "name": "Structured Output Parser4"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -304,
        368
      ],
      "id": "77767672-3f55-4a10-af32-a5485da019a2",
      "name": "OpenAI Chat Model8",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -416,
        288
      ],
      "id": "9a612c7f-8a75-4e52-9fd4-eb4983aaf0c4",
      "name": "OpenAI Chat Model9",
      "credentials": {
        "openAiApi": {
          "id": "OjRKrQXB019XKwdP",
          "name": "OpenAi Account (Personal)"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nlet result = '';\nlet length = 24; // Desired length of the random string\n\nfor (let i = 0; i < length; i++) {\n  result += characters.charAt(Math.floor(Math.random() * characters.length));\n}\n\nreturn [{ json: { randomString: result } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -576,
        112
      ],
      "id": "9ff05ee9-011d-4653-b43b-ca84f75eb23f",
      "name": "Code7",
      "executeOnce": true
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.randomString }}",
        "contextWindowLength": 8
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        -320,
        -32
      ],
      "id": "0faf81ea-3320-43a6-acbd-e0f4d9244ccf",
      "name": "Redis Chat Memory4"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk",
          "mode": "list",
          "cachedResultName": "NeuroEverything Books",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 295737623,
          "mode": "list",
          "cachedResultName": "Sheet5",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-HbuwfygQ-rJc1qTr9eRHudYFhUDmw0eUQRuWPLZzuk/edit#gid=295737623"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "STATUS": "DONE",
            "total_blocks": "={{ $json.output.analysis.total_blocks }}",
            "narrative_flow": "={{ $json.output.analysis.narrative_flow }}",
            "overall_narrative_strategy": "={{ $json.output.analysis.meta_analysis.overall_narrative_strategy }}",
            "framework_usage_summary": "={{ $json.output.analysis.framework_usage_summary.frameworks_used[0].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[1].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[2].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[3].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[4].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[5].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[6].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[7].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[8].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[9].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[10].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[11].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[12].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[13].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[14].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[15].name }}  --> {{ $json.output.analysis.framework_usage_summary.frameworks_used[16].name }}",
            "block_1": "=Block {{ $json.output.analysis.segments[0].block_number }}: {{ $json.output.analysis.segments[0].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[0].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[0].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[0].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[0].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[0].key_points[2] }}",
            "block_2": "=Block {{ $json.output.analysis.segments[1].block_number }}: {{ $json.output.analysis.segments[1].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[1].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[1].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[1].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[1].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[1].key_points[2] }}",
            "block_3": "=Block {{ $json.output.analysis.segments[2].block_number }}: {{ $json.output.analysis.segments[2].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[2].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[2].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[2].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[2].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[2].key_points[2] }}",
            "block_4": "=Block {{ $json.output.analysis.segments[3].block_number }}: {{ $json.output.analysis.segments[3].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[3].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[3].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[3].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[3].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[3].key_points[2] }}",
            "block_5": "=Block {{ $json.output.analysis.segments[4].block_number }}: {{ $json.output.analysis.segments[4].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[4].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[4].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[4].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[4].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[4].key_points[2] }}",
            "block_6": "=Block {{ $json.output.analysis.segments[5].block_number }}: {{ $json.output.analysis.segments[5].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[5].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[5].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[5].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[5].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[5].key_points[2] }}",
            "block_7": "=Block {{ $json.output.analysis.segments[6].block_number }}: {{ $json.output.analysis.segments[6].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[6].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[6].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[6].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[6].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[6].key_points[2] }}",
            "block_8": "=Block {{ $json.output.analysis.segments[7].block_number }}: {{ $json.output.analysis.segments[7].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[7].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[7].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[7].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[7].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[7].key_points[2] }}",
            "block_9": "=Block {{ $json.output.analysis.segments[8].block_number }}: {{ $json.output.analysis.segments[8].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[8].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[8].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[8].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[8].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[8].key_points[2] }}",
            "block_10": "=Block {{ $json.output.analysis.segments[9].block_number }}: {{ $json.output.analysis.segments[9].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[9].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[9].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[9].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[9].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[9].key_points[2] }}",
            "block_11": "=Block {{ $json.output.analysis.segments[10].block_number }}: {{ $json.output.analysis.segments[10].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[10].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[10].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[10].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[10].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[10].key_points[2] }}",
            "block_12": "=Block {{ $json.output.analysis.segments[11].block_number }}: {{ $json.output.analysis.segments[11].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[11].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[11].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[11].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[11].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[11].key_points[2] }}",
            "block_13": "=Block {{ $json.output.analysis.segments[12].block_number }}: {{ $json.output.analysis.segments[12].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[12].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[12].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[12].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[12].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[12].key_points[2] }}",
            "block_16": "=Block {{ $json.output.analysis.segments[15].block_number }}: {{ $json.output.analysis.segments[15].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[15].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[15].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[15].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[15].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[15].key_points[2] }}",
            "block_15": "=Block {{ $json.output.analysis.segments[14].block_number }}: {{ $json.output.analysis.segments[14].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[14].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[14].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[14].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[14].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[14].key_points[2] }}",
            "block_14": "=Block {{ $json.output.analysis.segments[13].block_number }}: {{ $json.output.analysis.segments[13].framework_name }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[13].summary }}{{ \"\\n\" }}{{ \"\\n\" }}{{ $json.output.analysis.segments[13].justification }}{{ \"\\n\" }}{{ \"\\n\" }}Key Points:{{ \"\\n\" }}(a). {{ $json.output.analysis.segments[13].key_points[0] }}{{ \"\\n\" }}(b). {{ $json.output.analysis.segments[13].key_points[1] }}{{ \"\\n\" }}(c). {{ $json.output.analysis.segments[13].key_points[2] }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "displayName": "type",
              "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": "total_blocks",
              "displayName": "total_blocks",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "narrative_flow",
              "displayName": "narrative_flow",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "overall_narrative_strategy",
              "displayName": "overall_narrative_strategy",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "framework_usage_summary",
              "displayName": "framework_usage_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_1",
              "displayName": "block_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_2",
              "displayName": "block_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_3",
              "displayName": "block_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_4",
              "displayName": "block_4",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_5",
              "displayName": "block_5",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_6",
              "displayName": "block_6",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_7",
              "displayName": "block_7",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_8",
              "displayName": "block_8",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_9",
              "displayName": "block_9",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_10",
              "displayName": "block_10",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_11",
              "displayName": "block_11",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_12",
              "displayName": "block_12",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_13",
              "displayName": "block_13",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_14",
              "displayName": "block_14",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_15",
              "displayName": "block_15",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "block_16",
              "displayName": "block_16",
              "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": [
        128,
        256
      ],
      "id": "6b040cf7-08a1-4792-831f-53261a7c48bd",
      "name": "Append row in sheet2",
      "retryOnFail": true,
      "waitBetweenTries": 5000,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wZJh4ACm1MD5wdQ9",
          "name": "Google Sheet (Admin Account - Nandy Cyber Success)"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw",
          "mode": "list",
          "cachedResultName": "YouTube (NeuroEverything) Master Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "20 Popular YouTube Videos Long Form",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1PNrsDoa78lTrfIICwqvL3nCCDkUvYvUdmLAAMMHvrTw/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('Loop Over Items4').item.json.row_number }}",
            "STATUS": "FLIP"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "STATUS",
              "displayName": "STATUS",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Creator",
              "displayName": "Creator",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Transcript",
              "displayName": "Transcript",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Length",
              "displayName": "Length",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "5s Hook",
              "displayName": "5s Hook",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Language Style",
              "displayName": "Language Style",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Human Elements",
              "displayName": "Human Elements",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Emotional Triggers",
              "displayName": "Emotional Triggers",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Pacing",
              "displayName": "Pacing",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Key Moments",
              "displayName": "Key Moments",
              "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": [
        544,
        432
      ],
      "id": "782a1d02-e488-4d5b-9954-1a08afa1b45b",
      "name": "Update row in sheet5",
      "retryOnFail": true,
      "waitBetweenTries": 5000
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Code4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file2": {
      "main": [
        [
          {
            "node": "HTTP Request9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request9": {
      "main": [
        [
          {
            "node": "HTTP Request10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request10": {
      "main": [
        [
          {
            "node": "HTTP Request11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request11": {
      "main": [
        [
          {
            "node": "Split Out5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out5": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out6": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Convert to File2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File2": {
      "main": [
        [
          {
            "node": "Image Embeddings with Cohere Embed 5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Embeddings with Cohere Embed 5": {
      "main": [
        [
          {
            "node": "Prepare Points4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store1": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Cohere4": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader2": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter2": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader2",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Merge3": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Points2": {
      "main": [
        [
          {
            "node": "Insert Points",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Points4": {
      "main": [
        [
          {
            "node": "Aggregate Points2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Points": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [],
        [
          {
            "node": "Download file2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Cohere": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Code5": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet1": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "Code5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent3",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Update row in sheet4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Update row in sheet2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code6": {
      "main": [
        [
          {
            "node": "AI Agent2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet2": {
      "main": [
        [
          {
            "node": "Code6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory2": {
      "ai_memory": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet3": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "AI Agent3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent3": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory3": {
      "ai_memory": [
        [
          {
            "node": "AI Agent3",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet4": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent4",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Schedule Trigger2": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet4": {
      "main": [
        [
          {
            "node": "Loop Over Items4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items4": {
      "main": [
        [],
        [
          {
            "node": "Code7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent4": {
      "main": [
        [
          {
            "node": "Append row in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent4",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model8": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model9": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code7": {
      "main": [
        [
          {
            "node": "AI Agent4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory4": {
      "ai_memory": [
        [
          {
            "node": "AI Agent4",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet2": {
      "main": [
        [
          {
            "node": "Update row in sheet5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet5": {
      "main": [
        [
          {
            "node": "Loop Over Items4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "dbefbeda-c5d1-4160-88ef-151c42dc0d70",
  "meta": {
    "instanceId": "5ff5a5992c4c72af22abbdcfa574d8cdf93dc14d57eb9f66e3d9ef2a3e2dbb6c"
  },
  "id": "OAtgQsi9jmoGqScY",
  "tags": []
}