Back to Catalog

Extract business card data from Telegram to Google Sheets with OpenRouter AI Vision

Haruki KuwaiHaruki Kuwai
368 views
2/3/2026
Official Page

Title (suggested):

Extract business card data from Telegram to Google Sheets

Who’s it for

Teams that receive business cards digitally (sales, marketing, back-office) and want a plug-and-play way to capture contacts into a sheet without manual typing.

What it does / How it works

This workflow ingests a business card sent to your Telegram bot, detects whether the message contains an image or text, extracts key fields with an AI Vision Agent (company, full name, department, job title, postal code, address, phone, mobile, fax, email, website), and appends or updates a contact row in Google Sheets automatically.

How to set up

Connect Telegram (bot token) and enable file download.

Connect your AI provider (OpenRouter or equivalent) used by the AI Vision Agent.

Connect Google Sheets and select your spreadsheet + sheet tab.

Rename nodes clearly and keep sticky notes: one overview note (this description) + step notes.

Test by sending a sample card image to your bot and verify the row is appended/updated.

Requirements

Telegram Bot API credential

AI chat/vision credential

Google Sheets OAuth credential and an accessible spreadsheet

How to customize the workflow

Map fields to your sheet headers (add/remove columns as needed).

Adjust the system prompt to prefer your locale or specific field formats.

Change the matching key for update logic (e.g., company name or email).

Add downstream steps (CRM push, dedupe rules, notifications).

Security note: Do not hardcode API keys or include real IDs/emails. Use credentials and environment configs only.

JSON

[ { "company_name": "Example Company Ltd.", "department": "Sales", "job_title": "Sales Manager", "full_name": "Taro Yamada", "postal_code": "100-0001", "address": "1-1-1 Marunouchi, Chiyoda-ku, Tokyo", "phone_number": "+81-3-0000-0000", "mobile_phone_number": "+81-90-0000-0000", "fax_number": "+81-3-1111-1111", "email": "example@company.com", "website_url": "https://example.com" } ]

Troubleshooting

Nothing appears in Google Sheets

Solution: Verify that your Google Sheets credentials are correctly authorized.

Confirm the Spreadsheet ID and Sheet Name in the node match your target file.

Make sure the Google Sheets node is connected downstream of the AI Vision Agent.

If the workflow runs successfully but nothing is added, check whether the matching column (company_name) already exists — in appendOrUpdate mode it will only update that row.

AI returns incomplete or invalid data

Solution: Review the system prompt in the AI Vision Agent to ensure it instructs the model to return a structured JSON object with all required fields (company name, full name, department, job title, address, etc.).

If the result is partial, verify the image quality of the uploaded business card — low contrast or skewed images can reduce OCR accuracy.

You can reduce temperature in the AI node to make output more deterministic.

Workflow doesn’t start automatically

Solution: Check that the workflow is activated (toggle is ON in the top right of n8n).

Verify the Webhook URL is correctly registered in Telegram’s bot settings.

Run manually once to ensure all credentials and nodes are configured correctly.

Extract Business Card Data from Telegram to Google Sheets with OpenRouter AI Vision

This n8n workflow automates the process of extracting contact information from business card images sent via Telegram and saving it into a Google Sheet. It leverages OpenRouter AI's vision capabilities to intelligently parse the image content.

What it does

This workflow simplifies the task of digitizing business cards by:

  1. Listening for Telegram Messages: Triggers when a new message is received in a configured Telegram bot.
  2. Filtering for Images: Checks if the received message contains an image.
  3. Extracting Text with AI Vision: If an image is present, it uses an OpenRouter AI Chat Model and an AI Agent to analyze the image and extract relevant business card data (e.g., name, company, title, email, phone).
  4. Structuring AI Output: Parses the AI's response into a structured JSON format.
  5. Saving to Google Sheets: Appends the extracted business card data as a new row in a specified Google Sheet.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • Telegram Bot: A Telegram bot token and chat ID.
  • OpenRouter API Key: An API key for OpenRouter to access its AI models.
  • Google Sheets: A Google account with access to Google Sheets and a specific spreadsheet and sheet name where the data will be stored. The sheet should ideally have columns corresponding to the data you expect to extract (e.g., Name, Company, Title, Email, Phone).

