8
n8n 한국어amn8n.com

Apify와 Google Sheets를 사용하여 태그에서 인증된 Instagram 잠재 고객 생성

고급

이것은Lead Generation, Multimodal AI분야의자동화 워크플로우로, 16개의 노드를 포함합니다.주로 If, Code, Aggregate, HttpRequest, GoogleSheets 등의 노드를 사용하며. Apify와 Google Sheets를 사용하여 태그에서 인스타그램 잠재 고객 생성

사전 요구사항
  • 대상 API의 인증 정보가 필요할 수 있음
  • Google Sheets API 인증 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "3f9200fd36bb1bacb074812d319dd4fba325b9cd32ee87ee82b76f45271f5dfd"
  },
  "nodes": [
    {
      "id": "77e9fdfd-ee83-4394-a938-ceb6be4a58a8",
      "name": "'워크플로 실행' 클릭 시",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1840,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "04569eb9-91d9-4eda-a3b7-f1044b3aacf2",
      "name": "make 해시태그 링크",
      "type": "n8n-nodes-base.code",
      "position": [
        -1216,
        -32
      ],
      "parameters": {
        "jsCode": "// Mode: Run once for all items\nconst tags = $input.first().json.Hashtag || [];           // [\"vegan\", \"travel\", …]\n\nconst startUrls = tags.map(\n  t => `\"https://www.instagram.com/explore/tags/${encodeURIComponent(t)}/\"`\n);\n\n// Build the final body Apify expects\nreturn [{   // or delete if you don’t need the date filter\n  startUrls                 // ← trailing slash now added\n  // customMapFunction left out — see note below\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "45305b08-fd9f-4872-b4e3-e37d38b866d0",
      "name": "instagram 해시태그 게시물 스크레이핑",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -976,
        -32
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/culc72xb7MP3EbaeX/run-sync-get-dataset-items",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n    \"maxItems\": 300,\n    \"startUrls\": [\n{{ $json.startUrls }}\n    ],\n    \"until\": \"2025-06-20\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "Bearer APIFY_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "067ed683-3a63-4d59-8c23-2bb87d8d3287",
      "name": "IF — 해시태그만",
      "type": "n8n-nodes-base.if",
      "position": [
        -560,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cond-only-hashtags",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.hasHashtags && ($json.textNoTags || '').trim() === '' }}"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "43e985f4-579d-49ed-839c-7b5809d8ddd8",
      "name": "IF — 영어만",
      "type": "n8n-nodes-base.if",
      "position": [
        -352,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cond-english-only",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.enHits > 0 && $json.frHits === 0 && $json.esHits === 0 }}"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2b17b052-1474-40a3-8c86-6eb450969b2b",
      "name": "해시태그 통합",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1424,
        -32
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "Hashtag"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9640b845-8f56-4dea-bcdc-f315e30b1224",
      "name": "캡션, 사용자 이름 및 데이터 서식 지정",
      "type": "n8n-nodes-base.code",
      "position": [
        -768,
        -32
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const json = item.json;\n  // 1) Original caption or title\n  const caption = json.caption || json.title || '';\n  json.caption = caption;\n  // 2) Count hashtags & strip them + strip URLs\n  const hashtags = caption.match(/#\\S+/g) || [];\n  json.hashtagCount = hashtags.length;\n  json.hasHashtags = json.hashtagCount > 0;\n  const noUrls = caption.replace(/https?:\\/\\/\\S+/gi, '');\n  const textNoTags = noUrls.replace(/#[^\\s#]+/g, '').replace(/\\.{2,}/g, ' ').replace(/\\s+/g, ' ').trim();\n  json.textNoTags = textNoTags;\n  json.hasOnlyHashtags = json.hasHashtags && textNoTags === '';\n  // 3) Word array (no numbers-only, min length 2)\n  let words = textNoTags.toLowerCase().split(/\\W+/).filter(w => w.length > 1 && !/^\\d+$/.test(w));\n  const totalWords = words.length;\n  json.totalWords = totalWords;\n  // 4) Keyword hit lists\n  const enKw = ['the','and','to','of','in','for','on','with','is','are','this','that','it','be','at','by','from','as','was','were','have','has','you','we','i'];\n  const frKw = ['le','la','les','des','un','une','du','de','et','en','dans','pour','avec','est','sur','au','aux','ce','cet','cette','ça','pas','plus','que','qui','où','je','tu','il','elle','nous','vous','ils','elles'];\n  const esKw = ['el','la','los','las','de','del','y','en','por','para','con','es','un','una','que','como','muy','pero','si','porque'];\n  json.enHits = words.filter(w => enKw.includes(w)).length;\n  json.frHits = words.filter(w => frKw.includes(w)).length;\n  json.esHits = words.filter(w => esKw.includes(w)).length;\n  // 5) Ratios\n  json.enRatio = totalWords ? json.enHits / totalWords : 0;\n  json.frRatio = totalWords ? json.frHits / totalWords : 0;\n  json.esRatio = totalWords ? json.esHits / totalWords : 0;\n  // 6) ASCII vs non-ASCII\n  const asciiCount = textNoTags.replace(/[^\\x00-\\x7F]/g, '').length;\n  json.asciiRatio = textNoTags.length ? asciiCount / textNoTags.length : 0;\n  // 7) Accent & script flags\n  json.hasFrenchAccent = /[éèêëàâîïôöùûçœæ]/i.test(textNoTags);\n  json.hasSpanishAccentStrict = /[ñ¡¿]/.test(textNoTags);\n  json.hasArabicOrCJK = /[\\u0600-\\u06FF\\u0750-\\u077F\\u4E00-\\u9FFF\\u3040-\\u30FF\\uAC00-\\uD7AF]/u.test(textNoTags);\n  return { json };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "6626209f-fc93-4688-a41c-51606d03c887",
      "name": "모든 사용자 이름 결합",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        112,
        -64
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "owner.username"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1d876779-5409-4214-b6b0-48276e44ab41",
      "name": "중복 사용자 이름 제거",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -112,
        -64
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "owner.username"
      },
      "typeVersion": 2
    },
    {
      "id": "12f7a1bd-4ce4-47c0-ae1d-2444ecd7ac6d",
      "name": "instagram 프로필 스크레이핑",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -64
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/dSCLg0C3YEZ83HzYX/run-sync-get-dataset-items",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n    \"usernames\": [\n        \t{{ $json.username.map(u => `\"${u}\"`).join(\", \") }}\n    ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "Bearer APIFY_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3288d091-4f14-4c7b-8813-7a4a2b64db66",
      "name": "팔로워 수가 특정 범위 내일 경우 계속",
      "type": "n8n-nodes-base.if",
      "position": [
        592,
        -64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7b585f6a-c548-4b62-a6e8-0bcf6c7ba771",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.followersCount }}",
              "rightValue": 10000
            },
            {
              "id": "4753a598-fe31-4670-99f2-a0d5ad164074",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.followersCount }}",
              "rightValue": 100000
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "79d0609c-f68b-41fa-96ec-cc0676fdd706",
      "name": "해시태그 목록 가져오기",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1632,
        -32
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "SHEET_ID"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "SPREADSHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "MBFwnmyEV4r4PVbR",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "08bc2863-b41f-4e1d-99db-30e03b1b1c01",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -736
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 240,
        "content": "# Workflow Overview\n- Start: Get a list of hashtags from Google Sheets\n- Scrape Instagram posts for each hashtag (via Apify)\n- Analyze captions: extract keywords, check for language & hashtags\n- Gather/post-process usernames, scrape their profiles\n- Filter users based on followers count\n- Result: List of users meeting your criteria"
      },
      "typeVersion": 1
    },
    {
      "id": "1066082c-43db-4e5b-b9be-4beb44d9061a",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 144,
        "content": "## Read Hashtags & Prepare Instagram Links\n- Retrieve all hashtags from a Google Sheet\n- Build direct Instagram tag-explore URLs for each hashtag\n- Output is a list of start URLs for scraping Instagram hashtag feeds"
      },
      "typeVersion": 1
    },
    {
      "id": "f5527a08-5916-4234-9225-835262206952",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -288
      ],
      "parameters": {
        "color": 2,
        "width": 560,
        "height": 176,
        "content": "## Analyze Post Captions\n- Extract and process each Instagram caption\n- Count & strip hashtags, links, and analyze language (English/French/Spanish) using keyword lists\n- Mark posts as 'hashtags only', and apply logic to filter for language or other text patterns"
      },
      "typeVersion": 1
    },
    {
      "id": "4e0a1454-b1c2-4af2-b3f0-d3328d3956c4",
      "name": "스티키 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -288
      ],
      "parameters": {
        "color": 3,
        "width": 592,
        "content": "# Gather & Filter User Profiles\n- Combine all usernames from found posts, remove duplicates\n- Scrape profile details (like follower count) for each username\n- Only allow users whose follower counts are within a target range for your use case"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "2b17b052-1474-40a3-8c86-6eb450969b2b": {
      "main": [
        [
          {
            "node": "04569eb9-91d9-4eda-a3b7-f1044b3aacf2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "04569eb9-91d9-4eda-a3b7-f1044b3aacf2": {
      "main": [
        [
          {
            "node": "45305b08-fd9f-4872-b4e3-e37d38b866d0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "43e985f4-579d-49ed-839c-7b5809d8ddd8": {
      "main": [
        [
          {
            "node": "1d876779-5409-4214-b6b0-48276e44ab41",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "79d0609c-f68b-41fa-96ec-cc0676fdd706": {
      "main": [
        [
          {
            "node": "2b17b052-1474-40a3-8c86-6eb450969b2b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "067ed683-3a63-4d59-8c23-2bb87d8d3287": {
      "main": [
        [
          {
            "node": "1d876779-5409-4214-b6b0-48276e44ab41",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "43e985f4-579d-49ed-839c-7b5809d8ddd8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6626209f-fc93-4688-a41c-51606d03c887": {
      "main": [
        [
          {
            "node": "12f7a1bd-4ce4-47c0-ae1d-2444ecd7ac6d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "12f7a1bd-4ce4-47c0-ae1d-2444ecd7ac6d": {
      "main": [
        [
          {
            "node": "3288d091-4f14-4c7b-8813-7a4a2b64db66",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1d876779-5409-4214-b6b0-48276e44ab41": {
      "main": [
        [
          {
            "node": "6626209f-fc93-4688-a41c-51606d03c887",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "45305b08-fd9f-4872-b4e3-e37d38b866d0": {
      "main": [
        [
          {
            "node": "9640b845-8f56-4dea-bcdc-f315e30b1224",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9640b845-8f56-4dea-bcdc-f315e30b1224": {
      "main": [
        [
          {
            "node": "067ed683-3a63-4d59-8c23-2bb87d8d3287",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "77e9fdfd-ee83-4394-a938-ceb6be4a58a8": {
      "main": [
        [
          {
            "node": "79d0609c-f68b-41fa-96ec-cc0676fdd706",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

고급 - 리드 생성, 멀티모달 AI

유료인가요?

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

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

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

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34