Opening Problem Statement: Manual Receipt Logging Wasting Alex’s Time
Meet Alex, a small business owner who receives dozens of expense receipts every week from his remote team through Telegram. Each receipt is an image that Alex must manually download, read, and enter the data—like vendor, amounts, dates—into his Airtable expense tracker. This repetitive task eats up hours weekly, causing frustration, mistakes, and delays in financial tracking. Input errors often occur, and Alex risks missing important tax deductions because of inconsistent recording. He needs a streamlined, automated way to capture receipt data that saves time and prevents errors.
What This Automation Does
This n8n workflow transforms Alex’s receipt management from a manual slog to a seamless, automated pipeline. When a receipt image is sent to a Telegram bot, this workflow:
- Automatically triggers upon receipt of any Telegram update involving image files.
- Uploads the image file to an AWS S3 bucket for secure storage and future reference.
- Uses AWS Textract OCR service to extract text data from the receipt image accurately.
- Parses and appends the extracted receipt information directly into a designated Airtable database table for tracking expenses.
- Eliminates manual data entry, cutting down hours spent weekly on expense reports.
- Ensures consistent, accurate financial records with less risk of human error.
Prerequisites ⚙️
- n8n account with required nodes enabled (Telegram Trigger, AWS S3, AWS Textract, Airtable)
- Telegram bot API token with relevant permissions to receive messages and media 📱
- AWS credentials with access to S3 buckets and Textract OCR service 🔐
- Airtable account with an existing base and table (e.g., “receipts”) for appending data 📊
- Optional: n8n self-hosting for full control (see Hostinger hosting guide)
Step-by-Step Guide to Build This Telegram Receipt Extraction Workflow
Step 1: Set up Telegram Trigger Node
Navigate to your n8n editor, click + Add Node → search “Telegram Trigger” and add it. Configure:
- Under Credentials, select or create your Telegram bot API credential.
- In Parameters, set Updates to
["*"]so it triggers on all updates. - Enable Download option and set Image Size to “medium” to download image files.
You should see the webhook URL auto-generated. This URL will receive updates from Telegram when an image is sent to your bot.
Common mistake: Forgetting to enable image download, which causes the workflow to receive only metadata, not the actual file.
Step 2: Configure AWS S3 Node to Upload Image
Add an AWS S3 node. Set it to Upload operation, and in File Name enter {{$binary.data.fileName}} to use the file’s original name dynamically.
- Specify your Bucket Name where file storage is configured, such as “textract-demodata.”
- Under Credentials, select your AWS credentials with S3 access.
This will upload the downloaded Telegram image directly to your AWS S3 bucket for persistent storage.
Common mistake: Misnaming the bucket or missing AWS S3 permissions.
Step 3: Set up AWS Textract Node for Text Extraction
Add the AWS Textract node next. This node leverages OCR in AWS Textract to read texts from images stored in S3.
- Connect the incoming data from the AWS S3 node output (this carries file info).
- Under Credentials, again select the AWS credentials but with Textract permissions.
- No extensive config needed; the node automatically detects the file uploaded to S3.
Common mistake: AWS Textract access missing, or the image not successfully uploaded to S3 before triggering Textract.
Step 4: Append Extracted Data to Airtable
Add an Airtable node configured to Append operation. Choose the base named “qwertz” and the “receipts” table where you log expenses.
- Map Textract extracted text fields to Airtable columns: vendor, date, amount, etc., depending on how you parse the Textract output.
- Ensure your Airtable API credential is selected in Credentials.
After this step, each new receipt image processed results in a new record in your receipts Airtable table with parsed data from the image.
Common mistake: Not mapping the extracted data fields properly, causing incomplete records.
Step 5: Connect Nodes in Sequential Order
Ensure the flow is: Telegram Trigger → AWS S3 node (upload) → AWS Textract (extract text) → Airtable (append record).
This ensures data flows correctly from receipt upload to data extraction and storage in Airtable.
Customizations ✏️
- Change Image Size in Telegram Trigger: Modify the Image Size parameter to “large” or “small” to balance quality and data usage.
- Parse Specific Textract Fields: Add a Code node after Textract to parse complex JSON output into individual fields like vendor name, date, and total amount before appending to Airtable.
- Use Multiple Airtable Tables: Create separate tables for categories (e.g., travel, meals) and direct parsed receipt data to different tables conditionally by adding IF nodes.
Troubleshooting 🔧
Problem: “No file found in Telegram trigger”
Cause: Image download option was not enabled in Telegram Trigger node.
Solution: Go back to the Telegram Trigger settings, enable Download and choose the image size.
Problem: “Access denied for AWS Textract”
Cause: AWS credentials lack Textract permissions.
Solution: Adjust IAM role/policy in AWS console to include Textract permissions and reauthenticate in n8n.
Problem: “No bucket found or file upload failed”
Cause: Incorrect Bucket name or missing S3 upload permissions.
Solution: Verify bucket exists in AWS S3, correct bucket name spelling, and ensure the IAM user has S3 PUT permissions.
Pre-Production Checklist ✅
- Verify Telegram bot is connecting and receiving image updates (test with sample images).
- Check AWS S3 bucket exists and your IAM user can upload files.
- Confirm AWS Textract service is enabled, and credentials have full access.
- Validate Airtable base and table exist and API token works.
- Test the entire workflow with one receipt image from Telegram before going live.
Deployment Guide
Once tested, activate the Telegram Trigger node’s webhook. Ensure your bot is publicly accessible for receiving messages. Monitor n8n’s execution logs for issues. Optionally set up analytic alerts for failed executions or processing errors in Airtable or AWS. This workflow runs fully automated without daily maintenance.
FAQs
Q: Can I use Google Drive instead of AWS S3?
A: Yes, but you’d need to swap the AWS S3 node for a Google Drive node and adjust Textract input accordingly, or use Google Cloud Vision instead.
Q: Does this workflow consume AWS Textract API credits?
A: Yes, each image you process counts as a Textract API call, so monitor your AWS costs accordingly.
Q: Is the data secure?
A: Data is stored securely in AWS S3 and Airtable with authentication controls. Be sure to use encrypted buckets and secure your API tokens.
Conclusion
By following this detailed workflow, you’ve automated the tedious task of logging receipt data sent through Telegram using AWS Textract OCR and Airtable. This relieves Alex of hours of manual work weekly and helps ensure accurate financial records without input errors.
Next, consider automating invoice processing or integrating notification systems to alert you when new receipts are logged. With this workflow, receipt management becomes efficient, reliable, and hands-free.