Sélecteur de modèles de conformité GDPR dynamique avec Requesty
Ceci est unEngineering, AI Chatbotworkflow d'automatisation du domainecontenant 20 nœuds.Utilise principalement des nœuds comme N8n, Set, Code, Merge, SplitOut. Sélecteur dynamique de modèle AI conforme au GDPR, implémenté avec Requesty et Google Sheets
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Informations d'identification Google Sheets API
- •Clé API OpenAI
Nœuds utilisés (20)
Catégorie
{
"id": "xUuPJFkQw5aJ9Bfg",
"meta": {
"instanceId": "7f03117cd0731766b3ae8ea65a9638f11161d03d7cfb20d1531642698c9d0de3"
},
"name": "Dynamic GDPR-Compliant Model Selector with Requesty",
"tags": [],
"nodes": [
{
"id": "fb6de8aa-2c8f-488e-8002-7aeb96861b3d",
"name": "Initialiser le Workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-180,
-1140
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5f73d2cb-368a-4ca6-af4a-7e97176b35c0",
"name": "Récupérer les Modèles Disponibles",
"type": "n8n-nodes-base.httpRequest",
"position": [
40,
-1040
],
"parameters": {
"url": "https://router.requesty.ai/v1/models?provider=coding",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "63d190c6-ac9d-41e7-8e36-a1a045c5cc13",
"name": "Diviser les Données du Modèle",
"type": "n8n-nodes-base.splitOut",
"position": [
260,
-1040
],
"parameters": {
"include": "allOtherFields",
"options": {},
"fieldToSplitOut": "data"
},
"typeVersion": 1
},
{
"id": "f95eb1c6-b6d7-492d-822c-02bc000c6749",
"name": "Extraire les IDs des Modèles",
"type": "n8n-nodes-base.set",
"position": [
480,
-1040
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "be11b412-dfb1-47fd-be24-e8dead708405",
"name": "id",
"type": "string",
"value": "={{ $json.data.id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b9595c92-7e9a-4688-aa12-bf558af42481",
"name": "Obtenir le Workflow Actuel",
"type": "n8n-nodes-base.n8n",
"position": [
480,
-1240
],
"parameters": {
"operation": "get",
"workflowId": {
"__rl": true,
"mode": "id",
"value": "={{ $workflow.id }}"
},
"requestOptions": {}
},
"executeOnce": true,
"typeVersion": 1
},
{
"id": "d8b903d3-53ec-47fd-9dfa-bdb131dae3bf",
"name": "Fusionner les Données",
"type": "n8n-nodes-base.merge",
"position": [
700,
-1140
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "bc7dde1f-0afd-47c9-a851-ded2ceb37dbf",
"name": "Mettre à Jour les Options de la Liste Déroulante",
"type": "n8n-nodes-base.code",
"position": [
920,
-1140
],
"parameters": {
"jsCode": "// n8n Code Node - Update Form Dropdown Options\n// First item = Workflow JSON, From second item = New Model IDs\n\ntry {\n // Get all input items\n const allInputs = $input.all();\n \n // First item is the workflow\n const workflowData = allInputs[0]?.json;\n \n // From second item onwards are the new model IDs\n const newOptions = [];\n \n // Iterate through all items from index 1\n for (let i = 1; i < allInputs.length; i++) {\n const item = allInputs[i];\n \n // Extract ID from the json object\n if (item?.json?.id) {\n newOptions.push(item.json.id);\n }\n }\n \n // Fallback if no IDs found\n if (newOptions.length === 0) {\n newOptions.push('No models available');\n }\n \n // Copy and modify workflow\n const result = JSON.parse(JSON.stringify(workflowData));\n \n // Go through workflow nodes\n if (result.nodes) {\n result.nodes.forEach(node => {\n if (node.type === 'n8n-nodes-base.formTrigger' && \n node.parameters?.formFields?.values) {\n \n node.parameters.formFields.values.forEach(field => {\n if (field.fieldType === 'dropdown' && field.fieldOptions) {\n // Set new dropdown options\n field.fieldOptions.values = newOptions.map(option => ({ option }));\n }\n });\n }\n });\n }\n \n return result;\n \n} catch (error) {\n // Error handling with debug info\n return {\n error: error.message,\n totalInputs: $input.all().length,\n sampleIds: $input.all().slice(1, 4).map(item => item?.json?.id),\n fallback: $input.first()?.json\n };\n}"
},
"typeVersion": 2
},
{
"id": "f672fce1-7081-4fd1-a898-dddabe38f853",
"name": "Mettre à Jour le Workflow",
"type": "n8n-nodes-base.n8n",
"position": [
1140,
-1140
],
"parameters": {
"operation": "update",
"workflowId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"requestOptions": {},
"workflowObject": "={{ JSON.stringify($json) }}"
},
"typeVersion": 1
},
{
"id": "6e12465c-2848-40fc-a1f8-ae2585d5882d",
"name": "Formulaire de Sélection de Modèle",
"type": "n8n-nodes-base.formTrigger",
"position": [
-180,
-780
],
"webhookId": "a9562558-7962-4a3a-8b3f-82e5ba5bef1a",
"parameters": {
"options": {},
"formTitle": "Select AI Model",
"formFields": {
"values": [
{
"fieldType": "dropdown",
"fieldLabel": "AI Language Model",
"fieldOptions": {
"values": [
{}
]
}
}
]
}
},
"typeVersion": 2.2
},
{
"id": "fa81a3f1-0f28-4049-b6b2-f6f486e67e0d",
"name": "Définir le Modèle Sélectionné",
"type": "n8n-nodes-base.set",
"position": [
40,
-780
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a132682c-fbbb-4abc-bdde-be93bf0cb992",
"name": "model",
"type": "string",
"value": "={{ $json.fieldName }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0196af9b-aa3d-45bd-a6f1-92f96486ced9",
"name": "Interface de Chat",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-180,
-520
],
"webhookId": "47d7c77b-1904-4d17-ba39-a1d5b85069be",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "6191c42f-ece1-421d-b9cf-c9ab213f2f36",
"name": "Requête AI API",
"type": "n8n-nodes-base.httpRequest",
"position": [
480,
-520
],
"parameters": {
"url": "https://router.requesty.ai/v1/chat/completions",
"method": "POST",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"jsonBody": "={\n \"model\": \"{{ $json.model }}\",\n \"messages\": [\n { \"role\": \"system\", \"content\": \"You are a helpful assistant.\" },\n { \"role\": \"user\", \"content\": \"{{ $('Chat Interface').item.json.chatInput }}\" }\n ],\n \"max_tokens\": 200,\n \"temperature\": 0.7\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer {{ $credentials.requestyApi.apiKey }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "ebcd8d4f-4d15-4755-971e-14a932adda23",
"name": "Extraire la Réponse",
"type": "n8n-nodes-base.set",
"position": [
700,
-520
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f1ec57e7-d781-406f-b6ea-68906c679a2e",
"name": "content",
"type": "string",
"value": "={{ $json.choices[0].message.content }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0ced2b03-0d09-474a-be65-2f49ddcf95fa",
"name": "Obtenir le Modèle Actuel",
"type": "n8n-nodes-base.set",
"position": [
260,
-520
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6470970a-10ce-4bc4-8fd0-de4c4e309e2d",
"name": "model",
"type": "string",
"value": "={{ $json.model }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "7379d69a-9066-48be-a163-fea478bb2cef",
"name": "Sauvegarder la Sélection du Modèle",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
-780
],
"parameters": {
"columns": {
"value": {},
"schema": [],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Current_Model"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "YOUR_GOOGLE_SHEET_ID"
}
},
"typeVersion": 4.6
},
{
"id": "b8a03a91-5839-46e4-891c-e9793738f3dc",
"name": "Effacer la Sélection Précédente",
"type": "n8n-nodes-base.googleSheets",
"position": [
260,
-780
],
"parameters": {
"operation": "clear",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Current_Model"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "YOUR_GOOGLE_SHEET_ID"
}
},
"typeVersion": 4.6
},
{
"id": "58bc8a11-7f9e-452a-ad0f-d05f3c56eda9",
"name": "Lire le Modèle Actuel",
"type": "n8n-nodes-base.googleSheets",
"position": [
40,
-520
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Current_Model"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "YOUR_GOOGLE_SHEET_ID"
}
},
"typeVersion": 4.6
},
{
"id": "9bcf3d2d-f320-44af-8c02-62b50a41a299",
"name": "Agent IA (Optionnel)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
40,
-240
],
"parameters": {
"options": {}
},
"typeVersion": 2
},
{
"id": "32c0a603-b40e-4830-ab8d-592bcd3d9c58",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
40,
20
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "openai/gpt-4o-mini",
"cachedResultName": "openai/gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "fb9667d4-2b39-4ba5-b67a-d3671f814124",
"name": "Formater la Réponse",
"type": "n8n-nodes-base.code",
"position": [
920,
-520
],
"parameters": {
"jsCode": "return [{\n json: {\n text: $json.content\n }\n}];\n"
},
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "e65bf989-9806-4cc5-9f6d-e4fafa7883c7",
"connections": {
"d8b903d3-53ec-47fd-9dfa-bdb131dae3bf": {
"main": [
[
{
"node": "bc7dde1f-0afd-47c9-a851-ded2ceb37dbf",
"type": "main",
"index": 0
}
]
]
},
"6191c42f-ece1-421d-b9cf-c9ab213f2f36": {
"main": [
[
{
"node": "ebcd8d4f-4d15-4755-971e-14a932adda23",
"type": "main",
"index": 0
}
]
]
},
"0196af9b-aa3d-45bd-a6f1-92f96486ced9": {
"main": [
[
{
"node": "58bc8a11-7f9e-452a-ad0f-d05f3c56eda9",
"type": "main",
"index": 0
}
]
]
},
"ebcd8d4f-4d15-4755-971e-14a932adda23": {
"main": [
[
{
"node": "fb9667d4-2b39-4ba5-b67a-d3671f814124",
"type": "main",
"index": 0
}
]
]
},
"63d190c6-ac9d-41e7-8e36-a1a045c5cc13": {
"main": [
[
{
"node": "f95eb1c6-b6d7-492d-822c-02bc000c6749",
"type": "main",
"index": 0
}
]
]
},
"f95eb1c6-b6d7-492d-822c-02bc000c6749": {
"main": [
[
{
"node": "d8b903d3-53ec-47fd-9dfa-bdb131dae3bf",
"type": "main",
"index": 1
}
]
]
},
"0ced2b03-0d09-474a-be65-2f49ddcf95fa": {
"main": [
[
{
"node": "6191c42f-ece1-421d-b9cf-c9ab213f2f36",
"type": "main",
"index": 0
}
]
]
},
"32c0a603-b40e-4830-ab8d-592bcd3d9c58": {
"ai_languageModel": [
[
{
"node": "9bcf3d2d-f320-44af-8c02-62b50a41a299",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"58bc8a11-7f9e-452a-ad0f-d05f3c56eda9": {
"main": [
[
{
"node": "0ced2b03-0d09-474a-be65-2f49ddcf95fa",
"type": "main",
"index": 0
}
]
]
},
"fa81a3f1-0f28-4049-b6b2-f6f486e67e0d": {
"main": [
[
{
"node": "b8a03a91-5839-46e4-891c-e9793738f3dc",
"type": "main",
"index": 0
}
]
]
},
"fb6de8aa-2c8f-488e-8002-7aeb96861b3d": {
"main": [
[
{
"node": "b9595c92-7e9a-4688-aa12-bf558af42481",
"type": "main",
"index": 0
},
{
"node": "5f73d2cb-368a-4ca6-af4a-7e97176b35c0",
"type": "main",
"index": 0
}
]
]
},
"b9595c92-7e9a-4688-aa12-bf558af42481": {
"main": [
[
{
"node": "d8b903d3-53ec-47fd-9dfa-bdb131dae3bf",
"type": "main",
"index": 0
}
]
]
},
"6e12465c-2848-40fc-a1f8-ae2585d5882d": {
"main": [
[
{
"node": "fa81a3f1-0f28-4049-b6b2-f6f486e67e0d",
"type": "main",
"index": 0
}
]
]
},
"5f73d2cb-368a-4ca6-af4a-7e97176b35c0": {
"main": [
[
{
"node": "63d190c6-ac9d-41e7-8e36-a1a045c5cc13",
"type": "main",
"index": 0
}
]
]
},
"bc7dde1f-0afd-47c9-a851-ded2ceb37dbf": {
"main": [
[
{
"node": "f672fce1-7081-4fd1-a898-dddabe38f853",
"type": "main",
"index": 0
}
]
]
},
"b8a03a91-5839-46e4-891c-e9793738f3dc": {
"main": [
[
{
"node": "7379d69a-9066-48be-a163-fea478bb2cef",
"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é - Ingénierie, Chatbot IA
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
Stefan
@stefanPartager ce workflow