8
n8n 한국어amn8n.com

매일 생일 축하 (코드 노드 최종 버전)

고급

이것은Personal Productivity, Multimodal AI분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 If, Code, Gmail, Slack, HttpRequest 등의 노드를 사용하며. 基于NASA图片、GPT-4、Gmail및Slack의자동화太空主题生日이메일

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • Slack Bot Token 또는 Webhook URL
  • 대상 API의 인증 정보가 필요할 수 있음
  • Google Sheets API 인증 정보
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "0czfWskRwpjMRqaZ",
  "meta": {
    "instanceId": "66e13aec947801e3f08d27a590fb0e07109805e23a7eabde7c0647150db10195",
    "templateCredsSetupCompleted": true
  },
  "name": "Daily Birthday Celebration (Code Node Final Version)",
  "tags": [],
  "nodes": [
    {
      "id": "adaf007f-0c2d-4dc2-a8f9-55b00f7f3d53",
      "name": "매일 아침 7:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        256,
        -208
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 7 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "721377a2-196c-4d2e-8c33-33ffa5f9c765",
      "name": "생일 명단 가져오기",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        480,
        -208
      ],
      "parameters": {
        "sheetName": "",
        "documentId": ""
      },
      "typeVersion": 4.7
    },
    {
      "id": "18bd2530-8a96-4b66-8792-2f6ab0449e17",
      "name": "오늘의 생일 필터링",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        -208
      ],
      "parameters": {
        "jsCode": "const today = new Date();\nconst todayMonth = today.getMonth() + 1; // 1-12\nconst todayDay = today.getDate();\n\nconst birthdaysToday = [];\n\nfor (const item of $input.all()) {\n  const birthdayStr = item.json.birthday || item.json.Birthday;\n  if (!birthdayStr) continue;\n  \n  const birthday = new Date(birthdayStr);\n  const birthMonth = birthday.getMonth() + 1;\n  const birthDay = birthday.getDate();\n  \n  if (birthMonth === todayMonth && birthDay === todayDay) {\n    birthdaysToday.push(item.json);\n  }\n}\n\nif (birthdaysToday.length > 0) {\n  // Pass along the list of people with birthdays today\n  return [{ json: { birthdays: birthdaysToday } }];\n}\n\n// If no birthdays, return empty to stop the workflow here\nreturn [];"
      },
      "typeVersion": 2
    },
    {
      "id": "66f0cde9-e2c6-4a02-81bc-c5c8cea8048b",
      "name": "오늘 생일 있음?",
      "type": "n8n-nodes-base.if",
      "position": [
        928,
        -208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1fd71fc8-79c7-432f-88b4-a1418f6bed90",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $input.all().length }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "707d5452-5d02-4372-aaa1-e4ffc609a9b9",
      "name": "생일 데이터 준비",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        -304
      ],
      "parameters": {
        "jsCode": "const epicImages = $('Fetch NASA EPIC Images2').all().map(item => item.json);\nconst allBirthdays = $('Filter Today\\'s Birthdays').first().json.birthdays;\n\n// We only need one image, let's take the first one returned by the API\nconst latestImage = epicImages[0];\n\nconst results = [];\n\n// Construct the full image URL from the EPIC data parts\nconst d = new Date(latestImage.date);\nconst year = d.getFullYear();\nconst month = ('0' + (d.getMonth() + 1)).slice(-2);\nconst day = ('0' + d.getDate()).slice(-2);\nconst imageName = latestImage.image;\nconst imageUrl = `https://epic.gsfc.nasa.gov/archive/natural/${year}/${month}/${day}/png/${imageName}.png`;\n\n// Combine the image data with each birthday person's data\nfor (const person of allBirthdays) {\n  results.push({\n    json: {\n      ...person, // This includes name, email, birthday\n      epicCaption: latestImage.caption,\n      epicDate: latestImage.date,\n      epicImageUrl: imageUrl\n    }\n  });\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "ec074153-a990-4f9a-891a-6e0e3d3096f9",
      "name": "우주 생일 메시지 생성",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        -304
      ],
      "parameters": {
        "text": "=Person's name: {{ $json.name || $json.Name }}\nToday's Earth photo caption: {{ $json.epicCaption }}",
        "options": {
          "systemMessage": "You are a creative birthday message writer specializing in space-themed greetings.\n\nYour task is to:\n1. Generate a fun, space-themed birthday message for the person, mentioning our home planet Earth.\n2. Incorporate the NASA EPIC photo's caption into the message.\n3. Keep the message to approximately 120 characters.\n4. Make it celebratory and cosmic!\n5. Return ONLY the birthday message text, nothing else."
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "3cf8af5f-0019-46d2-8d7b-310a31b6fcaf",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1680,
        -80
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "0550ac86-0258-4819-a2e5-a0cf737003bd",
      "name": "생일 수 계산",
      "type": "n8n-nodes-base.code",
      "position": [
        1152,
        -112
      ],
      "parameters": {
        "jsCode": "const birthdays = $input.item.json.birthdays || [];\nconst count = birthdays.length;\nreturn [{ json: { birthdayCount: count } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "0a531f86-adb7-4518-8aee-3e6e9d72e907",
      "name": "Slack 알림 게시",
      "type": "n8n-nodes-base.slack",
      "position": [
        1376,
        -112
      ],
      "webhookId": "16e4d5a6-43dd-4694-9509-50f05c4db2f3",
      "parameters": {
        "text": "=🎂 Birthdays today: {{ $json.birthdayCount }}",
        "select": "channel",
        "channelId": "",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    },
    {
      "id": "2fd5a4d7-0181-42e1-936c-b59046c714df",
      "name": "NASA EPIC 이미지 가져오기2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        -304
      ],
      "parameters": {
        "url": "https://epic.gsfc.nasa.gov/api/natural",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "2496302d-6108-43cb-b6b6-2eedbad73af5",
      "name": "생일 이메일 전송",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2400,
        -304
      ],
      "webhookId": "58c2dcc8-58f5-4dd6-a291-066ff0f05a72",
      "parameters": {
        "sendTo": "=={{ $json.Email }}",
        "message": "=<h2>Happy Birthday {{ $json.name || $json.Name }}! 🎂🌏</h2>\n\n<p>{{ $json.birthdayMessage }}</p>\n\n<h3>A View of Our Home Planet For You:</h3>\n<p><strong>{{ $json.epicCaption }}</strong></p>\n<img src=\"{{ $json.epicImageUrl }}\" alt=\"NASA EPIC Earth Photo\" style=\"max-width: 600px; height: auto;\" />\n\n<p>This photo of Earth was taken on {{ new Date($json.epicDate).toLocaleDateString() }}.</p>\n\n<p>Wishing you a wonderful year ahead! 🌟</p>",
        "options": {},
        "subject": "=🎂🌏 Happy Birthday {{ $json.Name }} !"
      },
      "typeVersion": 2.1
    },
    {
      "id": "b541cac2-92d9-45ca-b75c-b2a783c2a380",
      "name": "Gmail 형식 지정",
      "type": "n8n-nodes-base.code",
      "position": [
        2032,
        -304
      ],
      "parameters": {
        "jsCode": "// --- ここから下をすべてコピーする ---\n\n// 個人情報が入った荷物を、すべて持ってくる\nconst personalInfoItems = $('Prepare Birthday Data').all();\n\n// AI賢者からのメッセージが入った荷物を、すべて持ってくる\nconst birthdayMessageItems = $('Generate Space Birthday Message').all();\n\n// 荷物の数が合っているか、念のために確認する\nif (personalInfoItems.length !== birthdayMessageItems.length) {\n  throw new Error(`荷物の数が合いません!個人情報は${personalInfoItems.length}件、AIメッセージは${birthdayMessageItems.length}件です。これではペアを作れません!`);\n}\n\n// 完成したプレゼントを入れるための、空の箱を用意する\nconst finalPackages = [];\n\n// forループという魔法の呪文で、荷物を先頭から一つずつ処理していく\nfor (let i = 0; i < personalInfoItems.length; i++) {\n  const personalInfo = personalInfoItems[i].json;\n  const birthdayMessage = birthdayMessageItems[i].json.output;\n\n  // 2つの情報を合体させて、一つのきれいな包みにする\n  finalPackages.push({\n    json: {\n      ...personalInfo,\n      birthdayMessage: birthdayMessage,\n    }\n  });\n}\n\n// 完成したプレゼントを、すべて次の工程へ渡す\nreturn finalPackages;\n\n// --- ここまでをすべてコピーする ---"
      },
      "typeVersion": 2
    },
    {
      "id": "a4b3d302-e082-4fcd-9caf-f241422a913c",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        -544
      ],
      "parameters": {
        "color": "#FFFFFF",
        "width": 300,
        "height": 208,
        "content": "## 4. Configure Email Sender\n- **Credentials:** Select your Gmail credentials.\n\nThe email content is pre-filled with data from the previous steps."
      },
      "typeVersion": 1
    },
    {
      "id": "03d1abb0-c969-40d1-8f6e-af82984f37f9",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -736
      ],
      "parameters": {
        "height": 1296,
        "content": "## Send daily space-themed birthday greetings via Gmail and Slack\nThis workflow automates daily birthday celebrations with a unique, cosmic twist! It checks a Google Sheet for birthdays each morning, fetches a stunning new image of Earth from NASA, uses AI to write a personalized space-themed message, and sends it as a celebratory email. It also posts a summary notification in Slack.\n\n### Who it's for\nPerfect for teams, communities, or anyone who wants a fun, automated way to remember and celebrate birthdays. If you love space and want to make someone's special day a little more cosmic, this is for you.\n\n### What it does\n1.  **Triggers Daily:** The workflow runs every morning at 7:00 AM.\n2.  **Reads Birthdays:** It fetches a list of names and birthdays from a specified Google Sheet.\n3.  **Checks for Today's Birthdays:** It filters the list to see if anyone has a birthday today.\n4.  **Gets NASA Image:** If there's a birthday, it fetches the latest \"Earth Polychromatic Imaging Camera\" (EPIC) image from NASA's API.\n5.  **Generates AI Message:** It uses an AI model to craft a unique, space-themed birthday message.\n6.  **Sends Email:** It sends a personalized HTML email to the birthday person, featuring the message and the NASA Earth photo.\n7.  **Notifies Slack:** It posts a message in a designated Slack channel to let the team know who is celebrating their birthday.\n\n### How to set up\nFollow the instructions in the sticky notes below to configure the workflow nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "8710f379-ac18-43e2-8115-696d22e6a832",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -576
      ],
      "parameters": {
        "height": 336,
        "content": "## 1. Configure Birthday Roster\n- **Credentials:** Select your Google Sheets credentials.\n- **Document ID:** Enter the ID of the Google Sheet containing birthdays.\n- **Sheet Name:** Enter the name of the specific sheet.\n\n**IMPORTANT:** Your sheet must have columns named `Name`, `Email`, and `Birthday`."
      },
      "typeVersion": 1
    },
    {
      "id": "675f8a58-0e45-47d0-bcf3-764ec00ca94b",
      "name": "스티키 노트4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        -576
      ],
      "parameters": {
        "height": 224,
        "content": "## 2. Configure OpenAI Model\n- **Credentials:** Select your OpenAI credentials.\n- **Model:** Choose the AI model you wish to use for generating messages."
      },
      "typeVersion": 1
    },
    {
      "id": "31428758-c1cd-4cff-8bb7-cd6dbdc861d8",
      "name": "스티키 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        48
      ],
      "parameters": {
        "height": 240,
        "content": "## 3. Configure Slack Notification\n- **Credentials:** Select your Slack credentials.\n- **Channel ID:** Choose the Slack channel where you want to post birthday notifications."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Generate Space Birthday Message": [
      {
        "json": {
          "output": "Happy Birthday, 星野 光! Celebrate your day from Earth, seen by NASA's EPIC—our cosmic home in the vast universe! 🎉🌍✨"
        }
      },
      {
        "json": {
          "output": "Happy Birthday 弟子 二号! From Earth to the stars, NASA's EPIC sees your cosmic shine bright today! 🚀🌍🎉"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "75159693-40d3-49a5-986e-f6878b2a5b5d",
  "connections": {
    "0550ac86-0258-4819-a2e5-a0cf737003bd": {
      "main": [
        [
          {
            "node": "0a531f86-adb7-4518-8aee-3e6e9d72e907",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b541cac2-92d9-45ca-b75c-b2a783c2a380": {
      "main": [
        [
          {
            "node": "2496302d-6108-43cb-b6b6-2eedbad73af5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3cf8af5f-0019-46d2-8d7b-310a31b6fcaf": {
      "ai_languageModel": [
        [
          {
            "node": "ec074153-a990-4f9a-891a-6e0e3d3096f9",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "721377a2-196c-4d2e-8c33-33ffa5f9c765": {
      "main": [
        [
          {
            "node": "18bd2530-8a96-4b66-8792-2f6ab0449e17",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "66f0cde9-e2c6-4a02-81bc-c5c8cea8048b": {
      "main": [
        [
          {
            "node": "2fd5a4d7-0181-42e1-936c-b59046c714df",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "0550ac86-0258-4819-a2e5-a0cf737003bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "adaf007f-0c2d-4dc2-a8f9-55b00f7f3d53": {
      "main": [
        [
          {
            "node": "721377a2-196c-4d2e-8c33-33ffa5f9c765",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "707d5452-5d02-4372-aaa1-e4ffc609a9b9": {
      "main": [
        [
          {
            "node": "ec074153-a990-4f9a-891a-6e0e3d3096f9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2fd5a4d7-0181-42e1-936c-b59046c714df": {
      "main": [
        [
          {
            "node": "707d5452-5d02-4372-aaa1-e4ffc609a9b9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "18bd2530-8a96-4b66-8792-2f6ab0449e17": {
      "main": [
        [
          {
            "node": "66f0cde9-e2c6-4a02-81bc-c5c8cea8048b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ec074153-a990-4f9a-891a-6e0e3d3096f9": {
      "main": [
        [
          {
            "node": "b541cac2-92d9-45ca-b75c-b2a783c2a380",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 개인 생산성, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수17
카테고리2
노드 유형10
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34