{
  "name": "Cornersight \u2192 Content Brain (Google Sheets)",
  "nodes": [
    {
      "parameters": {
        "content": "## Cornersight \u2192 Content Brain (Google Sheets)\nKeeps one row per LinkedIn post your keywords and creators surface, so your AI writing tool always has this week's posts.\n1. In Cornersight, set up keyword sources with **authors** ticked.\n2. Copy the webhook Production URL into each source.\n3. Google Sheet with tab **Content Brain**, headers: postUrl, postedAt, keywordOrCreator, author, authorTitle, authorLinkedin, postText, lastSeen.\n4. Connect Google, pick the Sheet, activate.\n5. Weekly: export the tab and give it to Claude / ChatGPT with the prompt in CLAUDE_CODE_PROMPTS.md.\n\nRows update on postUrl, so 50 people liking one post = one row. Author details are only written when Cornersight sends the author, so likes never wipe them.",
        "height": 380,
        "width": 560
      },
      "id": "7fea0906-f06b-498f-8eb6-078d96edec3c",
      "name": "Read me",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -420
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "cornersight-content-brain",
        "options": {}
      },
      "id": "5124258e-f6a6-46a6-a875-bfa772aa35d2",
      "name": "Cornersight webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "c92b3b85-6ccb-4cfc-b4a5-e7c6c335621f"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "88214267-0fd0-4d9e-aaa9-8377b3a1f548",
              "leftValue": "={{ $json.body.data.postText }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "4c53052b-a24d-4da5-8dbb-5525b539f5ef",
      "name": "Has post text?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "5bf4dfb3-e9a8-4bb0-b5f9-f76422becb99",
              "leftValue": "={{ $json.body.data.engagementType }}",
              "rightValue": "Author",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "31d29a1b-95dd-419e-ad2a-00758be658e7",
      "name": "Is the author?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "319da06f-460a-4046-b4e5-073e8096241e",
              "name": "postUrl",
              "value": "={{ $json.body.data.postUrl }}",
              "type": "string"
            },
            {
              "id": "53cdf3da-1340-4e24-8204-219132a94657",
              "name": "postedAt",
              "value": "={{ $json.body.data.postPostedAt }}",
              "type": "string"
            },
            {
              "id": "97ed1293-b023-470f-8bb8-f44cad1303c1",
              "name": "keywordOrCreator",
              "value": "={{ $json.body.data.trackedProfile }}",
              "type": "string"
            },
            {
              "id": "b80f827b-95f3-4ac7-a9c6-9950665ef2dd",
              "name": "postText",
              "value": "={{ $json.body.data.postText }}",
              "type": "string"
            },
            {
              "id": "ea0913cb-14bc-4cd4-a177-a54ebd7581eb",
              "name": "lastSeen",
              "value": "={{ $json.body.timestamp }}",
              "type": "string"
            },
            {
              "id": "b6545384-c115-40ba-9dbb-338bb60a9c19",
              "name": "author",
              "value": "={{ $json.body.data.name }}",
              "type": "string"
            },
            {
              "id": "1e80be99-e177-4087-8733-1c8641d527f1",
              "name": "authorTitle",
              "value": "={{ $json.body.data.jobTitle }} at {{ $json.body.data.companyName }}",
              "type": "string"
            },
            {
              "id": "93f08e34-7651-489b-a1d6-82901956aaf7",
              "name": "authorLinkedin",
              "value": "={{ $json.body.data.linkedinUrl }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "f22086e7-6e35-46fd-a0c1-4e928d86926c",
      "name": "Post + author",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        -100
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "73a8a02f-0476-40d0-aba4-66355a5c7c46",
              "name": "postUrl",
              "value": "={{ $json.body.data.postUrl }}",
              "type": "string"
            },
            {
              "id": "86982562-d5c4-4b3e-a078-d7d3d49846da",
              "name": "postedAt",
              "value": "={{ $json.body.data.postPostedAt }}",
              "type": "string"
            },
            {
              "id": "122902b9-eee7-498f-a036-da0e8b513ba3",
              "name": "keywordOrCreator",
              "value": "={{ $json.body.data.trackedProfile }}",
              "type": "string"
            },
            {
              "id": "a212e85b-21c9-42b9-9bce-01b1a468f68e",
              "name": "postText",
              "value": "={{ $json.body.data.postText }}",
              "type": "string"
            },
            {
              "id": "2502cbaf-e496-42d5-b92a-3fd4f7a78c2d",
              "name": "lastSeen",
              "value": "={{ $json.body.timestamp }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "6de1397c-a3c3-481c-898c-b5f80a6fdb95",
      "name": "Post only",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        100
      ]
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Content Brain"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [
            "postUrl"
          ],
          "schema": []
        },
        "options": {}
      },
      "id": "f4ae6373-ad11-495f-99e4-440702a175d1",
      "name": "Add or update post",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        960,
        0
      ]
    }
  ],
  "connections": {
    "Cornersight webhook": {
      "main": [
        [
          {
            "node": "Has post text?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has post text?": {
      "main": [
        [
          {
            "node": "Is the author?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is the author?": {
      "main": [
        [
          {
            "node": "Post + author",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post + author": {
      "main": [
        [
          {
            "node": "Add or update post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post only": {
      "main": [
        [
          {
            "node": "Add or update post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}