Setup/Usage

  1. Import the Workflow:

    • Copy the provided JSON code.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three dots menu (...) and select "Import from JSON".
    • Paste the JSON code and click "Import".
  2. Configure Credentials:

    • Telegram Trigger:
      • Click on the "Telegram Trigger" node.
      • Select or create a new Telegram API credential. You'll need your Telegram Bot Token.
    • OpenRouter Chat Model:
      • Click on the "OpenRouter Chat Model" node.
      • Select or create a new OpenRouter API credential. You'll need your OpenRouter API Key.
    • Google Sheets:
      • Click on the "Google Sheets" node.
      • Select or create a new Google Sheets API credential (OAuth 2.0 recommended). You'll need to grant n8n access to your Google Sheets.
  3. Configure Nodes:

    • Telegram Trigger: Ensure the "Updates" field is set to photo or message to capture images.
    • AI Agent:
      • Review the prompt within the "AI Agent" node to ensure it aligns with the data you want to extract from business cards. You might want to refine it for specific fields or languages.
      • Ensure the "Tools" section is configured to use an image processing tool if available, or that the prompt clearly instructs the AI to describe the image content.
    • Structured Output Parser: Verify the schema defined in this node matches the expected JSON output from the AI Agent. This is crucial for correctly parsing the extracted data.
    • Google Sheets:
      • Specify the "Spreadsheet ID" of your target Google Sheet.
      • Specify the "Sheet Name" within that spreadsheet where the data will be added.
      • Map the output fields from the "Structured Output Parser" to the corresponding columns in your Google Sheet. For example, {{ $json.name }} to the "Name" column, {{ $json.company }} to "Company", etc.
  4. Activate the Workflow:

    • Once all credentials and node settings are configured, click the "Activate" toggle in the top right corner of the n8n editor to enable the workflow.

Now, whenever you send a business card image to your configured Telegram bot, the workflow will process it, extract the contact details, and add them to your Google Sheet.

Related Templates

Two-way property repair management system with Google Sheets & Drive

This workflow automates the repair request process between tenants and building managers, keeping all updates organized in a single spreadsheet. It is composed of two coordinated workflows, as two separate triggers are required — one for new repair submissions and another for repair updates. A Unique Unit ID that corresponds to individual units is attributed to each request, and timestamps are used to coordinate repair updates with specific requests. General use cases include: Property managers who manage multiple buildings or units. Building owners looking to centralize tenant repair communication. Automation builders who want to learn multi-trigger workflow design in n8n. --- ⚙️ How It Works Workflow 1 – New Repair Requests Behind the Scenes: A tenant fills out a Google Form (“Repair Request Form”), which automatically adds a new row to a linked Google Sheet. Steps: Trigger: Google Sheets rowAdded – runs when a new form entry appears. Extract & Format: Collects all relevant form data (address, unit, urgency, contacts). Generate Unit ID: Creates a standardized identifier (e.g., BUILDING-UNIT) for tracking. Email Notification: Sends the building manager a formatted email summarizing the repair details and including a link to a Repair Update Form (which activates Workflow 2). --- Workflow 2 – Repair Updates Behind the Scenes:\ Triggered when the building manager submits a follow-up form (“Repair Update Form”). Steps: Lookup by UUID: Uses the Unit ID from Workflow 1 to find the existing row in the Google Sheet. Conditional Logic: If photos are uploaded: Saves each image to a Google Drive folder, renames files consistently, and adds URLs to the sheet. If no photos: Skips the upload step and processes textual updates only. Merge & Update: Combines new data with existing repair info in the same spreadsheet row — enabling a full repair history in one place. --- 🧩 Requirements Google Account (for Forms, Sheets, and Drive) Gmail/email node connected for sending notifications n8n credentials configured for Google API access --- ⚡ Setup Instructions (see more detail in workflow) Import both workflows into n8n, then copy one into a second workflow. Change manual trigger in workflow 2 to a n8n Form node. Connect Google credentials to all nodes. Update spreadsheet and folder IDs in the corresponding nodes. Customize email text, sender name, and form links for your organization. Test each workflow with a sample repair request and a repair update submission. --- 🛠️ Customization Ideas Add Slack or Telegram notifications for urgent repairs. Auto-create folders per building or unit for photo uploads. Generate monthly repair summaries using Google Sheets triggers. Add an AI node to create summaries/extract relevant repair data from repair request that include long submissions.

Matt@VeraisonLabsBy Matt@VeraisonLabs
208

Automate invoice processing with OCR, GPT-4 & Salesforce opportunity creation

