8
n8n 한국어amn8n.com

JavaScript 마스터 클래스 2

중급

이것은Engineering분야의자동화 워크플로우로, 9개의 노드를 포함합니다.주로 Code, ManualTrigger 등의 노드를 사용하며. JavaScript 배열 메서드 사용하여 데이터 레코드 중복 제거

사전 요구사항
  • 특별한 사전 요구사항 없이 가져와 바로 사용 가능합니다

사용된 노드 (9)

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "hQXDUS1zEZFI37kU",
  "meta": {
    "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc"
  },
  "name": "Javascript Masterclass2",
  "tags": [],
  "nodes": [
    {
      "id": "81dd117a-81f3-4dff-a7c7-664bc161987e",
      "name": "'Test workflow' 클릭 시",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -420,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6f507b8c-8a8d-4c89-acdf-f0f4eda9fa94",
      "name": "메모지",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -260
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 580,
        "content": "# 🧱 Data Deduplication Tutorial\n\n**Author:** David Olusola\n\n## 🚀 n8n Coaching\nUnlock the full potential of n8n with personalized, one-on-one coaching. Whether you're just getting started or need help solving a specific challenge, I'll guide you step-by-step so you can build confidently and efficiently.\n\n👉 [Book Coaching Session](mailto:david@daexai.com?subject=n8n%20Coaching%20Request)\n\n## 🔧 n8n Consulting\nHave a complex automation project, unique integration needs, or want a custom workflow built from scratch? Let's collaborate to design and implement a robust solution tailored to your business.\n\n📩 [Inquire About Consulting Services](mailto:david@daexai.com?subject=n8n%20Consultation%20Request)"
      },
      "typeVersion": 1
    },
    {
      "id": "eadab384-f0d6-48b1-b4dd-e0eb106228ac",
      "name": "메모지1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        220
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 360,
        "content": "## 📊 Sample Data\n\nThis node creates sample user data with intentional duplicates based on email addresses.\n\n**What it does:**\n- Creates an array of users\n- Includes duplicate entries (same email)\n- Simulates real-world messy data\n\n**Next Step:** Pass this data to the deduplication code node"
      },
      "typeVersion": 1
    },
    {
      "id": "745ba692-ffa8-4ac6-851f-fb9dde8392f2",
      "name": "메모지2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        220
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 380,
        "content": "## 🧹 Deduplication Logic\n\n**Key Concepts:**\n- `filter()` - Creates new array with filtered elements\n- `findIndex()` - Returns index of first matching element\n- `index === self.findIndex()` - Keeps only first occurrence\n\n**Algorithm:**\n1. Parse JSON data\n2. Filter array keeping first occurrence of each email\n3. Transform back to n8n format\n4. Return deduplicated results"
      },
      "typeVersion": 1
    },
    {
      "id": "8bc4bd06-b031-4909-8210-5ec1f11366ff",
      "name": "메모지3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        220
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 380,
        "content": "## 📈 Results\n\n**What you'll see:**\n- Original count: 6 items\n- Deduplicated count: 4 items\n- Duplicates removed: 2 items\n\n**Use Cases:**\n- Clean data before CRM import\n- Prevent duplicate database entries\n- Data quality improvement\n- ETL pipeline cleanup"
      },
      "typeVersion": 1
    },
    {
      "id": "75a624be-73e9-4b35-ae58-33bc45a0208c",
      "name": "샘플 데이터 생성",
      "type": "n8n-nodes-base.code",
      "position": [
        -200,
        80
      ],
      "parameters": {
        "jsCode": "// Create sample data with intentional duplicates\nconst usersWithDuplicates = [\n  { id: 1, name: \"John Doe\", email: \"john@example.com\", department: \"Engineering\" },\n  { id: 2, name: \"Jane Smith\", email: \"jane@example.com\", department: \"Marketing\" },\n  { id: 3, name: \"John Doe\", email: \"john@example.com\", department: \"Engineering\" }, // Duplicate\n  { id: 4, name: \"Bob Johnson\", email: \"bob@example.com\", department: \"Sales\" },\n  { id: 5, name: \"Alice Brown\", email: \"alice@example.com\", department: \"HR\" },\n  { id: 6, name: \"Jane Smith Updated\", email: \"jane@example.com\", department: \"Marketing\" } // Duplicate\n];\n\n// Return the sample data as a single item with usersJson property\nreturn [{\n  json: {\n    usersJson: JSON.stringify(usersWithDuplicates),\n    totalCount: usersWithDuplicates.length,\n    message: \"Sample data with duplicates created\"\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "909634f2-52ad-4f98-aad0-7c3d8a8b8e43",
      "name": "사용자 중복 제거",
      "type": "n8n-nodes-base.code",
      "position": [
        140,
        80
      ],
      "parameters": {
        "jsCode": "// 🧱 Data Deduplication Code Node\n// Use Case: Clean up duplicates before inserting into DB or CRM\n\n// Parse the users JSON from the previous node\nconst users = JSON.parse(items[0].json.usersJson);\n\n// Deduplicate users based on email address\n// This keeps the first occurrence of each unique email\nconst uniqueUsers = users.filter(\n  (user, index, self) => \n    index === self.findIndex(u => u.email === user.email)\n);\n\n// Log the deduplication results\nconsole.log(`Original count: ${users.length}`);\nconsole.log(`Deduplicated count: ${uniqueUsers.length}`);\nconsole.log(`Duplicates removed: ${users.length - uniqueUsers.length}`);\n\n// Return the deduplicated users in n8n format\n// Each user becomes a separate item in the workflow\nreturn uniqueUsers.map(user => ({ json: user }));"
      },
      "typeVersion": 2
    },
    {
      "id": "59855549-51e4-42df-b586-730ff1e59e67",
      "name": "결과 표시",
      "type": "n8n-nodes-base.code",
      "position": [
        500,
        80
      ],
      "parameters": {
        "jsCode": "// Display the final results with statistics\nconst currentItems = items;\nconst uniqueCount = currentItems.length;\n\n// Create a summary of the deduplication process\nconst summary = {\n  deduplicated_users: currentItems.map(item => item.json),\n  statistics: {\n    unique_users_count: uniqueCount,\n    process_completed: true,\n    timestamp: new Date().toISOString()\n  },\n  message: `Successfully deduplicated data - ${uniqueCount} unique users remaining`\n};\n\nreturn [{ json: summary }];"
      },
      "typeVersion": 2
    },
    {
      "id": "2a5c40fc-ff56-4e54-b06e-4c56e2c4da0e",
      "name": "메모지4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 430,
        "height": 330,
        "content": "## 🎯 Learning Objectives\n\n**After this tutorial you'll understand:**\n\n✅ How to use JavaScript array methods in n8n\n✅ Data deduplication techniques\n✅ Working with JSON data in Code nodes\n✅ Transforming data between n8n items\n✅ Practical use cases for data cleaning\n\n**Best Practices:**\n- Always validate input data\n- Consider performance for large datasets\n- Test with various duplicate scenarios\n- Add error handling for production use"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "03170dda-ff22-468b-be1c-e32424a27c66",
  "connections": {
    "909634f2-52ad-4f98-aad0-7c3d8a8b8e43": {
      "main": [
        [
          {
            "node": "59855549-51e4-42df-b586-730ff1e59e67",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "75a624be-73e9-4b35-ae58-33bc45a0208c": {
      "main": [
        [
          {
            "node": "909634f2-52ad-4f98-aad0-7c3d8a8b8e43",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "81dd117a-81f3-4dff-a7c7-664bc161987e": {
      "main": [
        [
          {
            "node": "75a624be-73e9-4b35-ae58-33bc45a0208c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 엔지니어링

유료인가요?

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

워크플로우 정보
난이도
중급
노드 수9
카테고리1
노드 유형3
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
David Olusola

David Olusola

@dae221

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - david@daexai.com

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34