RECIPE 007
Notion 작업 마감 3일 전 알림
- ▸YouTube Data API v3를 HTTP Request로 호출할 수 있다
- ▸마지막 확인 시각 이후 올라온 영상만 필터링할 수 있다
- ▸Slack 또는 이메일로 신규 영상 알림을 발송할 수 있다
✅사전 준비
- □Google Cloud Console에서 YouTube Data API v3 키 발급
- □알림 받을 채널 ID 확인 (채널 페이지 URL의 /channel/ 뒤 문자열)
- □Slack 또는 Gmail 자격증명 연결 완료
- □Google Sheets에 마지막 확인 시각 저장용 시트 준비
YouTube API — HTTP Request 설정
URL: https://www.googleapis.com/youtube/v3/search
Query Parameters:
part: snippet
channelId: UC여기에_채널ID_입력
order: date
maxResults: 5
key: YOUR_API_KEY신규 영상 필터 — IF 노드 조건식
{{ new Date($json.snippet.publishedAt) > new Date($('Google Sheets').first().json.lastChecked) }}Slack 알림 메시지
🎬 새 영상이 올라왔어요!
*{{ $json.snippet.title }}*
https://www.youtube.com/watch?v={{ $json.id.videoId }}
📅 {{ $json.snippet.publishedAt }}💡 TIPYouTube API 무료 할당량은 하루 10,000 units입니다. search 요청은 100 units이므로 하루 100번까지 호출 가능해요. 너무 자주 폴링하지 않도록 1시간 이상 간격을 권장합니다.
⚡
워크플로우 JSON
아래 JSON을 복사해 n8n에 바로 임포트하세요
📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
"name": "recipe007_notion_deadline_reminder",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"triggerAtHour": 9,
"triggerAtMinute": 0
}
]
}
},
"id": "schedule-007-01",
"name": "매일 오전 9시 트리거",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
200,
400
]
},
{
"parameters": {
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.NOTION_TASK_DB_ID }}"
},
"returnAll": true,
"filterType": "manual",
"filters": {
"conditions": [
{
"key": "마감일",
"condition": "date_on_or_before",
"dateValue": {
"type": "expression",
"expressionValue": "={{ $now.plus({days: 3}).toFormat('yyyy-MM-dd') }}"
}
},
{
"key": "상태",
"condition": "does_not_equal",
"textValue": "완료"
}
]
},
"options": {}
},
"id": "notion-007-02",
"name": "마감 3일 이내 미완료 작업 조회",
"type": "n8n-nodes-base.notion",
"typeVersion": 2.2,
"position": [
420,
400
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "cond-has-items",
"leftValue": "={{ $input.all().length }}",
"rightValue": 0,
"operator": {
"type": "number",
"operation": "gt"
}
}
],
"combinator": "and"
}
},
"id": "if-007-03",
"name": "마감 임박 작업 있는지 확인",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
640,
400
]
},
{
"parameters": {
"jsCode": "const items = $input.all();\nconst lines = items.map(item => {\n const title = item.json.properties?.이름?.title?.[0]?.plain_text\n || item.json.properties?.Name?.title?.[0]?.plain_text\n || '(제목 없음)';\n const dueRaw = item.json.properties?.마감일?.date?.start || '';\n const due = dueRaw\n ? new Date(dueRaw).toLocaleDateString('ko-KR', { month: 'long', day: 'numeric' })\n : '날짜 미정';\n return `• ${title} (마감: ${due})`;\n}).join('\\n');\nreturn [{\n json: {\n message: `⚠️ *마감 임박 작업이 있어요!*\\n\\n${lines}\\n\\n서둘러 확인해주세요! 🏃`\n }\n}];"
},
"id": "code-007-04",
"name": "알림 메시지 포맷",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
860,
280
]
},
{
"parameters": {
"resource": "message",
"operation": "post",
"channel": "#task-reminders",
"text": "={{ $json.message }}",
"otherOptions": {}
},
"id": "slack-007-05",
"name": "Slack 마감 임박 알림",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [
1080,
280
]
}
],
"connections": {
"매일 오전 9시 트리거": {
"main": [
[
{
"node": "마감 3일 이내 미완료 작업 조회",
"type": "main",
"index": 0
}
]
]
},
"마감 3일 이내 미완료 작업 조회": {
"main": [
[
{
"node": "마감 임박 작업 있는지 확인",
"type": "main",
"index": 0
}
]
]
},
"마감 임박 작업 있는지 확인": {
"main": [
[
{
"node": "알림 메시지 포맷",
"type": "main",
"index": 0
}
]
]
},
"알림 메시지 포맷": {
"main": [
[
{
"node": "Slack 마감 임박 알림",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"timezone": "Asia/Seoul"
},
"meta": {
"chapter": 1,
"recipe": "007",
"title": "Notion 작업 마감 3일 전 알림",
"difficulty": "⭐⭐",
"estimatedTime": "25분",
"apps": [
"Notion",
"Slack"
],
"workflowUrl": "www.koreaaitimes.com/books/n8n-vol2/recipe007"
}
}