{
  "name": "Beginner AI dataset generator using OpenAI + LangChain in n8n",
  "nodes": [
    {
      "id": "bd247a8c-fa46-4b86-ad4b-977b73c35d4e",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -540,
        1340
      ]
    },
    {
      "id": "e97ac821-6da8-4bea-875c-a4ccdf0d53b2",
      "name": "Tool: Inject Creativity1",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -440,
        1520
      ]
    },
    {
      "id": "312c5a50-8c9b-4aa9-b3b4-9b682e757bc1",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -300,
        1320
      ]
    },
    {
      "id": "975b4e46-656d-4128-88c9-c8dc385e2fb8",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        240,
        1740
      ]
    },
    {
      "id": "052b20f4-8724-41fe-b2c1-937ece4003ea",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        420,
        1760
      ]
    },
    {
      "id": "a523d13f-653d-4a91-a672-b0bd5d558f27",
      "name": "Run Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1080,
        1440
      ]
    },
    {
      "id": "ae8bc30f-c16e-435c-a875-8c02287d4855",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1160,
        540
      ],
      "parameters": {
        "width": 420,
        "height": 1340,
        "content": "### 🥇 Step 1: Setup OpenAI API Credentials\n\n1. Go to [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys)\n2. Click **“Create new secret key”**\n3. Copy your API "
      }
    },
    {
      "id": "42d4c54f-bb88-4c0d-a31c-0beb1814b0b7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        540
      ],
      "parameters": {
        "width": 780,
        "height": 1340,
        "content": "\n### ✨ Step 4: Generate Structured Data\n- **LangChain Agent** node `Generate Random Data`\n- Connect to **OpenAI Chat Model1** and **Tool: Inject Creativity1**  \n- System prompt: instruct AI to output "
      }
    },
    {
      "id": "4c48281e-5c67-4b71-8b20-23ff69d50582",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        540
      ],
      "parameters": {
        "width": 640,
        "height": 1340,
        "content": "### 🧠 Step 7: Generate Column Names\n- **LangChain Agent** `Generate Column Names`  \n- Connect to **OpenAI Chat Model2**  \n- Prompt: infer 5 column names from the string  \n\n### 🔢 Step 8: Pivot Names Ro"
      }
    },
    {
      "id": "6c6774de-9bb1-4c19-b121-fc6ccb2dcdc5",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        540
      ],
      "parameters": {
        "width": 1460,
        "height": 1340,
        "content": "### 🪓 Step 9: Split Columns\n- 5 `SplitOut` nodes to break each array back into rows per column\n\n### 🔗 Step 10: Merge Rows\n- **Merge** node `Merge Columns together` using `combineByPosition`  \n\n### 🏷️ "
      }
    },
    {
      "id": "014107b1-ff36-438f-8c88-8196ad4f48f7",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1160,
        340
      ],
      "parameters": {
        "width": 3380,
        "height": null,
        "content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)"
      }
    },
    {
      "id": "cc11756c-f453-4cce-b148-49879bced88b",
      "name": "Set Topic to Search",
      "type": "n8n-nodes-base.set",
      "position": [
        -920,
        1620
      ]
    },
    {
      "id": "7b0ab29e-8d4e-4576-8933-101142364284",
      "name": "Generate Random Data",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -520,
        1020
      ]
    },
    {
      "id": "843589b2-36cd-4c3e-b710-c683de9ebdd8",
      "name": "Outpt all Data to One Field",
      "type": "n8n-nodes-base.code",
      "position": [
        -120,
        1260
      ]
    },
    {
      "id": "87405d02-b882-403e-bf5a-9d125b1536b8",
      "name": "Generate Column Names",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        260,
        1480
      ]
    },
    {
      "id": "419ce3c1-1fe5-4d8a-8330-e8afca8c94f5",
      "name": "Pivot Column Names",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        1660
      ]
    },
    {
      "id": "1b3f150e-60a5-466b-9874-c2f98f411eaa",
      "name": "Split Column 1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1100,
        1020
      ]
    },
    {
      "id": "dfee12fe-f157-48e0-8b6c-71a1bc0eeac4",
      "name": "Split Column 2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        920,
        1120
      ]
    },
    {
      "id": "effd383c-a799-4500-be47-1052549e8cf9",
      "name": "Split Column 3",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1120,
        1240
      ]
    },
    {
      "id": "e346941b-8b34-467c-ae42-02dd0c6f45e8",
      "name": "Split Column 4",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        880,
        1320
      ]
    },
    {
      "id": "6a7384d7-f615-4ed0-8f20-8a6a010f4984",
      "name": "Split Column 5",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1100,
        1480
      ]
    },
    {
      "id": "daeede53-e473-47bd-836e-9bbabba95697",
      "name": "Merge Columns together",
      "type": "n8n-nodes-base.merge",
      "position": [
        1380,
        1260
      ]
    },
    {
      "id": "b703dffd-ee3e-41da-b883-34e806fb56d9",
      "name": "Rename Columns",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        1300
      ]
    },
    {
      "id": "587fbb98-a687-43e6-89dc-dd71d98b5211",
      "name": "Append Column Names",
      "type": "n8n-nodes-base.merge",
      "position": [
        1840,
        1680
      ]
    }
  ],
  "connections": {
    "Run Workflow": {
      "main": [
        [
          {
            "node": "Set Topic to Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rename Columns": {
      "main": [
        [
          {
            "node": "Append Column Names",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Column 1": {
      "main": [
        [
          {
            "node": "Merge Columns together",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Column 2": {
      "main": [
        [
          {
            "node": "Merge Columns together",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Column 3": {
      "main": [
        [
          {
            "node": "Merge Columns together",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Split Column 4": {
      "main": [
        [
          {
            "node": "Merge Columns together",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Split Column 5": {
      "main": [
        [
          {
            "node": "Merge Columns together",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Random Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Column Names",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pivot Column Names": {
      "main": [
        [
          {
            "node": "Append Column Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Column Names": {
      "main": [
        []
      ]
    },
    "Set Topic to Search": {
      "main": [
        [
          {
            "node": "Generate Random Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Random Data": {
      "main": [
        [
          {
            "node": "Split Column 1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Column 2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Column 3",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Column 4",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Column 5",
            "type": "main",
            "index": 0
          },
          {
            "node": "Outpt all Data to One Field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Column Names": {
      "main": [
        [
          {
            "node": "Pivot Column Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Columns together": {
      "main": [
        [
          {
            "node": "Rename Columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Random Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Tool: Inject Creativity1": {
      "ai_tool": [
        [
          {
            "node": "Generate Random Data",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Column Names",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Outpt all Data to One Field": {
      "main": [
        [
          {
            "node": "Generate Column Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}