There are different parts briefly:
Deploy a system of agents (bots) on n8n (Cloud) to:
- Interact with users via a Telegram bot (commands, responses using predefined prompts) using Telegram webhooks.
- Parse PDF/image documents (OCR) to extract passport details (full name, passport number) and save them to a CRM.
- Automate workflows for reminders, payment checks (crypto and/or traditional payment APIs), and report generation (“Boss”).
- Store documents/files on Google Drive or other external services, and forward them to the required messengers.
2. Environment and Access
- n8n Cloud
- The Client (you) creates an account on n8n Cloud and provides the Contractor with the necessary access (login, password, invitation link).
- A basic or mid-tier plan is expected (to be agreed upon), considering the anticipated volume of automations.
- CRM
- The Contractor chooses the CRM (Bitrix24, amoCRM, Pipedrive, or any other) based on simplicity and budget.
- The Contractor configures fields to store passport data (full name, passport/ID number).
- Original documents may be stored in the CRM (if supported) or on Google Drive.
3. Telegram Bot (Commands, Webhooks, Prompts, Responses)
- Webhook-based Interaction
- Integrate the Telegram bot via webhooks to receive user messages, commands, and file uploads in real time.
- The user sends commands (e.g.,
/start
,/help
,/upload_document
), and the bot responds using predefined texts/prompts provided by the Client.
- Language Model / Knowledge Base
- Any fine-tuning or language model is the Client’s responsibility.
- The Contractor sets up API calls (if necessary) via n8n nodes to integrate with the model’s service.
- Prompt Management
- The Contractor should describe how to update or add prompts in the future (e.g., external file, spreadsheet, repository).
4. Document Parsing (OCR)
- File Types: JPG, PNG, PDF (scanned passport).
- Recognition Mechanics (Contractor’s Choice)
- Possible services: Google Cloud Vision API, Tesseract OCR, Azure Computer Vision, ABBYY Cloud OCR, etc.
- Main criteria: Ease of integration (existing n8n node or well-documented API) and Scalability (capable of handling more documents as usage grows).
- Extraction Results
- Full Name and Passport Number (or ID number) are mandatory fields.
- Additional fields (e.g., date of birth, address) may be included if necessary.
- Saving to CRM
- The Contractor implements the logic to create or update CRM records with extracted data.
- The scanned file can be attached to the CRM if supported, or stored on Google Drive with a reference link in the CRM.
5. Reminders, Payment Checks, and Reports
- Reminders
- Integrate with a calendar (e.g., Google Calendar) or schedule workflows in n8n to send reminders (via Telegram or Email) at specified times (service reminders, deadlines, etc.).
- Payments
- Integrate with crypto wallets (Binance, Coinbase, Whitepay, etc.) or standard payment services (Stripe, PayPal) via their APIs.
- On successful payment, update the CRM record and notify the customer (Telegram/Email).
- Reports (“Boss”)
- Define metrics needed (number of new requests, statuses, total payments).
- Generate a text or tabular report and send it to the “boss” (Telegram, Email, or another channel).
6. Fallback Flows, Logging, and Error Notifications
- Fallback Flows
- For each critical workflow (Telegram interaction, OCR parsing, CRM updates, payments), implement fallback paths to handle unexpected scenarios (e.g., missing data, OCR errors, network failures).
- These fallback flows should gracefully log the issue, notify the relevant party (if needed), and allow users/admins to retry or manually intervene.
- n8n Cloud Logs
- Use the built-in Execution List to track successful/failed runs.
- Assign relevant Tags or Names to each workflow for clarity.
- Error Notifications
- If an error occurs (e.g., the OCR service is unreachable, or the CRM API fails), n8n should send a notification to the contractor/administrator (Telegram or Email).
- The logs should indicate exactly which node or step failed.
- Backup
- Confirm whether regular backups of workflows are needed (e.g., exporting JSON or auto-saving to GitHub).
7. CRM Requirements (Contractor’s Discretion)
- Simplicity, Budget
- Choose a CRM with a free or low-cost plan and an open API for easy integration.
- Passport Data Fields
- At least two fields: Full Name and Passport/ID Number.
- Duplicate Prevention
- Configure logic to update existing records if the same user (phone, email, etc.) is found, avoiding duplicates.
8. Testing and Acceptance
- Test Scenarios
- Sending different file types (images, PDFs) to the bot → verifying OCR accuracy and CRM data updates.
- Creating reminders → checking that notifications are sent on schedule.
- Simulating transactions (crypto/traditional) → confirming CRM status updates.
- Generating “Boss” reports → confirming correct data and format.
- Acceptance Criteria
- At least 90% accuracy in recognizing passport data (full name, number).
- Stable workflow execution without major errors.
- Straightforward maintenance of prompts and CRM fields.