To create an n8n workflow that:
- Fetches posts and titles from a Dev.to blog (using their API),
- Sends each post to Google Gemini for analysis,
- Filters the posts where Gemini says it should be on your website/blog,
- Sends the selected posts' info to your Telegram account,
You'll need to use several nodes in n8n.
✅ Prerequisites
1. Accounts & Keys:
🧱 Step-by-Step Workflow Design in n8n
🔹 1. HTTP Request Node – Get Posts from Dev.to
Purpose: Fetch recent posts from Dev.to.
Replace YOUR_DEV_USERNAME and YOUR_DEVTO_API_KEY.
🔹 2. Function Item Node – Extract Titles & Body
Use this node to extract only the relevant data (title, body_markdown, etc.).
return {
json: {
title: item.json.title,
body: item.json.body_markdown,
url: item.json.url
}
}
🔹 3. Google Gemini (Generative AI) Node – Analyze Post
Purpose: Ask Gemini if the post should go on your blog.
- Node Type:
Google Gemini (you may need to set up credentials in n8n)
- Model:
gemini-pro
- Prompt:
Analyze the following blog post. Should I publish it on my blog?
Title: {{title}}
Content: {{body}}
Answer only "Yes" or "No".
🔹 4. IF Node – Filter Posts That Should Be Published
Condition:
Check if the Gemini response is "Yes".
- Expression:
{{ $json["geminiResponse"] == "Yes" }}
🔹 5. Telegram Node – Send Selected Posts to Your Channel or Chat
Node Type: Telegram
- Operation:
Send Message
- Chat ID: Your Telegram chat ID
- Message Text:
New post recommended for your blog:
Title: {{title}}
Link: {{url}}
🧪 Optional Improvements
- Add a delay between requests to avoid hitting rate limits.
- Use a Loop node if you want to process multiple posts at once.
- Save already-sent posts to avoid duplicates (use
Set or Read/Write Binary Data).
📦 Sample JSON Export of the Workflow
Here’s a simplified version of what the exported JSON might look like:
{
"nodes": [
{
"parameters": {
"url": "https://dev.to/api/articles?username=your_username",
"method": "GET",
"headers": [
{
"key": "api-key",
"value": "={{$credentials.devtoApiKey}}"
}
]
},
"name": "Get Dev.to Posts",
"type": "n8n-nodes-base.httpRequest"
},
{
"parameters": {
"functionCode": "return {\n json: {\n title: item.json.title,\n body: item.json.body_markdown,\n url: item.json.url\n }\n}"
},
"name": "Extract Title & Body",
"type": "n8n-nodes-base.functionItem"
},
{
"parameters": {
"model": "gemini-pro",
"prompt": "Analyze the following blog post. Should I publish it on my blog?\nTitle: {{title}}\nContent: {{body}}\n\nAnswer only \"Yes\" or \"No\"."
},
"name": "Gemini Analysis",
"type": "n8n-nodes-base.googleGemini"
},
{
"parameters": {
"condition": "{{$json[\"geminiResponse\"] == \"Yes\"}}"
},
"name": "IF Post Approved",
"type": "n8n-nodes-base.if"
},
{
"parameters": {
"operation": "sendMessage",
"chatId": "your_telegram_chat_id",
"text": "New post recommended for your blog:\nTitle: {{title}}\nLink: {{url}}"
},
"name": "Send to Telegram",
"type": "n8n-nodes-base.telegram"
}
],
"connections": {
"Get Dev.to Posts": {
"main": [
[
{
"node": "Extract Title & Body",
"type": "main",
"index": 0
}
]
]
},
"Extract Title & Body": {
"main": [
[
{
"node": "Gemini Analysis",
"type": "main",
"index": 0
}
]
]
},
"Gemini Analysis": {
"main": [
[
{
"node": "IF Post Approved",
"type": "main",
"index": 0
}
]
]
},
"IF Post Approved": {
"main": [
[],
[
{
"node": "Send to Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}
💡 Tips
- You can schedule this workflow using a Cron Trigger Node to run daily.
- Make sure to test with one post first before going live.
Would you like me to generate a downloadable .json file of this workflow for import into n8n?