{
  "id": "bbVSEAKvzauv8c24",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "LinkedIn AI Content Assistant using Bright Data and NocoDB",
  "tags": [],
  "nodes": [
    {
      "id": "c8873547-c5bb-4341-bf9c-cdc73cb069a1",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        440,
        -888
      ],
      "parameters": {
        "options": {
          "systemMessage": "You're an expert AI content assistant and your job is to answer questions about my LinkedIn content, provide honest feedback and guidance when asked.\n\nYou can fetch information about my LinkedIn profile and top posts using the tools I gave you."
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2d608314-75e2-4fc7-b6d9-15e2dba39c14",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        320,
        -664
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5.2",
          "cachedResultName": "gpt-5.2"
        },
        "options": {},
        "builtInTools": {
          "webSearch": {
            "searchContextSize": "medium"
          }
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "60d1388d-c025-4104-a14d-fd81d65dab54",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -32,
        -888
      ],
      "parameters": {
        "public": true,
        "options": {
          "loadPreviousSession": "memory"
        },
        "authentication": "n8nUserAuth",
        "initialMessages": "Hey, I'm your AI content assistant. What can I help you with?"
      },
      "typeVersion": 1.4
    },
    {
      "id": "211c685a-6f46-4a60-878c-815ef94f0421",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -32,
        -1384
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "58a36d88-c9f2-476d-a421-7b12f20d45c4",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        -1384
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"url\": \"{{ $json.Link }}\"\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "ef983e69-898a-44c0-9eaf-3a292125bbea",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        864,
        -1384
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "e1a33aed-276e-40d1-a61d-c999ae860d8b",
      "name": "Fetch Post Id",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2208,
        -1504
      ],
      "parameters": {
        "url": "={{ $('Config').item.json.nocodbBaseUrl }}/api/v2/tables/{{ $('Config').item.json.nocodbPostsTableId }}/records?where=(Link,eq,{{ $json.input.url }})",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "nocoDbApiToken"
      },
      "credentials": {
        "nocoDbApiToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "e1c91cd4-b6fe-4d3b-befe-a26ebf90089d",
      "name": "Agent memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        448,
        -664
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "a872f389-3ab0-44a9-9557-18a5fc2f8672",
      "name": "Chat memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        40,
        -664
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "363fd96b-931b-440b-92a4-2868ec96dfa4",
      "name": "Get posts",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        416,
        -1384
      ],
      "parameters": {
        "table": "mpedpoufw8dllkn",
        "options": {},
        "operation": "getAll",
        "projectId": "pububignok3iyrb",
        "returnAll": true,
        "authentication": "nocoDbApiToken"
      },
      "credentials": {
        "nocoDbApiToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9c8e3e25-264b-4ea8-bb41-c83d4f110deb",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -1584
      ],
      "parameters": {
        "width": 656,
        "height": 1056,
        "content": "## README  \n\nMeet your **AI LinkedIn Content Assistant** \u2014 an automation that scrapes your LinkedIn posts, stores real engagement data, and lets you chat with an AI strategist about your content.\n\n**What this workflow does:**\n- Scrapes LinkedIn posts & metrics using **Bright Data**\n- Stores structured post data in **NocoDB**\n- Lets you ask natural-language questions via an **AI chat in n8n**\n- Returns insights based on **real performance data**, not guesses\n\n## Setup\n\nBefore using this workflow, make sure you have access to the following tools:\n\n- [**Bright Data**](https://link.kornel.me/brightdata) \u2013 LinkedIn scraping & data extraction  \n- [**NocoDB**](https://nocodb.com) \u2013 Open-source Airtable-style database\n- [**Open AI API**](https://platform.openai.com/settings) \u2013 For AI reasoning & insights\n\n1. **Import the n8n workflows** into your n8n instance\n\n2. **Connect all required credentials**  \n   - Bright Data  \n   - NocoDB  \n   - LLM provider\n\n3. **Update the Config node, NocoDB nodes and LinkedIn profile url**  \n   - Update the Config variables and other nodes where required\n\n4. **Activate the scraping workflow**  \n   - Run it once manually to populate your database\n\n5. **Activate the AI chat workflow**  \n   - Start asking questions about your content, such as:  \n     \u2022 \u201cWhich posts performed best last month?\u201d  \n     \u2022 \u201cWhat content themes get the most engagement?\u201d  \n     \u2022 \u201cWhat should I post next based on my data?\u201d\n\n## Questions or Need Help?\n\nFor setup help, customization, or advanced AI workflows, join my \ud83c\udf1f FREE \ud83c\udf1f community:\n\n### [Tech Builders Club](https://link.kornel.me/discord-tbc)\n\nHappy building! \ud83d\ude80  - [**Kornel Dubieniecki**](https://link.kornel.me/website)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "595d241c-bbb3-4791-bce1-3835ca56de2c",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        192,
        -1384
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "39e62061-ee64-4e8f-9410-a37fcf885c38",
              "name": "nocodbBaseUrl",
              "type": "string",
              "value": ""
            },
            {
              "id": "55593d8e-9981-473a-a222-bc5074a43fe9",
              "name": "nocodbPostsTableId",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "de563039-37aa-4ab8-9808-9308955e1588",
      "name": "Download Snapshot",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        1984,
        -1432
      ],
      "parameters": {
        "resource": "webScrapper",
        "operation": "downloadSnapshot",
        "batch_size": "={{ undefined }}",
        "snapshot_id": "={{ $json.snapshot_id }}",
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0aa3dfd2-7b10-48da-83a2-3cece1a00fb0",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1984,
        -1216
      ],
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "a10d6dab-41f5-4e4f-a233-dc6b1e2ef82a",
      "name": "Get LinkedIn Profile",
      "type": "@brightdata/n8n-nodes-brightdata.brightDataTool",
      "position": [
        576,
        -664
      ],
      "parameters": {
        "urls": "[{\"url\":\"<YOUR_LINKEDIN_PROFILE>\"}]",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_l1viktl72bvl7bjuj0",
          "cachedResultName": "LinkedIn people profiles"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0cf5beab-b643-46d7-a6c5-6f45a212423f",
      "name": "Get Top LinkedIn Posts",
      "type": "n8n-nodes-base.nocoDbTool",
      "position": [
        704,
        -664
      ],
      "parameters": {
        "table": "mpedpoufw8dllkn",
        "options": {},
        "operation": "getAll",
        "projectId": "pububignok3iyrb",
        "returnAll": true,
        "authentication": "nocoDbApiToken"
      },
      "credentials": {
        "nocoDbApiToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "abdb9cfa-5ed4-46b6-8975-24b70fae6dc7",
      "name": "Is Ready?",
      "type": "n8n-nodes-base.if",
      "position": [
        1760,
        -1384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "49ee6bbc-3b05-4c18-bfc3-dad01063dfbc",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "ready"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "632d2f33-33a1-49f5-b788-667c221e6beb",
      "name": "Returned Posts?",
      "type": "n8n-nodes-base.if",
      "position": [
        1312,
        -1384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "60fddc7d-081b-44cf-9b19-f34243e6c705",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.snapshot_id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0dd8ecb6-5d65-4781-be78-ecd14fc91279",
      "name": "Scrape LinkedIn Posts",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        1088,
        -1384
      ],
      "parameters": {
        "urls": "={{ $json.data.toJsonString() }}",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_lyy3tktm25m4avu764",
          "cachedResultName": "LinkedIn posts"
        },
        "include_errors": true,
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7ea6dd3c-0148-4c5b-abad-d48801d7ab0b",
      "name": "Update Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        -1504
      ],
      "parameters": {
        "url": "={{ $('Config').item.json.nocodbBaseUrl }}/api/v2/tables/{{ $('Config').item.json.nocodbPostsTableId }}/records",
        "method": "PATCH",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "Id",
              "value": "={{ $json.list[0].Id }}"
            },
            {
              "name": "Content",
              "value": "={{ $('Scrape LinkedIn Posts').item.json.post_text }}"
            },
            {
              "name": "Likes",
              "value": "={{ $('Scrape LinkedIn Posts').item.json.num_likes }}"
            },
            {
              "name": "Comments",
              "value": "={{ $('Scrape LinkedIn Posts').item.json.num_comments }}"
            }
          ]
        },
        "nodeCredentialType": "nocoDbApiToken"
      },
      "credentials": {
        "nocoDbApiToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "9df8fe77-0b62-44a4-b401-96b98e6f07aa",
      "name": "Get Snapshot Status",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        1536,
        -1312
      ],
      "parameters": {
        "resource": "webScrapper",
        "operation": "monitorProgressSnapshot",
        "snapshot_id": "={{ $json.snapshot_id }}",
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4055da73-b50b-4976-b5c7-88eac39b00a7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -1600
      ],
      "parameters": {
        "color": 7,
        "width": 1120,
        "height": 544,
        "content": "# Get Linkedin Posts w/ Bright Data\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c6b121e4-96be-4992-aa58-27ffb92c5237",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -136,
        -1016
      ],
      "parameters": {
        "color": 7,
        "width": 1024,
        "height": 496,
        "content": "# AI Chatbot"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ba656f72-a666-427c-911d-66b62a888d0e",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get Snapshot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Get posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        []
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Scrape LinkedIn Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get posts": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Ready?": {
      "main": [
        [
          {
            "node": "Download Snapshot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat memory": {
      "ai_memory": [
        [
          {
            "node": "When chat message received",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Post Id": {
      "main": [
        [
          {
            "node": "Update Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Returned Posts?": {
      "main": [
        [
          {
            "node": "Fetch Post Id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Snapshot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Snapshot": {
      "main": [
        [
          {
            "node": "Fetch Post Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Snapshot Status": {
      "main": [
        [
          {
            "node": "Is Ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LinkedIn Profile": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Scrape LinkedIn Posts": {
      "main": [
        [
          {
            "node": "Returned Posts?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Top LinkedIn Posts": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}