Send personalized job application emails with Telegram, OpenAI, and Gmail
π§ Setup Guide - Hiring Bot Workflow
π Prerequisites
Before importing this workflow, make sure you have:
β n8n Instance (cloud or self-hosted) β Telegram Bot Token (from @BotFather) β OpenAI API Key (with GPT-4 Vision access) β Gmail Account (with OAuth setup) β Google Drive (to store your resume) β Redis Instance (free tier available at Redis Cloud)
π Step-by-Step Setup
1οΈβ£ Upload Your Resume to OpenAI
First, you need to upload your resume to OpenAI's Files API:
Upload your resume to OpenAI
curl https://api.openai.com/v1/files
-H "Authorization: Bearer YOUR_OPENAI_API_KEY"
-F purpose="assistants"
-F file="@/path/to/your/resume.pdf"
Important: Save the file_id from the response (looks like file-xxxxxxxxxxxxx)
Alternative: Use OpenAI Playground or Python: from openai import OpenAI client = OpenAI(api_key="YOUR_API_KEY")
with open("resume.pdf", "rb") as file: response = client.files.create(file=file, purpose="assistants") print(f"File ID: {response.id}")
2οΈβ£ Upload Your Resume to Google Drive
Go to Google Drive Upload your resume PDF Right-click β "Get link" β Copy the file ID from URL URL format: https://drive.google.com/file/d/FILE_ID_HERE/view Example ID: 1h79U8IFtI2dp_OBtnyhdGaarWpKb9qq9
3οΈβ£ Create a Telegram Bot
Open Telegram and message @BotFather Send /newbot Choose a name and username Save the Bot Token (looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz) (Optional) Set bot commands: /start - Start the bot /help - Get help 4οΈβ£ Set Up Redis
Option A: Redis Cloud (Recommended - Free) Go to Redis Cloud Create a free account Create a database Note: Host, Port, Password
Option B: Local Redis Docker docker run -d -p 6379:6379 redis:latest
Or via package manager sudo apt-get install redis-server
5οΈβ£ Import the Workflow to n8n
Open n8n Click "+" β "Import from File" Select Hiring_Bot_Anonymized.json Workflow will import with placeholder values
6οΈβ£ Configure Credentials
A. Telegram Bot Credentials In n8n, go to Credentials β Create New Select "Telegram API" Enter your Bot Token from Step 3 Test & Save
B. OpenAI API Credentials Go to Credentials β Create New Select "OpenAI API" Enter your OpenAI API Key Test & Save
C. Redis Credentials Go to Credentials β Create New Select "Redis" Enter: Host: Your Redis host Port: 6379 (default) Password: Your Redis password Test & Save
D. Gmail Credentials Go to Credentials β Create New Select "Gmail OAuth2 API" Follow OAuth setup flow Authorize n8n to access Gmail Test & Save
E. Google Drive Credentials Go to Credentials β Create New Select "Google Drive OAuth2 API" Follow OAuth setup flow Authorize n8n to access Drive Test & Save
7οΈβ£ Update Node Values
A. Update OpenAI File ID in "PayloadForReply" Node
Double-click the "PayloadForReply" node Find this line in the code: const resumeFileId = "YOUR_OPENAI_FILE_ID_HERE"; Replace with your actual OpenAI file ID from Step 1: const resumeFileId = "file-xxxxxxxxxxxxx"; Save the node
B. Update Google Drive File ID (Both "Download Resume" Nodes)
There are TWO nodes that need updating:
Node 1: "Download Resume" Double-click the node In the "File ID" field, click "Expression" Replace YOUR_GOOGLE_DRIVE_FILE_ID with your actual ID Update "Cached Result Name" to your resume filename Save
Node 2: "Download Resume1" (same process) Double-click the node Update File ID Update filename Save
8οΈβ£ Assign Credentials to Nodes
After importing, you need to assign your credentials to each node:
Nodes that need credentials:
| Node Name | Credential Type | |-----------|----------------| | Telegram Trigger | Telegram API | | Generating Reply | OpenAI API | | Store AI Reply | Redis | | GetValues | Redis | | Download Resume | Google Drive OAuth2 | | Download Resume1 | Google Drive OAuth2 | | Schedule Email | Gmail OAuth2 | | SendConfirmation | Telegram API | | Send a message | Telegram API | | Edit a text message | Telegram API | | Send a text message | Telegram API | | Send a chat action | Telegram API |
How to assign: Click on each node In the "Credentials" section, select your saved credential Save the node
π§ͺ Testing the Workflow
1οΈβ£ Activate the Workflow Click the "Active" toggle in the top-right Workflow should now be listening for Telegram messages
2οΈβ£ Test with a Job Post Find a job post online (LinkedIn, Indeed, etc.) Take a screenshot Send it to your Telegram bot Bot should respond with: "Analyzing job post..." (typing indicator) Full email draft with confirmation button
3οΈβ£ Test Email Sending Click "Send The Email" button Check Gmail to verify email was sent Check if resume was attached
π Troubleshooting
Issue: "No binary image found" Solution:** Make sure you're sending an image file, not a document
Issue: "Invalid resume file_id" Solution:** Check OpenAI file_id format (starts with file-) Verify file was uploaded successfully Make sure you updated the code in PayloadForReply node
Issue: "Failed to parse model JSON" Solution:** Check OpenAI API quota/limits Verify model name is correct (gpt-5.2) Check if image is readable
Issue: Gmail not sending Solution:** Re-authenticate Gmail OAuth Check Gmail permissions Verify "attachments" field is set to "Resume"
Issue: Redis connection failed Solution:** Test Redis connection in credentials Check firewall rules Verify host/port/password
Issue: Telegram webhook not working Solution:** Deactivate and reactivate workflow Check Telegram bot token is valid Make sure bot is not blocked
π Security Best Practices
Never share your credentials - Keep API keys private Use environment variables in n8n for sensitive data Set up Redis password - Don't use default settings Limit OAuth scopes - Only grant necessary permissions Rotate API keys regularly Monitor usage - Check for unexpected API calls
π¨ Customization Ideas
Change AI Model In the PayloadForReply node, update: const MODEL = "gpt-5.2"; // Change to gpt-4, claude-3-opus, etc.
Adjust Email Length Modify the system prompt: // From: Email body: ~120β180 words unless INSIGHTS specify otherwise.
// To: Email body: ~100β150 words for concise applications.
Add More Languages Update language detection logic in the system prompt to support more languages.
Custom Job Filtering Edit the system prompt to target specific roles: // From: Only pick ONE job offer to process β the one most clearly related to Data roles
// To: Only pick ONE job offer to process β the one most clearly related to [YOUR FIELD]
Add Follow-up Reminders Add a "Wait" node after email sends to schedule a reminder after 7 days.
π Workflow Structure
Telegram Input β Switch (Route by type) β ββ New Job Post β β β Send Chat Action (typing...) β β β PayloadForReply (Build AI request) β β β Generating Reply (Call OpenAI) β β β FormatAiReply (Parse JSON) β β β Store AI Reply (Redis cache) β β β SendConfirmation (Show preview) β ββ Callback (User clicked "Send") β GetValues (Fetch from Redis) β Format Response β Download Resume (from Drive) β ββ Path A: Immediate Send β β β Send Confirmation Message β β β Edit Message (update status) β ββ Path B: Scheduled Send β Wait (10 seconds) β Download Resume Again β Schedule Email (Gmail) β Send Success Message
π‘ Tips for Best Results
High-Quality Resume: Upload a well-formatted PDF resume Clear Screenshots: Take clear, readable job post screenshots Use Captions: Add instructions via Telegram captions Example: "make it more casual" Example: "send to recruiter@company.com" Review Before Sending: Always read the draft before clicking send Update Resume Regularly: Keep your Google Drive resume current Test First: Try with a few test jobs before mass applying
π Need Help?
π n8n Documentation π¬ n8n Community Forum πΊ n8n YouTube Channel π€ OpenAI Documentation π± Telegram Bot API Docs
π Checklist
Use this checklist to verify your setup:
[ ] OpenAI resume file uploaded (got file_id) [ ] Google Drive resume uploaded (got file ID) [ ] Telegram bot created (got bot token) [ ] Redis instance created (got credentials) [ ] All n8n credentials created and tested [ ] PayloadForReply node updated with OpenAI file_id [ ] Both Download Resume nodes updated with Drive file_id [ ] All nodes have credentials assigned [ ] Workflow activated [ ] Test message sent successfully [ ] Test email received successfully
π You're all set! Start applying to jobs in 10 seconds!
Made with β€οΈ and n8n
Related Templates
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Add product ideas to Google Sheets via a Slack
Use Case This workflow is a slight variation of a workflow we're using at n8n. In most companies, employees have a lot o...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments