This automation is an AI-powered News Digest Agent that turns a simple Telegram message into a structured news report delivered as a PDF and (optionally) via email. It eliminates the need to manually search, compile, format, and distribute news updates.

Telegram-Triggered Input:
The workflow starts when a user sends a message to the Telegram bot. The agent reads the raw text message and validates that it contains a proper chat and message payload before processing.
AI-Powered Parameter Extraction:
The user’s message is sent to an AI model that intelligently extracts key parameters such as:
Search keywords (q)
Language
Country
News category
Email address (if present)
This allows users to request news in natural language like:
“Send me AI news in English from the US and email it to me.”
Smart Query Normalization:
The extracted AI output is cleaned, validated, and converted into a structured JSON object. If the user does not provide specific parameters, the agent automatically applies safe defaults (e.g., AI/ML-related news, English language, US region).
Automated News Gathering (GNews API):
Using the structured parameters, the agent queries the GNews API and fetches the latest relevant articles based on:
Keywords
Language
Country
Category
Configurable max number of articles
Article Processing & Structuring:
The workflow splits the returned articles and standardizes fields such as:
Title
Publisher
Summary
Source URL
Content
Images
Publish date
This ensures a clean and consistent dataset for report generation.
AI-Formatted HTML Report Generation:
All collected news articles are automatically compiled into a well-designed HTML digest that includes:
Categorized headline sections
Article metadata (publisher, date, sources)
Summaries and content snippets
Clickable links and images
Proper formatting and HTML escaping for safety
Automatic PDF Conversion:
The generated HTML report is converted into a professional PDF document using a headless Chromium (Gotenberg) conversion service. This produces a clean, shareable news digest file.
Instant Delivery via Telegram:
The final PDF news digest is automatically sent back to the user on Telegram as a document attachment with a formatted caption and date-based filename.
Conditional Email Distribution (Smart Detection):
If the AI detects a valid email address inside the user’s original Telegram message, the agent automatically:
Attaches the generated PDF
Sends it via Gmail
Delivers the same news digest directly to the extracted email address
This makes the workflow both chat-driven and email-aware without requiring manual input forms.
Usage Ideas
Personal News Assistant:
Receive customized daily or on-demand news digests directly in Telegram and email.
Executive Briefings:
Automatically generate topic-specific PDF briefings (AI, business, technology, etc.) for leadership teams.
Research Monitoring:
Track specific domains like AI, cybersecurity, or finance and get structured reports instead of raw news feeds.
Newsletter Automation:
Use the generated PDF as a ready-to-send newsletter for audiences or communities.
Content Curation for Communities:
Telegram channels or groups can receive formatted, high-quality news digests automatically.
Client Intelligence Reports:
Send tailored industry news reports to clients based on keywords and region.
Customization Ideas
This agent is highly modular and can be easily adapted to different use cases:
Change News Source:
Replace GNews API with other providers (NewsAPI, RSS feeds, custom databases).
Adjust Report Format:
Modify the HTML template to include branding, logos, charts, or summaries.
Control Article Volume:
Change the max articles parameter to produce shorter or longer digests.
Enhance AI Intelligence:
Update the AI prompt to:
Extract more fields (dates, sentiment, priority)
Summarize articles
Translate content
Rank news importance
Multi-Channel Delivery:
Extend output destinations beyond Telegram and Gmail to:
Slack
Notion
Google Drive
Webhooks
CMS systems
Localization:
Adapt language, country filters, and formatting for regional news delivery.
Parameters
Required Parameters
Name | Type | Default | Description |
telegramMessage | string | None | User’s input message that contains news request instructions |
Optional Parameters (Auto-Extracted by AI)
Name | Type | Default | Description |
q | string | "Agentic AI OR ML OR deeplearning" | Search keywords for news retrieval |
lan | string | "en" | 2-letter language code for news filtering |
country | string | "us" | 2-letter country code for regional news |
category | string | "general" | News category (technology, business, science, etc.) |
string | "" | Email address extracted from the message (if provided) | |
maxArticles | number | 5 | Maximum number of news articles included in the digest |