PDF Invoice Extractor (AI) End-to-end pipeline: Watch Drive ➜ Download PDF ➜ OCR text ➜ AI normalize to JSON ➜ Upsert Buyer (Account) ➜ Create Opportunity ➜ Map Products ➜ Create OLI via Composite API ➜ Archive to OneDrive. --- Node by node (what it does & key setup) 1) Google Drive Trigger Purpose: Fire when a new file appears in a specific Google Drive folder. Key settings: Event: fileCreated Folder ID: google drive folder id Polling: everyMinute Creds: googleDriveOAuth2Api Output: Metadata { id, name, ... } for the new file. --- 2) Download File From Google Purpose: Get the file binary for processing and archiving. Key settings: Operation: download File ID: ={{ $json.id }} Creds: googleDriveOAuth2Api Output: Binary (default key: data) and original metadata. --- 3) Extract from File Purpose: Extract text from PDF (OCR as needed) for AI parsing. Key settings: Operation: pdf OCR: enable for scanned PDFs (in options) Output: JSON with OCR text at {{ $json.text }}. --- 4) Message a model (AI JSON Extractor) Purpose: Convert OCR text into strict normalized JSON array (invoice schema). Key settings: Node: @n8n/n8n-nodes-langchain.openAi Model: gpt-4.1 (or gpt-4.1-mini) Message role: system (the strict prompt; references {{ $json.text }}) jsonOutput: true Creds: openAiApi Output (per item): $.message.content → the parsed JSON (ensure it’s an array). --- 5) Create or update an account (Salesforce) Purpose: Upsert Buyer as Account using an external ID. Key settings: Resource: account Operation: upsert External Id Field: taxid_c External Id Value: ={{ $json.message.content.buyer.tax_id }} Name: ={{ $json.message.content.buyer.name }} Creds: salesforceOAuth2Api Output: Account record (captures Id) for downstream Opportunity. --- 6) Create an opportunity (Salesforce) Purpose: Create Opportunity linked to the Buyer (Account). Key settings: Resource: opportunity Name: ={{ $('Message a model').item.json.message.content.invoice.code }} Close Date: ={{ $('Message a model').item.json.message.content.invoice.issue_date }} Stage: Closed Won Amount: ={{ $('Message a model').item.json.message.content.summary.grand_total }} AccountId: ={{ $json.id }} (from Upsert Account output) Creds: salesforceOAuth2Api Output: Opportunity Id for OLI creation. --- 7) Build SOQL (Code / JS) Purpose: Collect unique product codes from AI JSON and build a SOQL query for PricebookEntry by Pricebook2Id. Key settings: pricebook2Id (hardcoded in script): e.g., 01sxxxxxxxxxxxxxxx Source lines: $('Message a model').first().json.message.content.products Output: { soql, codes } --- 8) Query PricebookEntries (Salesforce) Purpose: Fetch PricebookEntry.Id for each Product2.ProductCode. Key settings: Resource: search Query: ={{ $json.soql }} Creds: salesforceOAuth2Api Output: Items with Id, Product2.ProductCode (used for mapping). --- 9) Code in JavaScript (Build OLI payloads) Purpose: Join lines with PBE results and Opportunity Id ➜ build OpportunityLineItem payloads. Inputs: OpportunityId: ={{ $('Create an opportunity').first().json.id }} Lines: ={{ $('Message a model').first().json.message.content.products }} PBE rows: from previous node items Output: { body: { allOrNone:false, records:[{ OpportunityLineItem... }] } } Notes: Converts discount_total ➜ per-unit if needed (currently commented for standard pricing). Throws on missing PBE mapping or empty lines. --- 10) Create Opportunity Line Items (HTTP Request) Purpose: Bulk create OLIs via Salesforce Composite API. Key settings: Method: POST URL: https://<your-instance>.my.salesforce.com/services/data/v65.0/composite/sobjects Auth: salesforceOAuth2Api (predefined credential) Body (JSON): ={{ $json.body }} Output: Composite API results (per-record statuses). --- 11) Update File to One Drive Purpose: Archive the original PDF in OneDrive. Key settings: Operation: upload File Name: ={{ $json.name }} Parent Folder ID: onedrive folder id Binary Data: true (from the Download node) Creds: microsoftOneDriveOAuth2Api Output: Uploaded file metadata. --- Data flow (wiring) Google Drive Trigger → Download File From Google Download File From Google → Extract from File → Update File to One Drive Extract from File → Message a model Message a model → Create or update an account Create or update an account → Create an opportunity Create an opportunity → Build SOQL Build SOQL → Query PricebookEntries Query PricebookEntries → Code in JavaScript Code in JavaScript → Create Opportunity Line Items --- Quick setup checklist 🔐 Credentials: Connect Google Drive, OneDrive, Salesforce, OpenAI. 📂 IDs: Drive Folder ID (watch) OneDrive Parent Folder ID (archive) Salesforce Pricebook2Id (in the JS SOQL builder) 🧠 AI Prompt: Use the strict system prompt; jsonOutput = true. 🧾 Field mappings: Buyer tax id/name → Account upsert fields Invoice code/date/amount → Opportunity fields Product name must equal your Product2.ProductCode in SF. ✅ Test: Drop a sample PDF → verify: AI returns array JSON only Account/Opportunity created OLI records created PDF archived to OneDrive --- Notes & best practices If PDFs are scans, enable OCR in Extract from File. If AI returns non-JSON, keep “Return only a JSON array” as the last line of the prompt and keep jsonOutput enabled. Consider adding validation on parsing.warnings to gate Salesforce writes. For discounts/taxes in OLI: Standard OLI fields don’t support per-line discount amounts directly; model them in UnitPrice or custom fields. Replace the Composite API URL with your org’s domain or use the Salesforce node’s Bulk Upsert for simplicity.

