{
  "name": "Create literary English/German to Chinese dictionary with GPT-4o-mini & Supabase",
  "nodes": [
    {
      "id": "87575fd4-3eda-4e20-8d6b-82a1ec37f1d5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -600,
        -360
      ]
    },
    {
      "id": "4547dfac-fb63-4950-8413-c93d4560f05e",
      "name": "Supabase",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -360,
        420
      ]
    },
    {
      "id": "e21676fe-0d24-4b15-8121-f6b0285cc5f4",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -140,
        -360
      ]
    },
    {
      "id": "eb58c75b-d4f3-4597-8b93-cd769a7e880d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        -660
      ],
      "parameters": {
        "width": 540,
        "height": 1120,
        "content": "# Literary Dictionary Assistant \n\nThis n8n template creates a sophisticated bilingual dictionary that provides literary-style definitions and examples for English and German words with Chinese transla"
      }
    },
    {
      "id": "7300514a-b5ea-40d0-8a29-02a1586cd124",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -600
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 1. Webhook Receiver\n\nReceives word requests via HTTP POST. It captures the input word to be processed and triggers the entire workflow chain.\n\n**I use this Webhook to receive word input by user f"
      }
    },
    {
      "id": "a8b8f6f8-9dd3-465c-8a30-66132144e2e3",
      "name": "Openai translate & give examples",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -580,
        -180
      ]
    },
    {
      "id": "3b794b96-5195-4771-bb5f-ea0ea99762a2",
      "name": "Respond to user",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        820,
        -500
      ]
    },
    {
      "id": "6c4ce691-a8c5-4ff4-8cd5-1103af2d34ad",
      "name": "Respond to user1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        820,
        -300
      ]
    },
    {
      "id": "2e551b35-2292-4f47-ab5d-d1e658d18adc",
      "name": "Format error message",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        -500
      ]
    },
    {
      "id": "69ca7f02-6991-4ef9-bc1e-f900507838ab",
      "name": "Format response",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        -300
      ]
    },
    {
      "id": "6c366b3a-fb16-468a-8615-a86c58398378",
      "name": "Webhook to fetch user word input",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -940,
        -360
      ]
    },
    {
      "id": "47059065-9d8c-40a0-8728-84e7030bab73",
      "name": "Webhook to save words in Supabase",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -940,
        420
      ]
    },
    {
      "id": "6c098436-bbee-416d-9838-b57bb6bf71b7",
      "name": "Respond message",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        120,
        420
      ]
    },
    {
      "id": "92eff8ea-f97e-44dc-b902-f384d89ebe92",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        -20
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 2. AI Agent\n\nI use specialized literary dictionary prompt. It will auto-detect language (English/German) and then generate comprehensive definitions. It will also create 3 literary-style example "
      }
    },
    {
      "id": "62945248-fb2d-4a4c-8479-6f7f3d6b1d75",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        -140
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 4. Data Structure Parser\n\nIt extracts structured data from AI output and organizes: word, part of speech, meanings\nFormats examples with translations\n"
      }
    },
    {
      "id": "9b3eb8d6-9210-466e-885f-3015c1c97854",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -640
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 3. Error Handler \n\nThis if node checks for unclear or invalid responses and returns appropriate error messages\n"
      }
    },
    {
      "id": "8a7c23e1-d537-491d-b4c8-e7b933e3709d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1620,
        420
      ],
      "parameters": {
        "width": 440,
        "height": 100,
        "content": "\n\n## Workflow for data storage"
      }
    },
    {
      "id": "55d3c004-cb9a-41cc-884e-829785a8ffe4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1620,
        -360
      ],
      "parameters": {
        "width": 440,
        "height": 100,
        "content": "\n\n## Workflow for looking up words\n"
      }
    },
    {
      "id": "07bc4443-1d63-4c29-8cbd-386522c73ed2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        620
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 2. Supabase Integration\n\nIt saves all valid lookups to database and builds personal structured dictionary data.\n"
      }
    },
    {
      "id": "75a5c8ec-f15c-48dd-b140-2eaee66cd85b",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        400
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 3. Webhook Response Node\n\nIt completes the workflow by sending the final response back to the requesting user: \"Word saved successfully\".\n"
      }
    },
    {
      "id": "a05d401b-792f-437d-bdd1-f08285e5ee9f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        620
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "\n\n## 1. Save Words Trigger\n\nWhen the user clicks the \" Save to vocabulary list\" button, it will trigger this workflow and the word will be saved to Supabase.\n"
      }
    },
    {
      "id": "27e60f98-b4ea-4b29-a2d2-c53b6b786d96",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        -500
      ],
      "parameters": {
        "width": 440,
        "height": 320,
        "content": "\n\n## 5. Webhook Response Node\n\nIt completes this workflow by sending the final response back to the requesting user. It is either\n\n* includes the complete dictionary data (word, definitions, examples,"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Format error message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase": {
      "main": [
        [
          {
            "node": "Respond message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format response": {
      "main": [
        [
          {
            "node": "Respond to user1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to user1": {
      "main": [
        []
      ]
    },
    "Format error message": {
      "main": [
        [
          {
            "node": "Respond to user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Openai translate & give examples": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Webhook to fetch user word input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook to save words in Supabase": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}