What You'll Build
Every day at 7am and 4pm, you'll receive a Telegram message with:
- π Count and list of today's appointments
- π§ Number of new emails since last check
- β οΈ Emails flagged as urgent (inspection, contract, etc.)
What You Need (All Free)
- n8n (self-hosted on Railway, ~$5/mo or free tier)
- Google Gmail API (free)
- Google Calendar API (free)
- Telegram Bot (free)
Step-by-Step Build Instructions
Step 1: Deploy n8n (15 minutes)
- Create account at railway.app
- Click "New Project" β "Deploy n8n"
- Wait 2 minutes for deployment
- Click the URL Railway gives you
- Create your n8n admin account
Cost: ~$5/month after trial (or use Railway's free tier)
Step 2: Create Telegram Bot (5 minutes)
- Open Telegram, search for @BotFather
- Send:
/newbot - Follow prompts: name your bot (e.g., "My Daily Brief")
- Save the API token BotFather gives you
- Send a message to your new bot to start it
- Find your chat ID: Visit
https://api.telegram.org/bot[YOUR_TOKEN]/getUpdates
Save these: Bot Token + Chat ID
Step 3: Connect Gmail & Calendar (10 minutes)
- In n8n, click "Credentials" β "New"
- Add "Google OAuth2 API" credential
- Go to Google Cloud Console
- Create project β Enable Gmail API + Calendar API
- Create OAuth credentials (Web application)
- Add authorized redirect:
https://[YOUR-N8N-URL]/rest/oauth2-credential/callback - Copy Client ID and Secret to n8n
- Click "Connect" in n8n and authorize with your Google account
Step 4: Build the Workflow (20 minutes)
In n8n, create a new workflow with these nodes:
Node 1: Schedule Trigger (7am daily)
- Type: Schedule Trigger
- Mode: Every Day
- Time: 07:00
Node 2: Get Calendar Events
- Type: Google Calendar β Get Many Events
- Calendar: Your primary calendar
- Start Time:
{{$now}} - End Time:
{{$now.plus(1, 'day')}}
Node 3: Get Emails
- Type: Gmail β Get Many Messages
- Search Query:
newer_than:12h - Max Results: 50
Node 4: Format Message
- Type: Code (JavaScript)
- Paste this code:
// Count events and emails
const events = $input.all()[0].json.length;
const emails = $input.all()[1].json.length;
// Check for urgent keywords
const urgentEmails = $input.all()[1].json.filter(msg => {
const subject = msg.subject || '';
return subject.toLowerCase().includes('urgent') ||
subject.toLowerCase().includes('inspection') ||
subject.toLowerCase().includes('contract') ||
subject.toLowerCase().includes('asap');
});
const urgentCount = urgentEmails.length;
// Get today's events list
const eventList = $input.all()[0].json.slice(0, 5).map(e => {
const time = new Date(e.start).toLocaleTimeString('en-US', {
hour: 'numeric', minute: '2-digit'
});
return `${time}: ${e.summary}`;
}).join('\n');
return [{
json: {
text: `π
Good Morning!\n\nToday's Appointments: ${events}\n${eventList || 'No events today'}\n\nπ§ Overnight Emails: ${emails}\nβ οΈ Urgent: ${urgentCount}`
}
}];
Node 5: Send Telegram Message
- Type: Telegram β Send Message
- Credential: Your Telegram bot
- Chat ID: Your chat ID
- Text:
{{$json.text}}
Step 5: Test & Activate (5 minutes)
- Click "Test Workflow" - you should get a Telegram message immediately
- If it works, click "Save" then "Activate"
- Duplicate this workflow
- Change trigger to 16:00 (4pm)
- Change email query to
newer_than:9h(since 7am) - Save and activate second workflow
Expected Results
Each morning and afternoon, you'll receive a message like:
π Good Morning!
Today's Appointments: 3
10:00 AM: Listing Walkthrough
2:00 PM: Buyer Consultation
4:30 PM: Closing Docs
π§ Overnight Emails: 4
β οΈ Urgent: 1
Build It Yourself