Le NguyenBy Le Nguyen
942

Tax deadline management & compliance alerts with GPT-4, Google Sheets & Slack

AI-Driven Tax Compliance & Deadline Management System Description Automate tax deadline monitoring with AI-powered insights. This workflow checks your tax calendar daily at 8 AM, uses GPT-4 to analyze upcoming deadlines across multiple jurisdictions, detects overdue and critical items, and sends intelligent alerts via email and Slack only when immediate action is required. Perfect for finance teams and accounting firms who need proactive compliance management without manual tracking. 🏛️🤖📊 Good to Know AI-Powered: GPT-4 provides risk assessment and strategic recommendations Multi-Jurisdiction: Handles Federal, State, and Local tax requirements automatically Smart Alerts: Only notifies executives when deadlines are overdue or critical (≤3 days) Priority Classification: Categorizes deadlines as Overdue, Critical, High, or Medium priority Dual Notifications: Critical alerts to leadership + daily summaries to team channel Complete Audit Trail: Logs all checks and deadlines to Google Sheets for compliance records How It Works Daily Trigger - Runs at 8:00 AM every morning Fetch Data - Pulls tax calendar and company configuration from Google Sheets Analyze Deadlines - Calculates days remaining, filters by jurisdiction/entity type, categorizes by priority AI Analysis - GPT-4 provides strategic insights and risk assessment on upcoming deadlines Smart Routing - Only sends alerts if overdue or critical deadlines exist Critical Alerts - HTML email to executives + Slack alert for urgent items Team Updates - Slack summary to finance channel with all upcoming deadlines Logging - Records compliance check results to Google Sheets for audit trail Requirements Google Sheets Structure Sheet 1: TaxCalendar DeadlineID | DeadlineName | DeadlineDate | Jurisdiction | Category | AssignedTo | IsActive FED-Q1 | Form 1120 Q1 | 2025-04-15 | Federal | Income | John Doe | TRUE Sheet 2: CompanyConfig (single row) Jurisdictions | EntityType | FiscalYearEnd Federal, California | Corporation | 12-31 Sheet 3: ComplianceLog (auto-populated) Date | AlertLevel | TotalUpcoming | CriticalCount | OverdueCount 2025-01-15 | HIGH | 12 | 3 | 1 Credentials Needed Google Sheets - Service Account OAuth2 OpenAI - API Key (GPT-4 access required) SMTP - Email account for sending alerts Slack - Bot Token with chat:write permission Setup Steps Import workflow JSON into n8n Add all 4 credentials Replace these placeholders: YOURTAXCALENDAR_ID - Tax calendar sheet ID YOURCONFIGID - Company config sheet ID YOURLOGID - Compliance log sheet ID C12345678 - Slack channel ID tax@company.com - Sender email cfo@company.com - Recipient email Share all sheets with Google service account email Invite Slack bot to channels Test workflow manually Activate the trigger Customizing This Workflow Change Alert Thresholds: Edit "Analyze Deadlines" node: Critical: Change <= 3 to <= 5 for 5-day warning High: Change <= 7 to <= 14 for 2-week notice Medium: Change <= 30 to <= 60 for 2-month lookout Adjust Schedule: Edit "Daily Tax Check" trigger: Change hour/minute for different run time Add multiple trigger times for tax season (8 AM, 2 PM, 6 PM) Add More Recipients: Edit "Send Email" node: To: cfo@company.com, director@company.com CC: accounting@company.com BCC: archive@company.com Customize Email Design: Edit "Format Email" node to change colors, add logo, or modify layout Add SMS Alerts: Insert Twilio node after "Is Critical" for emergency notifications Integrate Task Management: Add HTTP Request node to create tasks in Asana/Jira for critical deadlines Troubleshooting | Issue | Solution | |-------|----------| | No deadlines found | Check date format (YYYY-MM-DD) and IsActive = TRUE | | AI analysis failed | Verify OpenAI API key and account credits | | Email not sending | Test SMTP credentials and check if critical condition met | | Slack not posting | Invite bot to channel and verify channel ID format | | Permission denied | Share Google Sheets with service account email | 📞 Professional Services Need help with implementation or customization? Our team offers: 🎯 Custom workflow development 🏢 Enterprise deployment support 🎓 Team training sessions 🔧 Ongoing maintenance 📊 Custom reporting & dashboards 🔗 Additional API integrations Discover more workflows – Get in touch with us

Oneclick AI SquadBy Oneclick AI Squad
93