Mon_dictionnaire_Complexe
Ceci est unPersonal Productivity, Multimodal AIworkflow d'automatisation du domainecontenant 22 nœuds.Utilise principalement des nœuds comme If, Set, Code, Webhook, Supabase. Créer un dictionnaire littéraire anglais-allemand-chinois avec GPT-4o-mini et Supabase
- •Point de terminaison HTTP Webhook (généré automatiquement par n8n)
- •URL et Clé API Supabase
- •Clé API OpenAI
Nœuds utilisés (22)
{
"id": "6tW6bM6XI6pqrQgn",
"meta": {
"instanceId": "91e9d2c12dbfcdc2cb30d3665a714f8a4ee901c9fd6527015006b21570a93b53",
"templateCredsSetupCompleted": true
},
"name": "My dictionary_complext",
"tags": [],
"nodes": [
{
"id": "87575fd4-3eda-4e20-8d6b-82a1ec37f1d5",
"name": "Agent IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-600,
-360
],
"parameters": {
"text": "={{ $json.body.word }}",
"options": {
"systemMessage": "Purpose:\nYou are a bilingual dictionary assistant that helps users understand English and German words in the context of literature. It provides Chinese definitions and three literary-style sentence examples for each word, helping users deepen their vocabulary and reading comprehension.\n\nBehavior Guidelines:\n\nInput Handling:\n\nAccept single words in either English or German.\n\nDetect the language automatically.\n\nIf ambiguous, ask the user to clarify.\n\nResponse Format:\n\nLanguage: State the input language.\n\nWord: Bold the input word.\n\nPart of Speech: Indicate (e.g., noun, verb, adjective, etc.).\n\nChinese Meaning: Provide a concise and literary-relevant translation in Simplified Chinese.\n\nExamples:\n\nProvide three example sentences.\n\nThe sentences should be literary in tone or style (poetic, novelistic, expressive).\n\nProvide translations of the examples in Simplified Chinese beneath each.\n\nFocus on Literary Use:\n\nPrioritize literary, archaic, or metaphorical meanings when available.\n\nIf a word has multiple meanings, emphasize the one most relevant to literature.\n\nTone:\n\nKeep responses clear, elegant, and not overly academic.\n\nIf a word has rich etymology or symbolism, briefly mention it.\n\n🧪 Example Interaction\nUser Input: serenity\n\nYour Response:\n\nLanguage: English\nWord: serenity\nPart of Speech: Noun\nChinese Meaning: 宁静;安详;心灵的平和(常用于描写自然或人物的内心状态)\n\nExamples:\n\nThe serenity of the moonlit lake whispered secrets to the wind.\n月光湖面的宁静向微风低语着秘密。\n\nShe wore her serenity like a veil, untouched by the chaos around her.\n她带着一种宁静的气质,如面纱般将纷乱隔绝在外。\n\nIn the quiet of dawn, serenity settled over the forest like a benediction.\n黎明的静谧中,宁静如祝福般洒落在森林之上。"
},
"promptType": "define"
},
"typeVersion": 1.9
},
{
"id": "4547dfac-fb63-4950-8413-c93d4560f05e",
"name": "Supabase",
"type": "n8n-nodes-base.supabase",
"position": [
-360,
420
],
"parameters": {
"tableId": "Dict",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "Words",
"fieldValue": "={{ $json.body.word }}"
},
{
"fieldId": "chineseMeaning",
"fieldValue": "={{ $json.body.chineseMeaning }}"
},
{
"fieldId": "Examples",
"fieldValue": "={{ $json.body.examples }}"
}
]
}
},
"credentials": {
"supabaseApi": {
"id": "ot0Q4Due2nUmSxKx",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "e21676fe-0d24-4b15-8121-f6b0285cc5f4",
"name": "Si",
"type": "n8n-nodes-base.if",
"position": [
-140,
-360
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "71dec079-93c3-44c1-a798-a2c9df48cff5",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $('AI Agent').first().json.output }}",
"rightValue": "It seems "
},
{
"id": "52f131e5-69c7-4862-864f-76f336cf46a4",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $('AI Agent').first().json.output }}",
"rightValue": "unclear"
},
{
"id": "bc103838-6de4-4f72-bd67-03ea710c607f",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $('AI Agent').first().json.output }}",
"rightValue": "please provide"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "eb58c75b-d4f3-4597-8b93-cd769a7e880d",
"name": "Note autocollante",
"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 translations.\n\nUse cases are many: Language learning apps, reading comprehension tools, literary analysis, translation assistance, and vocabulary building for creative writing!\n\n## How it works\n\n* Input word is received via webhook and processed by the AI Agent with a specialized literary dictionary prompt.\n* OpenAI GPT-4o-mini generates comprehensive definitions with part of speech, Chinese meanings, and three literary-style example sentences.\n* Response formatting extracts structured data (word, meaning, examples with translations) from the AI output.\n* Quality control checks for unclear responses and returns appropriate error messages for invalid inputs.\n* Valid responses are simultaneously returned to the user and saved to Supabase database.\n* The workflow provides clean JSON API responses perfect for integration with apps or websites.\n\n## Good to know\n\n* The workflow automatically detects input language (English/German) and handles error cases gracefully.\n* All lookups are saved to Supabase database for building a personal vocabulary collection over time.\n\n## Requirements\n\n* OpenAI account with API access for GPT-4o-mini\n* Supabase account for database storage\n* Basic understanding of webhook APIs for integration\n\n## Customizing this workflow\n\n* Modify the system prompt to support additional languages or change the literary style (academic, casual, business-focused).\n* Add user authentication to create personalized vocabulary collections.\n* Integrate with reading apps, language learning platforms, or writing tools."
},
"typeVersion": 1
},
{
"id": "7300514a-b5ea-40d0-8a29-02a1586cd124",
"name": "Note autocollante1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1140,
-600
],
"parameters": {
"color": 4,
"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 from a HTML web app**"
},
"typeVersion": 1
},
{
"id": "a8b8f6f8-9dd3-465c-8a30-66132144e2e3",
"name": "Openai traduire & donner des exemples",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-580,
-180
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "sOk8ZfXyjEGfWIno",
"name": "OpenAi account "
}
},
"typeVersion": 1.2
},
{
"id": "3b794b96-5195-4771-bb5f-ea0ea99762a2",
"name": "Répondre à l'utilisateur",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
820,
-500
],
"parameters": {
"options": {}
},
"typeVersion": 1.2
},
{
"id": "6c4ce691-a8c5-4ff4-8cd5-1103af2d34ad",
"name": "Répondre à l'utilisateur1",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
820,
-300
],
"parameters": {
"options": {},
"respondWith": "text",
"responseBody": "={{ JSON.stringify($('Format response').first().json) }}"
},
"typeVersion": 1.2
},
{
"id": "2e551b35-2292-4f47-ab5d-d1e658d18adc",
"name": "Formater le message d'erreur",
"type": "n8n-nodes-base.set",
"position": [
400,
-500
],
"parameters": {
"mode": "raw",
"options": {},
"jsonOutput": "{\n \"error\": true,\n \"message\": \"Please provide a specific word in English or German. The input was not recognized as a valid word.\",\n \"word\": \"{{ $('Webhook').first().json.body.word }}\"\n}"
},
"typeVersion": 3.4
},
{
"id": "69ca7f02-6991-4ef9-bc1e-f900507838ab",
"name": "Formater la réponse",
"type": "n8n-nodes-base.code",
"position": [
400,
-300
],
"parameters": {
"jsCode": "// Get the AI response from the previous node\nconst aiResponse = $('AI Agent').first().json.output;\n\n// Split the response into lines for parsing\nconst lines = aiResponse.split('\\n').filter(line => line.trim() !== '');\n\nlet word = '';\nlet chineseMeaning = '';\nlet examples = [];\n\n// Parse each line to extract the needed information\nlet inExamples = false;\nlet currentExample = '';\nlet currentTranslation = '';\n\nfor (let i = 0; i < lines.length; i++) {\n const trimmedLine = lines[i].trim();\n \n // Extract the word (looking for \"Word: **word**\" format)\n if (trimmedLine.startsWith('Word:')) {\n // Remove \"Word:\" and extract text between ** markers\n word = trimmedLine.replace('Word:', '').trim();\n // Remove bold markdown formatting if present\n word = word.replace(/\\*\\*/g, '').trim();\n }\n \n // Extract Chinese meaning\n if (trimmedLine.startsWith('Chinese Meaning:')) {\n chineseMeaning = trimmedLine.replace('Chinese Meaning:', '').trim();\n }\n \n // Check if we've reached the Examples section\n if (trimmedLine === 'Examples:' || trimmedLine.startsWith('Examples:')) {\n inExamples = true;\n continue;\n }\n \n // Parse examples when we're in the examples section\n if (inExamples && trimmedLine) {\n // Check if this line is an English sentence (not a Chinese translation)\n // Chinese translations typically start with Chinese characters\n const isChineseTranslation = /^[\\u4e00-\\u9fff]/.test(trimmedLine);\n \n if (!isChineseTranslation && trimmedLine.length > 10) {\n // This is likely an English example sentence\n // Save the previous example if we have both parts\n if (currentExample && currentTranslation) {\n examples.push({\n sentence: currentExample,\n translation: currentTranslation\n });\n }\n \n // Start a new example\n currentExample = trimmedLine;\n currentTranslation = '';\n } else if (isChineseTranslation && currentExample) {\n // This is the Chinese translation for the current example\n currentTranslation = trimmedLine;\n }\n }\n}\n\n// Don't forget to add the last example if it exists\nif (currentExample && currentTranslation) {\n examples.push({\n sentence: currentExample,\n translation: currentTranslation\n });\n}\n\n// Return the structured data\nreturn {\n word: word,\n chineseMeaning: chineseMeaning,\n examples: examples\n};"
},
"typeVersion": 2
},
{
"id": "6c366b3a-fb16-468a-8615-a86c58398378",
"name": "Webhook pour récupérer la saisie de l'utilisateur",
"type": "n8n-nodes-base.webhook",
"position": [
-940,
-360
],
"webhookId": "e50639d5-af5b-4523-864a-cb123250887f",
"parameters": {
"path": "e50639d5-af5b-4523-864a-cb123250887f",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "47059065-9d8c-40a0-8728-84e7030bab73",
"name": "Webhook pour enregistrer les mots dans Supabase",
"type": "n8n-nodes-base.webhook",
"position": [
-940,
420
],
"webhookId": "e50639d5-af5b-4523-864a-cb123250887f",
"parameters": {
"path": "e50639d5-af5b-4523-864a-cb123250887f",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "6c098436-bbee-416d-9838-b57bb6bf71b7",
"name": "Message de réponse",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
120,
420
],
"parameters": {
"options": {},
"respondWith": "text",
"responseBody": "={\n \"success\": true,\n \"message\": \"Word saved successfully\"\n}"
},
"typeVersion": 1.2
},
{
"id": "92eff8ea-f97e-44dc-b902-f384d89ebe92",
"name": "Note autocollante2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-680,
-20
],
"parameters": {
"color": 4,
"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 sentences."
},
"typeVersion": 1
},
{
"id": "62945248-fb2d-4a4c-8479-6f7f3d6b1d75",
"name": "Note autocollante3",
"type": "n8n-nodes-base.stickyNote",
"position": [
300,
-140
],
"parameters": {
"color": 4,
"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"
},
"typeVersion": 1
},
{
"id": "9b3eb8d6-9210-466e-885f-3015c1c97854",
"name": "Note autocollante4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-300,
-640
],
"parameters": {
"color": 4,
"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"
},
"typeVersion": 1
},
{
"id": "8a7c23e1-d537-491d-b4c8-e7b933e3709d",
"name": "Note autocollante5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1620,
420
],
"parameters": {
"color": 3,
"width": 440,
"height": 100,
"content": "\n\n## Workflow for data storage"
},
"typeVersion": 1
},
{
"id": "55d3c004-cb9a-41cc-884e-829785a8ffe4",
"name": "Note autocollante6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1620,
-360
],
"parameters": {
"color": 3,
"width": 440,
"height": 100,
"content": "\n\n## Workflow for looking up words\n"
},
"typeVersion": 1
},
{
"id": "07bc4443-1d63-4c29-8cbd-386522c73ed2",
"name": "Note autocollante7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
620
],
"parameters": {
"color": 4,
"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"
},
"typeVersion": 1
},
{
"id": "75a5c8ec-f15c-48dd-b140-2eaee66cd85b",
"name": "Note autocollante8",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
400
],
"parameters": {
"color": 4,
"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"
},
"typeVersion": 1
},
{
"id": "a05d401b-792f-437d-bdd1-f08285e5ee9f",
"name": "Note autocollante9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1120,
620
],
"parameters": {
"color": 4,
"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"
},
"typeVersion": 1
},
{
"id": "27e60f98-b4ea-4b29-a2d2-c53b6b786d96",
"name": "Note autocollante10",
"type": "n8n-nodes-base.stickyNote",
"position": [
1060,
-500
],
"parameters": {
"color": 4,
"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, translations).\n\nor\n\n* \"Please provide a specific word in English or German. The input was not recognized as a valid word.\"\n\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "03878a15-0672-4cd3-baf8-40b47c357052",
"connections": {
"e21676fe-0d24-4b15-8121-f6b0285cc5f4": {
"main": [
[
{
"node": "2e551b35-2292-4f47-ab5d-d1e658d18adc",
"type": "main",
"index": 0
}
],
[
{
"node": "69ca7f02-6991-4ef9-bc1e-f900507838ab",
"type": "main",
"index": 0
}
]
]
},
"87575fd4-3eda-4e20-8d6b-82a1ec37f1d5": {
"main": [
[
{
"node": "e21676fe-0d24-4b15-8121-f6b0285cc5f4",
"type": "main",
"index": 0
}
]
]
},
"4547dfac-fb63-4950-8413-c93d4560f05e": {
"main": [
[
{
"node": "6c098436-bbee-416d-9838-b57bb6bf71b7",
"type": "main",
"index": 0
}
]
]
},
"69ca7f02-6991-4ef9-bc1e-f900507838ab": {
"main": [
[
{
"node": "6c4ce691-a8c5-4ff4-8cd5-1103af2d34ad",
"type": "main",
"index": 0
}
]
]
},
"6c4ce691-a8c5-4ff4-8cd5-1103af2d34ad": {
"main": [
[]
]
},
"2e551b35-2292-4f47-ab5d-d1e658d18adc": {
"main": [
[
{
"node": "3b794b96-5195-4771-bb5f-ea0ea99762a2",
"type": "main",
"index": 0
}
]
]
},
"a8b8f6f8-9dd3-465c-8a30-66132144e2e3": {
"ai_languageModel": [
[
{
"node": "87575fd4-3eda-4e20-8d6b-82a1ec37f1d5",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"6c366b3a-fb16-468a-8615-a86c58398378": {
"main": [
[
{
"node": "87575fd4-3eda-4e20-8d6b-82a1ec37f1d5",
"type": "main",
"index": 0
}
]
]
},
"47059065-9d8c-40a0-8728-84e7030bab73": {
"main": [
[
{
"node": "4547dfac-fb63-4950-8413-c93d4560f05e",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Productivité personnelle, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Xiaoyuan Zhang
@xyzhangPartager ce workflow