This workflow follows the Gmail → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Configurable Topic Newsletter",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"id": "1",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "topic",
"value": "AI"
}
]
},
"options": {}
},
"id": "2",
"name": "Set Topic",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
500,
300
]
},
{
"parameters": {
"url": "https://newsapi.org/v2/everything",
"options": {},
"queryParametersUi": {
"parameter": [
{
"name": "q",
"value": "={{$json.topic}}"
},
{
"name": "pageSize",
"value": "15"
},
{
"name": "from",
"value": "={{$moment().subtract(7,'days').format('YYYY-MM-DD')}}"
},
{
"name": "sortBy",
"value": "publishedAt"
},
{
"name": "apiKey",
"value": "{{ $json.apiKey }}"
}
]
}
},
"id": "3",
"name": "Fetch News",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
750,
300
]
},
{
"parameters": {
"functionCode": "const topic = $json.topic;\nconst articles = items[0].json.articles || [];\n\nlet html = `<h1 style=\\\"font-family:sans-serif;color:#333;\\\">\ud83d\udcf0 ${topic} Newsletter</h1>`;\n\narticles.forEach(a => {\n html += `<h2 style=\\\"color:#0073e6;\\\">${a.title}</h2>`;\n if (a.description) {\n html += `<p style=\\\"font-size:14px;color:#555;\\\">${a.description}</p>`;\n }\n if (a.urlToImage) {\n html += `<img src=\\\"${a.urlToImage}\\\" style=\\\"max-width:500px;border-radius:8px;margin:10px 0;\\\"/><br/>`;\n }\n html += `<a href=\\\"${a.url}\\\" target=\\\"_blank\\\" style=\\\"font-size:14px;\\\">Read more</a><hr/>`;\n});\n\nreturn [{ json: { html, topic } }];"
},
"id": "4",
"name": "Format Newsletter",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1000,
300
]
},
{
"parameters": {
"functionCode": "const html = $json.html;\n\nconst buffer = Buffer.from(html, \"utf-8\");\n\nreturn [{\n binary: {\n data: {\n data: buffer.toString(\"base64\"),\n mimeType: \"application/msword\",\n fileName: \"Newsletter.doc\"\n }\n },\n json: {\n topic: $json.topic\n }\n}];"
},
"id": "5",
"name": "Convert to Word",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1250,
300
]
},
{
"parameters": {
"fromEmail": "youremail@gmail.com",
"toEmail": "subscriber@example.com",
"subject": "{{$json.topic}} Newsletter",
"attachments": [
"={{$binary.data}}"
],
"content": "Attached is your latest {{$json.topic}} newsletter."
},
"id": "6",
"name": "Send Email",
"type": "n8n-nodes-base.gmail",
"typeVersion": 1,
"position": [
1500,
300
],
"credentials": {
"gmailOAuth2": "<your credential>"
}
}
],
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Set Topic",
"type": "main",
"index": 0
}
]
]
},
"Set Topic": {
"main": [
[
{
"node": "Fetch News",
"type": "main",
"index": 0
}
]
]
},
"Fetch News": {
"main": [
[
{
"node": "Format Newsletter",
"type": "main",
"index": 0
}
]
]
},
"Format Newsletter": {
"main": [
[
{
"node": "Convert to Word",
"type": "main",
"index": 0
}
]
]
},
"Convert to Word": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Configurable Topic Newsletter. Uses httpRequest, gmail. Scheduled trigger; 6 nodes.
Source: https://gist.github.com/pablonewman8-arch/b8388cf2e73ab7dd6b7332a2d6f41a46 — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Relatórios aos Laboratórios. Uses httpRequest, gmail, formTrigger. Scheduled trigger; 54 nodes.
YOUR_ID 4. Uses gmail, googleDrive, googleSheets, httpRequest. Scheduled trigger; 53 nodes.
14310 Send Overdue Invoice Payment Reminders With Ifirma Gmail Postgrid And Slack. Uses httpRequest, stopAndError, slack, gmail. Scheduled trigger; 53 nodes.
Addendo — Blog Automatico Don Jacinto Nahual. Uses httpRequest, redis, github, gmail. Scheduled trigger; 51 nodes.
Addendo — Blog Automatico Don Jacinto Nahual. Uses httpRequest, redis, github, gmail. Scheduled trigger; 51 nodes.