RECIPE 005
RSS 뉴스 자동 수집 → 아침 브리핑
- ▸HTTP Request 노드로 공개 금융 API를 호출할 수 있다
- ▸여러 API 결과를 Merge 노드로 합칠 수 있다
- ▸Gmail로 HTML 형식의 일간 리포트를 발송할 수 있다
✅사전 준비
- □ExchangeRate-API 또는 환율 API 키 발급 (무료 플랜 가능)
- □Gmail 자격증명 연결 완료
- □Schedule Trigger 설정 (평일 오전 8시 권장)
환율 API — HTTP Request 설정
URL: https://v6.exchangerate-api.com/v6/YOUR_API_KEY/latest/USD
Method: GET
→ 무료 API 키 발급: https://www.exchangerate-api.com
→ YOUR_API_KEY 자리에 발급받은 키 입력주요 환율 추출 — Code 노드
const rates = $input.first().json.conversion_rates;
return [{
json: {
USD_KRW: rates.KRW.toFixed(0),
USD_JPY: rates.JPY.toFixed(2),
USD_EUR: rates.EUR.toFixed(4),
date: new Date().toLocaleDateString("ko-KR"),
}
}];Gmail 본문 — HTML 리포트 템플릿
<h2>📊 오늘의 환율 브리핑 ({{ $json.date }})</h2>
<table border="1" cellpadding="8" style="border-collapse:collapse">
<tr><th>통화쌍</th><th>환율</th></tr>
<tr><td>USD → KRW</td><td><b>{{ $json.USD_KRW }}원</b></td></tr>
<tr><td>USD → JPY</td><td>{{ $json.USD_JPY }}</td></tr>
<tr><td>USD → EUR</td><td>{{ $json.USD_EUR }}</td></tr>
</table>
<p style="color:gray;font-size:12px">이 메일은 n8n 자동화로 발송되었습니다.</p>💡 TIP한국투자증권, 네이버 금융 등 국내 주가 API는 인증이 필요합니다. 무료로 테스트하려면 Yahoo Finance API(비공식)나 Alpha Vantage 무료 플랜을 활용하세요.
⚡
워크플로우 JSON
아래 JSON을 복사해 n8n에 바로 임포트하세요
📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
"name": "recipe005_rss_news_morning_briefing",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"triggerAtHour": 7,
"triggerAtMinute": 0
}
]
}
},
"id": "schedule-005-01",
"name": "매일 오전 7시 트리거",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
200,
400
]
},
{
"parameters": {
"url": "={{ $env.NEWS_RSS_URL }}"
},
"id": "rss-005-02",
"name": "RSS 뉴스 수집",
"type": "n8n-nodes-base.rssFeedRead",
"typeVersion": 1.1,
"position": [
420,
400
]
},
{
"parameters": {
"maxItems": 5
},
"id": "limit-005-03",
"name": "최신 5개 기사만 제한",
"type": "n8n-nodes-base.limit",
"typeVersion": 1,
"position": [
640,
400
]
},
{
"parameters": {
"jsCode": "const items = $input.all();\nconst today = $now.setLocale('ko').toFormat('yyyy년 M월 d일 cccc');\nconst newsLines = items.map((item, idx) => {\n const title = item.json.title || '(제목 없음)';\n const link = item.json.link || '';\n return `${idx + 1}. <${link}|${title}>`;\n}).join('\\n');\nreturn [{\n json: {\n subject: `[아침 브리핑] ${today} 주요 뉴스`,\n body: `안녕하세요! 오늘의 주요 뉴스를 보내드려요.\\n\\n${newsLines}\\n\\n좋은 하루 되세요! 🌅`,\n slackMessage: `📰 *${today} 아침 뉴스 브리핑*\\n\\n${newsLines}`\n }\n}];"
},
"id": "code-005-04",
"name": "브리핑 메시지 포맷",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
860,
400
]
},
{
"parameters": {
"resource": "message",
"operation": "send",
"toEmail": "={{ $env.MY_EMAIL }}",
"subject": "={{ $json.subject }}",
"message": "={{ $json.body }}",
"options": {}
},
"id": "gmail-005-05",
"name": "Gmail 아침 브리핑 발송",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
1080,
400
]
}
],
"connections": {
"매일 오전 7시 트리거": {
"main": [
[
{
"node": "RSS 뉴스 수집",
"type": "main",
"index": 0
}
]
]
},
"RSS 뉴스 수집": {
"main": [
[
{
"node": "최신 5개 기사만 제한",
"type": "main",
"index": 0
}
]
]
},
"최신 5개 기사만 제한": {
"main": [
[
{
"node": "브리핑 메시지 포맷",
"type": "main",
"index": 0
}
]
]
},
"브리핑 메시지 포맷": {
"main": [
[
{
"node": "Gmail 아침 브리핑 발송",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"timezone": "Asia/Seoul"
},
"meta": {
"chapter": 1,
"recipe": "005",
"title": "RSS 뉴스 자동 수집 → 아침 브리핑",
"difficulty": "⭐",
"estimatedTime": "20분",
"apps": [
"RSS Feed",
"Gmail"
],
"workflowUrl": "www.koreaaitimes.com/books/n8n-vol2/recipe005"
}
}