{
  "name": "Ingest Excel data into Oracle and chat with it using Select AI and Azure OpenAI",
  "nodes": [
    {
      "id": "0a22c3e5-cb40-49e8-9f85-2016509f06db",
      "name": "Webhook - File Upload",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -336,
        -288
      ]
    },
    {
      "id": "58fbff39-0a0a-498f-bab5-4344ee757ce6",
      "name": "Validate & Normalize File",
      "type": "n8n-nodes-base.code",
      "position": [
        -112,
        -288
      ]
    },
    {
      "id": "c8ca06b8-33d0-4da7-a4ef-51b3d5462cb0",
      "name": "Extract from Excel",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        112,
        -288
      ]
    },
    {
      "id": "de6f63ea-0df4-4818-8880-07640b0af2ec",
      "name": "Infer Schema & Table Name",
      "type": "n8n-nodes-base.code",
      "position": [
        336,
        -288
      ]
    },
    {
      "id": "6de17ea8-672a-49c1-a9f7-23757464dff0",
      "name": "Create Oracle Table",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        560,
        -288
      ]
    },
    {
      "id": "f3605d97-8dc0-4aac-8e64-f0ec6afdb3b7",
      "name": "Restore Data Rows",
      "type": "n8n-nodes-base.code",
      "position": [
        784,
        -216
      ]
    },
    {
      "id": "e7dc3285-3f21-4e54-ae92-0b8ff05424d3",
      "name": "Split into Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1008,
        -288
      ]
    },
    {
      "id": "eade0b96-2816-4a48-887d-2eb815e63d03",
      "name": "Insert Rows into Oracle",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        1232,
        -288
      ]
    },
    {
      "id": "437acba1-e305-4b3f-8999-7fe4fd0b2776",
      "name": "Configure Select AI Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        1456,
        -288
      ]
    },
    {
      "id": "326e9710-108f-44c7-a6f7-7ec4f9b5fb25",
      "name": "Register with Select AI",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        1680,
        -288
      ]
    },
    {
      "id": "9a7b5d3f-36ae-4fbb-8f63-6869e1be1ae6",
      "name": "Prepare Response",
      "type": "n8n-nodes-base.code",
      "position": [
        1904,
        -288
      ]
    },
    {
      "id": "d06ad825-0210-4f1d-8d46-cf5f718de089",
      "name": "Return Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2128,
        -288
      ]
    },
    {
      "id": "807306dc-fd4b-42bf-aa89-31d910441360",
      "name": "Chat Input",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        672,
        480
      ]
    },
    {
      "id": "a9b736ab-d1f9-4d5d-8a87-0a7d54646ef0",
      "name": "Configure Select AI Profile",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        480
      ]
    },
    {
      "id": "2b607c70-260b-49c8-ac7e-fda09f6238fd",
      "name": "Oracle Select AI Query",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        1120,
        480
      ]
    },
    {
      "id": "67577111-0c99-45a4-aede-b9be25d7c41a",
      "name": "Format Chat Response",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        480
      ]
    },
    {
      "id": "909c841c-d019-46cd-8e19-c5c61a1b802d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        96
      ],
      "parameters": {
        "width": 1216,
        "height": 576,
        "content": "## Workflow B\n### How It Works\nUser asks question in natural language\n         ↓\nChat Input captures the question\n         ↓\nConfigure Select AI Profile (sets profile name)\n         ↓\nOracle Select AI"
      }
    },
    {
      "id": "3e34740c-1175-4b14-9508-eea32c9be7fd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -752
      ],
      "parameters": {
        "width": 288,
        "height": 464,
        "content": "## Configure Oracle Database Credentials\n\nClick on any Oracle Database node (e.g., \"Create Oracle Table\")\nClick Create New Credential\nEnter your Oracle connection details:\n\nHost: Your Oracle DB host\nD"
      }
    },
    {
      "id": "ef8efe2a-343f-4684-85d9-58ecffed9c24",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        -480
      ],
      "parameters": {
        "width": 192,
        "height": 192,
        "content": "### Update Schema Name\nIn the \"Insert Rows into Oracle\" node:\nChange YOUR_SCHEMA_NAME to your actual Oracle schema (e.g., ADMIN, SCOTT, etc.)"
      }
    },
    {
      "id": "116d1501-cdea-4420-81b9-15c8e4ae03cf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        -480
      ],
      "parameters": {
        "width": 192,
        "height": 192,
        "content": "### Configure Azure OpenAI Settings\nIn the \"Configure Select AI Settings\" node, update the selectAIConfig object"
      }
    },
    {
      "id": "0cda7158-5ab5-4200-b981-a3c93eb07ad3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -480
      ],
      "parameters": {
        "width": 208,
        "height": 192,
        "content": "### File Size Limits\nAdd validation in \"Validate & Normalize File\""
      }
    },
    {
      "id": "ef486a6f-d92d-4f91-9452-cebf5777543b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        -480
      ],
      "parameters": {
        "width": 192,
        "height": 192,
        "content": "### Registers with select AI\nRegisters the data with Oracle Select AI for natural language querying powered by Azure OpenAI."
      }
    },
    {
      "id": "a01934f9-baa3-410b-8a4c-95168f3d4c9d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        -480
      ],
      "parameters": {
        "width": 224,
        "height": 192,
        "content": "### Return Success Output:\nReturns { success, tableName, columns, rowCount, selectAIProfile }.\n**tableName** is passed to the chat workflow so Select AI knows which table to query."
      }
    },
    {
      "id": "7de15b6d-349c-45f2-ad06-4f6cd418c835",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -480
      ],
      "parameters": {
        "width": 192,
        "height": 192,
        "content": "### Change Batch Size\n\nDefault: 50 rows per batch\nAdjust based on your data size and database performance"
      }
    },
    {
      "id": "fb61ac4b-49c0-4891-8edb-3da0fb813b62",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -960
      ],
      "parameters": {
        "width": 512,
        "height": 80,
        "content": "**This creates the Oracle table and Select AI profile needed for querying**"
      }
    },
    {
      "id": "7f17c42e-22de-4e8e-830b-1529f3850a04",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2336,
        -384
      ],
      "parameters": {
        "width": 576,
        "height": 272,
        "content": "### Expected Response\n{\n  \"success\": true,\n  \"tableName\": \"UPLOAD_EXCEL_20260209123456789\",\n  \"columns\": [\"ID\", \"NAME\", \"AGE\", \"CITY\", \"SALARY\"],\n  \"rowCount\": 150,\n  \"selectAIProfile\": \"EXCEL_AI\",\n  "
      }
    },
    {
      "id": "93ce236e-ec12-4eb4-94d1-910ec8aebaa4",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        368
      ],
      "parameters": {
        "width": 272,
        "height": 112,
        "content": "Invokes DBMS_CLOUD_AI.GENERATE with action='runsql' to translate the chat prompt into SQL, execute it on the Select AI–registered table, and return the result set."
      }
    },
    {
      "id": "4c9f113b-6dc8-4dd0-afea-b5134c66f5d8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -880
      ],
      "parameters": {
        "width": 2752,
        "height": 864,
        "content": "## Workflow A Flow:\n1. Webhook receives Excel file\n   ↓\n2. Validate & normalize file\n   ↓\n3. Extract data from Excel\n   ↓\n4. Infer schema (column names & types)\n   ↓\n5. Create Oracle table dynamically"
      }
    }
  ],
  "connections": {
    "Chat Input": {
      "main": [
        [
          {
            "node": "Configure Select AI Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Response": {
      "main": [
        [
          {
            "node": "Return Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore Data Rows": {
      "main": [
        [
          {
            "node": "Split into Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from Excel": {
      "main": [
        [
          {
            "node": "Infer Schema & Table Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split into Batches": {
      "main": [
        [
          {
            "node": "Insert Rows into Oracle",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Oracle Table": {
      "main": [
        [
          {
            "node": "Split into Batches",
            "type": "main",
            "index": 0
          },
          {
            "node": "Restore Data Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - File Upload": {
      "main": [
        [
          {
            "node": "Validate & Normalize File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Oracle Select AI Query": {
      "main": [
        [
          {
            "node": "Format Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Rows into Oracle": {
      "main": [
        [
          {
            "node": "Configure Select AI Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Register with Select AI": {
      "main": [
        [
          {
            "node": "Prepare Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Infer Schema & Table Name": {
      "main": [
        [
          {
            "node": "Create Oracle Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Normalize File": {
      "main": [
        [
          {
            "node": "Extract from Excel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Select AI Profile": {
      "main": [
        [
          {
            "node": "Oracle Select AI Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Select AI Settings": {
      "main": [
        [
          {
            "node": "Register with Select AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}