Lecteur d'images Gemini OCR
Ceci est unDocument Extraction, Multimodal AIworkflow d'automatisation du domainecontenant 8 nœuds.Utilise principalement des nœuds comme Set, Telegram, HttpRequest, ExtractFromFile, TelegramTrigger. Extraire du texte d'images via un bot Telegram et Gemini 2.0 Flash OCR
- •Token Bot Telegram
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
Nœuds utilisés (8)
{
"id": "XqNsiUSOpgO7PRPD",
"meta": {
"instanceId": "51be389492931e958da1ec3c4cc03c8044ac06dd89d9465126f3cdb442363742",
"templateCredsSetupCompleted": true
},
"name": "Image Reader Gemini OCR",
"tags": [],
"nodes": [
{
"id": "fa672106-597a-43d6-b3c8-d7d73e9ad499",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-360,
-140
],
"webhookId": "9b8e55dc-1389-435a-95b3-030d7e30ebce",
"parameters": {
"updates": [
"message"
],
"additionalFields": {
"download": true
}
},
"credentials": {
"telegramApi": {
"id": "coZ5n0FecDwDueBA",
"name": "@RuriImageReader_bot"
}
},
"typeVersion": 1.2
},
{
"id": "552d5953-2b1e-48ff-a39b-112cae330f32",
"name": "Nettoyer les données d'entrée",
"type": "n8n-nodes-base.set",
"position": [
-140,
-140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c8cd1608-2326-401d-9c47-79a6a72f5fc7",
"name": "chatID",
"type": "number",
"value": "={{ $json.message.chat.id }}"
},
{
"id": "0f1a41cb-8630-4e10-b445-f6bbbcf91d33",
"name": "Image",
"type": "string",
"value": "={{ $json[\"message\"][\"photo\"][$json[\"message\"][\"photo\"].length - 1][\"file_id\"] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "4127fe82-7700-4292-b4fc-6fc27aa9e27c",
"name": "Obtenir le fichier",
"type": "n8n-nodes-base.telegram",
"position": [
80,
-140
],
"webhookId": "b812a0c8-e5f5-4969-9fad-a7b5b6e72dd9",
"parameters": {
"fileId": "={{ $json.Image.replace(/\\n/g, '') }}",
"resource": "file"
},
"credentials": {
"telegramApi": {
"id": "coZ5n0FecDwDueBA",
"name": "@RuriImageReader_bot"
}
},
"typeVersion": 1.2
},
{
"id": "cdee68db-f387-48d6-8b1c-2f1de0fbefea",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
80,
120
],
"webhookId": "8219e2f1-2393-40ee-9c84-88666b10d946",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Clean Input Data').item.json.chatID }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "coZ5n0FecDwDueBA",
"name": "@RuriImageReader_bot"
}
},
"typeVersion": 1.2
},
{
"id": "d9ef5251-9fb1-4810-aa78-4a393f4355e7",
"name": "Note adhésive1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-200
],
"parameters": {
"color": 4,
"width": 920,
"height": 620,
"content": "## Image Reader"
},
"typeVersion": 1
},
{
"id": "ecb87468-671d-484c-9baf-01d40e6f5de6",
"name": "Gemini OCR",
"type": "n8n-nodes-base.httpRequest",
"position": [
-360,
120
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"image/jpeg\",\n \"data\": \"{{ $json.data }}\"\n }\n },\n {\n \"text\": \"Extract text\"\n }\n ]\n }\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth"
},
"credentials": {
"httpQueryAuth": {
"id": "wcX4Li4YomZJHh1s",
"name": "Gemini API"
}
},
"typeVersion": 4.2
},
{
"id": "2990b76a-536e-48b4-8202-21b82ead2ef1",
"name": "Extraire du fichier",
"type": "n8n-nodes-base.extractFromFile",
"position": [
320,
-140
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "71b92a9e-8393-4f00-a99d-123ea4f3ed19",
"name": "Note adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-700,
-200
],
"parameters": {
"height": 1060,
"content": "## HTTP Gemini OCR Setting\n\nDefine Gemini Model on URL\n\nhttps://generativelanguage.googleapis.com/v1beta/models/[Gemini Model]:generateContent\n\nexample:\nhttps://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent\n\n...\n\nAuthentication\nGeneric Credential Type\n\nGeneric Auth Type\nQuery Auth\n\nQuery Auth\n+ Create new credential (take if from https://aistudio.google.com/)\n\n...\n\nBody Content Type\nJSON\n\nSpecify Body\nUsing JSON\n\nJSON\n{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"image/jpeg\",\n \"data\": \"{{ $json.data }}\"\n }\n },\n {\n \"text\": \"Extract text\"\n }\n ]\n }\n ]\n}"
},
"typeVersion": 1
}
],
"active": true,
"pinData": {
"Telegram Trigger": [
{
"json": {
"message": {
"chat": {
"id": 1335515855,
"type": "private",
"username": "VextCode",
"first_name": "Vext"
},
"date": 1752202117,
"from": {
"id": 1335515855,
"is_bot": false,
"username": "VextCode",
"first_name": "Vext",
"language_code": "en"
},
"photo": [
{
"width": 90,
"height": 47,
"file_id": "AgACAgUAAxkBAAN9aHB7hU8nKT7coClCdMyelOTFy-sAAsPKMRvnqolXYKE3ScdP6HABAAMCAANzAAM2BA",
"file_size": 1128,
"file_unique_id": "AQADw8oxG-eqiVd4"
},
{
"width": 320,
"height": 168,
"file_id": "AgACAgUAAxkBAAN9aHB7hU8nKT7coClCdMyelOTFy-sAAsPKMRvnqolXYKE3ScdP6HABAAMCAANtAAM2BA",
"file_size": 18516,
"file_unique_id": "AQADw8oxG-eqiVdy"
},
{
"width": 800,
"height": 420,
"file_id": "AgACAgUAAxkBAAN9aHB7hU8nKT7coClCdMyelOTFy-sAAsPKMRvnqolXYKE3ScdP6HABAAMCAAN4AAM2BA",
"file_size": 73842,
"file_unique_id": "AQADw8oxG-eqiVd9"
},
{
"width": 1200,
"height": 630,
"file_id": "AgACAgUAAxkBAAN9aHB7hU8nKT7coClCdMyelOTFy-sAAsPKMRvnqolXYKE3ScdP6HABAAMCAAN5AAM2BA",
"file_size": 86132,
"file_unique_id": "AQADw8oxG-eqiVd-"
}
],
"message_id": 125
},
"update_id": 413913388
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "c571dd01-5b7e-4ee1-88d1-d33abb86e78b",
"connections": {
"4127fe82-7700-4292-b4fc-6fc27aa9e27c": {
"main": [
[
{
"node": "2990b76a-536e-48b4-8202-21b82ead2ef1",
"type": "main",
"index": 0
}
]
]
},
"ecb87468-671d-484c-9baf-01d40e6f5de6": {
"main": [
[
{
"node": "cdee68db-f387-48d6-8b1c-2f1de0fbefea",
"type": "main",
"index": 0
}
]
]
},
"552d5953-2b1e-48ff-a39b-112cae330f32": {
"main": [
[
{
"node": "4127fe82-7700-4292-b4fc-6fc27aa9e27c",
"type": "main",
"index": 0
}
]
]
},
"fa672106-597a-43d6-b3c8-d7d73e9ad499": {
"main": [
[
{
"node": "552d5953-2b1e-48ff-a39b-112cae330f32",
"type": "main",
"index": 0
}
]
]
},
"2990b76a-536e-48b4-8202-21b82ead2ef1": {
"main": [
[
{
"node": "ecb87468-671d-484c-9baf-01d40e6f5de6",
"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é ?
Intermédiaire - Extraction de documents, 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
Rudi Afandi
@fanfanraPartager ce workflow