Mettre à jour automatiquement la base de connaissances à partir de Google Drive avec LlamaIndex + Azure OpenAI

Intermédiaire

Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 12 nœuds.Utilise principalement des nœuds comme If, Wait, GoogleDrive, HttpRequest, GoogleDriveTrigger. Mettre à jour automatiquement la base de connaissances en utilisant Google Drive, LlamaIndex et les embeddings Azure OpenAI

Prérequis
  • Informations d'identification Google Drive API
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Clé API OpenAI
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "049HY4CxQZX4a53d",
  "meta": {
    "instanceId": "c2650793f644091dc80fb900fe63448ad1f4b774008de9608064d67294f8307c"
  },
  "name": "Auto-Update Knowledge Base from Google Drive using LlamaIndex + Azure OpenAI",
  "tags": [],
  "nodes": [
    {
      "id": "222eab66-2d34-40a5-9748-5c701324962d",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 1888,
        "height": 1004,
        "content": "\n# Knowledge Base"
      },
      "typeVersion": 1
    },
    {
      "id": "d9eb38a7-38af-4dae-97a4-0fbb21b26c87",
      "name": "Insérer des données dans le stockage",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        1488,
        336
      ],
      "parameters": {
        "mode": "insert",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "n8n KB"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "542da5cc-ad0f-408a-babe-ce8fce3cced6",
      "name": "Embeddings Azure OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsAzureOpenAi",
      "position": [
        1488,
        560
      ],
      "parameters": {
        "model": "3small",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "id": "PyHApZfeVvAxoF4c",
          "name": "3small embedd"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "53e26710-ff6e-4325-8dc0-88380f5c4ffe",
      "name": "Chargeur de données par défaut 1",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1680,
        560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "4c86de41-8cce-49f5-93c5-44bf7127d46a",
      "name": "Vérifier l'achèvement de l'analyse 1",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "921ff875-817d-47fd-bd47-530ebdc21902",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "SUCCESS"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6dae5398-fe30-4415-84e2-74eacbad9401",
      "name": "Note adhésive 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        0
      ],
      "parameters": {
        "width": 688,
        "height": 1008,
        "content": "# 📋 Credentials Setup Guide\n\n## Required Credentials\n\n### 1. Azure OpenAI API\n**Node:** Embeddings Azure OpenAI\n- **Purpose:** Generate embeddings for vector storage\n- **Setup:**\n  1. Go to [Azure Portal](https://portal.azure.com)\n  2. Create/access Azure OpenAI resource\n  3. Navigate to \"Keys and Endpoint\"\n  4. Copy API Key and Endpoint\n  5. In n8n: Add credential \"Azure OpenAI\"\n  6. Paste API Key, Endpoint, and set deployment name to \"3small\"\n\n### 2. LlamaIndex API\n**Node:** Parse Document via LlamaIndex1\n- **Purpose:** Parse documents using LlamaIndex cloud service\n- **Setup:**\n  1. Visit [LlamaIndex Cloud](https://cloud.llamaindex.ai)\n  2. Sign up/login to account\n  3. Go to API Settings\n  4. Generate new API key\n  5. In n8n: Add \"HTTP Header Auth\" credential\n  6. Header Name: `Authorization`\n  7. Header Value: `Bearer YOUR_API_KEY`\n\n### 3. Google Drive OAuth2\n**Node:** Knowledge Base Updated Trigger1 & Download Knowledge Document1\n- **Purpose:** Monitor and download files from Google Drive\n- **Setup:**\n  1. Go to [Google Cloud Console](https://console.cloud.google.com)\n  2. Create new project or select existing\n  3. Enable Google Drive API\n  4. Create OAuth 2.0 credentials\n  5. Add authorized redirect URI from n8n\n  6. In n8n: Add \"Google Drive OAuth2\" credential\n  7. Enter Client ID and Client Secret\n  8. Complete OAuth flow"
      },
      "typeVersion": 1
    },
    {
      "id": "b6840dfd-cfbe-4362-a9df-2b7fce796a1f",
      "name": "Déclencheur de mise à jour de la base de connaissances",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        144,
        464
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFile",
        "fileToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "10maY1IaeelAKV5xBe5DsHiKEXCoAeAFuH2sWfZkvXa4",
          "cachedResultUrl": "https://docs.google.com/document/d/10maY1IaeelAKV5xBe5DsHiKEXCoAeAFuH2sWfZkvXa4/edit?usp=drivesdk",
          "cachedResultName": "n8n Template Guideline"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "qhTzSrkPoDyRkz5w",
          "name": "contactkhmuhtadin@gmail.com"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "944bc27a-4d5d-450e-a4be-6a3fa361dbf5",
      "name": "Télécharger le document de connaissances",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        368,
        464
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "list",
          "value": "10maY1IaeelAKV5xBe5DsHiKEXCoAeAFuH2sWfZkvXa4",
          "cachedResultUrl": "https://docs.google.com/document/d/10maY1IaeelAKV5xBe5DsHiKEXCoAeAFuH2sWfZkvXa4/edit?usp=drivesdk",
          "cachedResultName": "n8n Template Guideline"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "qhTzSrkPoDyRkz5w",
          "name": "contactkhmuhtadin@gmail.com"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "36d2a934-2b82-42f8-9296-bd72099f97bf",
      "name": "Analyser le document via LlamaIndex",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        592,
        464
      ],
      "parameters": {
        "url": "https://api.cloud.llamaindex.ai/api/v1/parsing/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "4hJbMGqzerAxpVEw",
          "name": "llamaindex"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dc9d019c-5d7b-494f-afb2-e22fd602f6de",
      "name": "Surveiller le traitement du document",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        464
      ],
      "parameters": {
        "url": "=https://api.cloud.llamaindex.ai/api/v1/parsing/job/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "4hJbMGqzerAxpVEw",
          "name": "llamaindex"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "431b88a4-7b20-424c-afd4-cf3afab67f69",
      "name": "Récupérer le contenu analysé",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1264,
        336
      ],
      "parameters": {
        "url": "=https://api.cloud.llamaindex.ai/api/v1/parsing/job/{{ $json.id }}/result/markdown",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "4hJbMGqzerAxpVEw",
          "name": "llamaindex"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5ffdad42-66de-4899-838e-83aacacd231e",
      "name": "Attente avant revérification du statut",
      "type": "n8n-nodes-base.wait",
      "position": [
        1264,
        560
      ],
      "webhookId": "ba3e8cc1-4b9e-4eee-bf41-78862eea8023",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "db6d5f9f-520b-4b72-a4fc-f1985143580f",
  "connections": {
    "53e26710-ff6e-4325-8dc0-88380f5c4ffe": {
      "ai_document": [
        [
          {
            "node": "d9eb38a7-38af-4dae-97a4-0fbb21b26c87",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "542da5cc-ad0f-408a-babe-ce8fce3cced6": {
      "ai_embedding": [
        [
          {
            "node": "d9eb38a7-38af-4dae-97a4-0fbb21b26c87",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "431b88a4-7b20-424c-afd4-cf3afab67f69": {
      "main": [
        [
          {
            "node": "d9eb38a7-38af-4dae-97a4-0fbb21b26c87",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4c86de41-8cce-49f5-93c5-44bf7127d46a": {
      "main": [
        [
          {
            "node": "431b88a4-7b20-424c-afd4-cf3afab67f69",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "5ffdad42-66de-4899-838e-83aacacd231e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5ffdad42-66de-4899-838e-83aacacd231e": {
      "main": [
        [
          {
            "node": "dc9d019c-5d7b-494f-afb2-e22fd602f6de",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "944bc27a-4d5d-450e-a4be-6a3fa361dbf5": {
      "main": [
        [
          {
            "node": "36d2a934-2b82-42f8-9296-bd72099f97bf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dc9d019c-5d7b-494f-afb2-e22fd602f6de": {
      "main": [
        [
          {
            "node": "4c86de41-8cce-49f5-93c5-44bf7127d46a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "36d2a934-2b82-42f8-9296-bd72099f97bf": {
      "main": [
        [
          {
            "node": "dc9d019c-5d7b-494f-afb2-e22fd602f6de",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b6840dfd-cfbe-4362-a9df-2b7fce796a1f": {
      "main": [
        [
          {
            "node": "944bc27a-4d5d-450e-a4be-6a3fa361dbf5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

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é ?

Intermédiaire - Création de contenu, 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.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds12
Catégorie2
Types de nœuds9
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34