π¬ Summarize PDF documents in Telegram with Groq AI
β‘ 62 views Β· π¬ Document Extraction & Analysis
Description
How It Works
Telegram Trigger β Sub-Workflow (Separate Text/Files) β IF (Is PDF?)
βββ True: Extract PDF β Set Text β Code (Clean) β Done!
βββ False: NoOp (Ignore)
- 9 nodes: Lightweight, efficient (no loops).
- Key Steps:
- Triggers on Telegram messages - downloads files.
- Sub-workflow splits text/files. (Optional but recommended)
- IF node checks MIME type/extension for PDFs.
- Extracts text via βExtract From Fileβ node.
- AI writes summary.
- Responds to user.
Setup Instructions
IMPORTANT : Requiring an n8n instance to be configured with public/production webhook !
Recommendation: Ngrok or Cloudflare Tunnel
- Add the Telegram credential
- Go to Credentials β New Credential β Telegram API.
- Paste your Bot Token.
- Configure the Trigger
- Open the Telegram Trigger node.
- Ensure
Trigger OncontainsMessage. - Enable Download under Additional Fields so file payloads are attached to the node output.
- (Optional) Enable the subβworkflow Automate Telegram Message Processing - Separate Text and Files π¬π
- If you need both message text and attachments, enable the Automate Telegram Message Processing β Separate Text and Files node and import the referenced workflow into your workspace.
- Deploy the workflow and activate it.
- Testing Send a message with a PDF attachment to your Telegram bot. There will be a response from the chat that summarizes the PDF content.
Nodes Used
- Telegram Trigger: Listens for incoming messages and downloads attachments.
- Execute Workflow: Calls a sub-workflow to separate text and file data (recommended for reliable file handling).
- If: Checks MIME type to ensure the file is a PDF.
- Extract From File: Converts the PDF binary into text.
- Set: Assignments to organize the text data.
- Code: Cleans the text (removes excess newlines) to prepare it for the LLM.
- Basic LLM Chain: Orchestrates the AI prompt and processing.
- AI Chat Model: The specific LLM provider used for high-speed inference.
- Telegram: Sends the final summary back to the user.
Output Example
The bot will reply with a message formatted like this: > Title: Q3 Financial Report > Type: Financial Report > Exec Summary: Revenue increased by 15% due to new product lines⦠> Key Insights: > ⒠Growth in APAC region. > ⒠Reduced operational costs by 5%.
π Thank You for Trying This Workflow!
Your time and trust mean a lot! I truly appreciate you using this template.
Your feedback shapes future updates:
- π‘ Suggestions for improvement
- π Ideas for new features
- π Requests for other automation workflows
Please share your thoughts! Every idea helps shape the next update.
πββοΈ Join & Follow For More Free Templates!
-
Discord Community: We Work Together
Get help, share builds, collaborate! Daily tips, tutorials, and updates
Thank you again for being part of this journey! π
Together, we automate better! π€β¨
π Nodes Used
Telegram, Telegram Trigger, Basic LLM Chain, Extract from File, Groq Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File