Hébergement VPS n8n | Automatisation sécurisée et évolutive
Formation n8n en Français : Automatisation & Agents IA
This workflow turns a photo of a business card sent on Telegram into a new Google Contact, fully structured (name, company, role, phone, email, address), with a duplicate check so the same card never gets saved twice. This course is your node-by-node rebuild guide for filming.
flowchart TD
A["Telegram Trigger: Get Business Card Message"] --> B["Configuration (Set)"]
B --> C{"Validate Business Card Message"}
C -- true --> D{"Check Authorized User"}
C -- false --> X1["(ignored)"]
D -- true --> E["Get Business Card Photo (Telegram file/get)"]
D -- false --> X2["(ignored)"]
E --> F["Extract Business Card Text (Mistral AI OCR)"]
F --> G["Extract Contact Fields (Information Extractor + OpenAI Chat Model)"]
G --> H["Check Duplicate Contact (Google Contacts getAll)"]
H --> I{"Is Duplicate Contact?"}
I -- true --> J["Notify Duplicate Contact (Telegram)"]
I -- false --> K["Create Google Contact"]
K --> L{"Check Contact Created"}
L -- true --> M["Notify Contact Added (Telegram)"]
L -- false --> N["Notify Contact Error (Telegram)"]
| Service | Credential name | Type | How to get it |
|---|---|---|---|
| Telegram | Telegram account | telegramApi | Talk to @BotFather on Telegram, run /newbot, copy the token into a new Telegram credential in n8n. |
| Mistral AI (OCR) | Mistral Cloud API | mistralCloudApi | Create an account at console.mistral.ai, generate an API key under API Keys, paste it into a new "Mistral Cloud API" credential in n8n. |
| OpenAI | OpenAi account | openAiApi | platform.openai.com → API keys → create a key → paste into your OpenAI credential in n8n. |
| Google Contacts | Google Contacts account | googleContactsOAuth2Api | In n8n, create a new Google Contacts OAuth2 credential and complete the Google consent screen, granting the Contacts scope. |
<aside> ⚠️
The native Mistral AI node used for OCR (n8n-nodes-base.mistralAi) takes the Telegram photo binary directly — no manual base64 conversion step is needed, unlike older HTTP-based OCR setups.
</aside>