{
  "id": "-ZyH-Ix3zeoCY2J6t0D2x",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Find new creators and lookalikes using influencers.club and add them to Hubspot",
  "tags": [],
  "nodes": [
    {
      "id": "043f63d8-3cae-45db-9692-5a1118bc355a",
      "name": "Pipeline Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        816
      ],
      "parameters": {
        "color": 4,
        "width": 540,
        "height": 556,
        "content": "## \ud83d\ude80 Creator Discovery \u2014 Dual Branch Pipeline\n\nThis workflow automatically discovers, enriches, analyzes, and syncs Instagram creators into HubSpot using two complementary discovery strategies.\n\n**Branch A \u2014 Discovery:** Calls the Discovery API with your filters, splits results, enriches each profile via the Enrichment API, normalizes the data into a clean structure, then runs AI analysis on each creator.\n\n**Branch B \u2014 Lookalike:** After Discovery creators are fully analyzed, the top-scoring creator (by highest estimated reach per post) is automatically selected as a seed for the Lookalike API. Lookalike results then go through the same Enrichment \u2192 Normalize \u2192 AI Agent pipeline.\n\n**Both branches converge at HubSpot** \u2014 every analyzed creator (discovery + lookalike) is created or updated as a contact.\n\n**Credentials to configure:**\n- Discovery API \u2192 `Lookalike` header auth\n- Enrichment + Lookalike API \u2192 `Enrichment API` header auth\n- AI Agents \u2192 OpenAI credential\n- HubSpot \u2192 App Token credential"
      },
      "typeVersion": 1
    },
    {
      "id": "aeaacab0-370f-47e6-b8fc-35419a9b515f",
      "name": "Note: Schedule",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 366,
        "content": "\u23f0 **Schedule Trigger**\nFires the pipeline on your chosen interval. Adjust frequency based on credit budget \u2014 each run costs credits per creator enriched."
      },
      "typeVersion": 1
    },
    {
      "id": "997d41ea-dffb-4015-a952-a2d29adc87b0",
      "name": "Note: Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 444,
        "height": 366,
        "content": "\ud83d\udd0d **Discovery API**\nSearches 340M+ creators by niche, location, engagement, and followers. Returns lightweight profiles. Edit `ai_search` to target your niche."
      },
      "typeVersion": 1
    },
    {
      "id": "298d28c1-daab-4acc-b5ff-1182a0a3049e",
      "name": "Note: Enrich Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 366,
        "content": "\ud83d\udd2c **Enrichment API**\nFetches full profile: contact info, audience demographics, engagement metrics, income estimates, follower growth, brand deal history, and cross-platform links."
      },
      "typeVersion": 1
    },
    {
      "id": "1b09c51f-3286-4524-9b2f-3aea7ac7685b",
      "name": "Note: Normalize Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 350,
        "content": "\ud83e\uddf9 **Normalize Profile**\nStandardizes raw API data: cleans handles, strips CloudFront params, builds cross-platform links, computes engagement ratios, maps growth trends, deduplicates collaborators."
      },
      "typeVersion": 1
    },
    {
      "id": "ab1405a1-69a5-4238-b760-4c0f68a27c1e",
      "name": "Note: Loop Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 200,
        "height": 356,
        "content": "\ud83d\udd01 **Loop Over Items**\nProcesses one creator at a time. Port 0 = loop done (\u2192 Aggregate). Port 1 = next item (\u2192 AI Agent)."
      },
      "typeVersion": 1
    },
    {
      "id": "4fc2ebd8-79c2-415c-8ab3-499a5fca9e52",
      "name": "Note: Agent Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        1008
      ],
      "parameters": {
        "color": 6,
        "width": 326,
        "height": 552,
        "content": "\ud83e\udd16 **AI Agent (Discovery)**\nAnalyzes each creator: strengths, concerns, audience authenticity, growth trajectory, brand fit, recommended action, and estimated reach per post. Uses structured JSON schema output."
      },
      "typeVersion": 1
    },
    {
      "id": "b158d009-a280-4e53-a750-b0614c1606c5",
      "name": "Note: HubSpot Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        1104
      ],
      "parameters": {
        "color": 3,
        "width": 290,
        "height": 276,
        "content": "\ud83d\udfe0 **HubSpot (Discovery)**\nCreates or updates a HubSpot contact for each Discovery creator using their email from the normalized profile."
      },
      "typeVersion": 1
    },
    {
      "id": "dd423302-fb62-420e-a8bb-fd098fb2b745",
      "name": "Note: Aggregate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 302,
        "content": "\ud83d\udce6 **Aggregate**\nCollects ALL scored Discovery creators into one array once the loop finishes, enabling comparison of `estimated_reach_per_post.high` across all results."
      },
      "typeVersion": 1
    },
    {
      "id": "2c13964c-9f1d-4bb1-a3ef-7155ec9eb687",
      "name": "Note: Pick Top",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 210,
        "height": 302,
        "content": "\ud83c\udfc6 **Pick Top Creator**\nFinds the creator with the highest `estimated_reach_per_post.high` score. Extracts their handle as the lookalike seed for Branch B."
      },
      "typeVersion": 1
    },
    {
      "id": "41ecca3b-05b0-41cb-90a0-0f9c46a1f9a0",
      "name": "Note: Lookalike",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 450,
        "height": 334,
        "content": "\ud83d\udc6f **Lookalike API**\nFinds creators similar to the top Discovery creator using audience patterns, niche signals, and engagement profiles as similarity signals."
      },
      "typeVersion": 1
    },
    {
      "id": "b45281d1-8fa1-401b-bd42-a49245ba0fcf",
      "name": "Note: Enrich Lookalike",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 340,
        "content": "\ud83d\udd2c **Enrichment API (Lookalike)**\nSame enrichment call as Branch A. Fetches full profile for each lookalike creator."
      },
      "typeVersion": 1
    },
    {
      "id": "08dd83ba-7fc5-448b-af5b-42c9d3234496",
      "name": "Note: Loop Lookalike",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 340,
        "content": "\ud83d\udd01 **Loop (Lookalike)**\nProcesses each lookalike creator individually through AI analysis. Port 0 = done, Port 1 = next item."
      },
      "typeVersion": 1
    },
    {
      "id": "3a28ea59-7714-4a5f-9985-60fc4bb616ac",
      "name": "Note: Agent Lookalike",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2816,
        752
      ],
      "parameters": {
        "color": 7,
        "width": 332,
        "height": 494,
        "content": "\ud83e\udd16 **AI Agent (Lookalike)**\nIdentical analysis to Branch A. Scores each lookalike on engagement quality, brand fit, growth trajectory, and estimated reach per post."
      },
      "typeVersion": 1
    },
    {
      "id": "ea067d44-8950-42ab-8e0e-7a8c7d1a3c3a",
      "name": "Note: HubSpot Lookalike",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        736
      ],
      "parameters": {
        "color": 3,
        "width": 220,
        "height": 350,
        "content": "\ud83d\udfe0 **HubSpot (Lookalike)**\nCreates or updates a HubSpot contact for each Lookalike creator. Same node config as Branch A \u2014 both pipelines converge to CRM."
      },
      "typeVersion": 1
    },
    {
      "id": "4d317444-bd74-49fd-944b-731e524316fb",
      "name": "Split Out Discovery",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -192,
        1200
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "accounts"
      },
      "typeVersion": 1
    },
    {
      "id": "bdff725b-6d53-4c7a-8e2a-127c33bceefe",
      "name": "Normalize Profile (Discovery)",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        1184
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "function stripUrl(url){if(!url)return null;return typeof url==='string'&&url.includes('?')?url.split('?')[0]:url;}\nfunction normHandle(raw){if(!raw||typeof raw!=='string')return null;return raw.replace(/^@/,'').toLowerCase().trim();}\nfunction fmtFollowers(n){if(n==null)return null;if(n>=1000000)return`${(n/1000000).toFixed(1)}M`;if(n>=1000)return`${(n/1000).toFixed(0)}K`;return`${n}`;}\nfunction growthTrend(g){if(!g||typeof g!=='object')return null;const vals=[g['12_months_ago'],g['9_months_ago'],g['6_months_ago'],g['3_months_ago']].filter(v=>typeof v==='number');if(vals.length<2)return null;return vals[vals.length-1]>vals[0]?'accelerating':'decelerating';}\nfunction buildLinks(ch,handle){const l={};if(!handle)return l;if(Array.isArray(ch)){ch.forEach(e=>{if(e&&typeof e==='object')Object.entries(e).forEach(([p,u])=>{if(u)l[p]=u;});});}else if(ch&&typeof ch==='object'){if(ch.has_instagram||ch.instagram)l.instagram=`https://www.instagram.com/${handle}`;if(ch.has_tiktok)l.tiktok=`https://www.tiktok.com/@${handle}`;if(ch.has_youtube)l.youtube=`https://www.youtube.com/@${handle}`;if(ch.has_twitter)l.twitter=`https://twitter.com/${handle}`;if(ch.has_linktree)l.linktree=`https://linktr.ee/${handle}`;}return l;}\nfunction dedupCollabs(tagged){if(!Array.isArray(tagged))return[];const c={};tagged.forEach(t=>{if(t?.username)c[t.username]=(c[t.username]||0)+1;});return Object.entries(c).sort((a,b)=>b[1]-a[1]).slice(0,8).map(([u])=>u);}\n\nfunction normalize(entry) {\n  // FIX: unwrap the \"result\" wrapper\n  const raw = entry.result || entry;\n  const ig = raw.instagram || {};\n\n  const handle = normHandle(ig?.username || ig?.handle || raw?.creator_handle);\n  const userId = ig?.userid || ig?.user_id || raw?.user_id || null;\n  const email = raw?.email || raw?.contact_email || ig?.email || null;\n  const followers = ig?.follower_count ?? ig?.followers ?? null;\n  const engPct = ig?.engagement_percent ?? null;\n  const avgLikes = ig?.avg_likes ?? ig?.average_likes ?? null;\n  const avgComments = ig?.avg_comments ?? ig?.average_comments ?? null;\n  const ctlRatio = (typeof avgLikes==='number'&&avgLikes>0&&typeof avgComments==='number') ? parseFloat(((avgComments/avgLikes)*100).toFixed(2)) : null;\n  const ch = raw?.creator_has || ig?.creator_has || null;\n  const xp = buildLinks(ch, handle);\n  if(handle && !xp.instagram) xp.instagram = `https://www.instagram.com/${handle}`;\n  const lt = ig?.linktree || raw?.linktree || null;\n  if(lt && !xp.linktree) xp.linktree = `https://linktr.ee/${lt}`;\n  const gr = ig?.creator_follower_growth || null;\n  const fg = gr ? {'3_months_ago_pct':gr['3_months_ago']??null,'6_months_ago_pct':gr['6_months_ago']??null,'9_months_ago_pct':gr['9_months_ago']??null,'12_months_ago_pct':gr['12_months_ago']??null,trend:growthTrend(gr)} : null;\n  const aud = {\n    follower_count: followers,\n    follower_count_fmt: fmtFollowers(followers),\n    following_count: ig?.following_count ?? null,\n    media_count: ig?.media_count ?? null,\n    top_country: ig?.country || raw?.location || null,\n    state: ig?.state || null,\n    city: ig?.city || null,\n    location_certainty: ig?.location_certainty ?? null,\n    language: Array.isArray(ig?.language_code) ? ig.language_code[0] : (raw?.speaking_language || ig?.language_code || null)\n  };\n  const collabs = dedupCollabs(ig?.tagged || []).filter(u => u !== handle);\n  const locs = [...new Set((ig?.locations || []).filter(Boolean))].slice(0,5);\n  const incRaw = ig?.income || raw?.income_data?.instagram || null;\n  const inc = incRaw ? {min_usd:incRaw.min??null,max_usd:incRaw.max??null,currency:incRaw.currency??null} : null;\n  let tags = [];\n  if(Array.isArray(ig?.hashtags_count) && ig.hashtags_count.length){\n    tags = ig.hashtags_count.sort((a,b)=>b.count-a.count).slice(0,10).map(h=>h.name);\n  } else if(Array.isArray(ig?.hashtags)){\n    const seen = new Set();\n    tags = ig.hashtags.filter(h=>h&&h.length>1&&!seen.has(h)&&seen.add(h)).slice(0,10);\n  }\n  const dk = handle ? `instagram:${handle}` : userId ? `instagram:${userId}` : null;\n\n  return {\n    normalized_profile: {\n      identity: {\n        user_id: userId,\n        full_name: ig?.full_name || raw?.first_name || null,\n        handle,\n        display_handle: handle ? `@${handle}` : null,\n        platform_primary: 'instagram',\n        profile_url: handle ? `https://www.instagram.com/${handle}` : null,\n        profile_picture: stripUrl(ig?.profile_picture || ig?.profile_picture_hd),\n        email,\n        is_verified: ig?.is_verified ?? false,\n        is_private: ig?.is_private ?? false,\n        is_business_account: ig?.is_business_account ?? raw?.is_business ?? false,\n        account_type: raw?.is_creator ? 'creator' : (ig?.account_type === 3 ? 'creator' : 'personal'),\n        category: ig?.category || null,\n        niche_topics: ig?.niche_class || []\n      },\n      cross_platform_links: xp,\n      contact: {\n        email,\n        email_type: raw?.email_type || null,\n        phone: raw?.contact_phone_number ? `+${String(raw.contact_phone_number).replace(/^\\+/,'')}` : (ig?.contact_phone_number || null),\n        has_link_in_bio: ig?.uses_link_in_bio ?? raw?.has_link_in_bio ?? false,\n        bio_links: ig?.links_in_bio || raw?.links_in_bio || []\n      },\n      audience: aud,\n      follower_growth: fg,\n      engagement: {\n        engagement_percent: engPct,\n        avg_likes: avgLikes,\n        avg_comments: avgComments,\n        median_likes: ig?.likes_median ?? null,\n        median_comments: ig?.comments_median ?? null,\n        comment_to_like_ratio_pct: ctlRatio\n      },\n      content: {\n        posting_frequency_per_month: ig?.posting_frequency_recent_months ?? null,\n        reels_percentage: ig?.reels_percentage_last_12_posts ?? null,\n        video_content_creator: ig?.video_content_creator ?? false,\n        most_recent_post_date: ig?.most_recent_post_date || null,\n        top_hashtags: tags,\n        biography: ig?.biography || null\n      },\n      monetization: {\n        has_brand_deals: raw?.has_brand_deals ?? ig?.has_done_brand_deals ?? false,\n        has_merch: ig?.has_merch ?? false,\n        promotes_affiliate_links: ig?.promotes_affiliate_links ?? false,\n        estimated_income: inc\n      },\n      network: {\n        frequent_collaborators: collabs,\n        primary_locations: locs\n      },\n      flags: {\n        low_engagement: typeof engPct==='number' && typeof followers==='number' && engPct<1.0 && followers>10000,\n        tiktok_id_only: !!(xp.tiktok && /\\/\\d{10,}/.test(xp.tiktok))\n      },\n      dedup_key: dk\n    }\n  };\n}\n\n// Handle both single item and array input\nconst input = item.json;\nif (Array.isArray(input)) {\n  return input.map(entry => ({ json: normalize(entry) }));\n} else {\n  return { json: normalize(input) };\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "108e77d8-e1a4-4135-b570-cf526e15b7e3",
      "name": "Loop Over Items (Discovery)",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        544,
        1184
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "9b321295-1e2d-4b01-b5ee-e1286791a7fd",
      "name": "AI Agent (Discovery)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        800,
        1200
      ],
      "parameters": {
        "text": "=Analyze the following normalized creator profile and provide a structured analysis.\n\nCreator Profile:\n{{ JSON.stringify($json.normalized_profile, null, 2) }}\n\nRespond ONLY with this JSON structure, no markdown, no extra text:\n\n{\n  \"summary\": \"2-3 sentence overview of who this creator is and their positioning\",\n  \"strengths\": [\"Specific strength with data evidence\"],\n  \"concerns\": [\"Specific concern with data evidence\"],\n  \"audience_analysis\": { \"authenticity_assessment\": \"string\", \"engagement_quality\": \"low | medium | high\", \"engagement_notes\": \"string\" },\n  \"growth_analysis\": { \"trajectory\": \"declining | stagnant | steady | accelerating\", \"notes\": \"string\" },\n  \"content_analysis\": { \"content_style\": \"string\", \"niche_clarity\": \"weak | moderate | strong\", \"niche_notes\": \"string\" },\n  \"brand_fit\": { \"best_fit_categories\": [\"string\"], \"poor_fit_categories\": [\"string\"], \"campaign_types\": [\"string\"] },\n  \"flags\": [\"string\"],\n  \"recommended_action\": \"approve | review | reject\",\n  \"recommended_action_reason\": \"string\",\n  \"estimated_reach_per_post\": { \"low\": 0, \"high\": 0, \"basis\": \"string\" },\n  \"handle\": \"string\"\n}",
        "options": {
          "systemMessage": "You are an expert influencer marketing analyst with deep knowledge of Instagram metrics, creator monetization, audience authenticity signals, and brand partnership strategy. Always respond with valid JSON only \u2014 no markdown code blocks, no preamble, no explanation outside the JSON object."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "d985a579-64d6-43fe-96bc-460f443f05b6",
      "name": "OpenAI Model (Discovery)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        720,
        1424
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "eb1fcae0-27bc-4458-9d87-f7f889fbeff9",
      "name": "Structured Output Parser (Discovery)",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        928,
        1424
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"handle\": { \"type\": \"string\" },\n    \"summary\": { \"type\": \"string\" },\n    \"strengths\": { \n      \"type\": \"array\", \n      \"items\": { \"type\": \"string\" } \n    },\n    \"concerns\": { \n      \"type\": \"array\", \n      \"items\": { \"type\": \"string\" } \n    },\n    \"audience_analysis\": { \n      \"type\": \"object\", \n      \"properties\": { \n        \"authenticity_assessment\": { \"type\": \"string\" }, \n        \"engagement_quality\": { \n          \"type\": \"string\", \n          \"enum\": [\"low\",\"medium\",\"high\"] \n        }, \n        \"engagement_notes\": { \"type\": \"string\" } \n      }, \n      \"required\": [\n        \"authenticity_assessment\",\n        \"engagement_quality\",\n        \"engagement_notes\"\n      ] \n    },\n    \"growth_analysis\": { \n      \"type\": \"object\", \n      \"properties\": { \n        \"trajectory\": { \n          \"type\": \"string\", \n          \"enum\": [\"declining\",\"stagnant\",\"steady\",\"accelerating\"] \n        }, \n        \"notes\": { \"type\": \"string\" } \n      }, \n      \"required\": [\"trajectory\",\"notes\"] \n    },\n    \"content_analysis\": { \n      \"type\": \"object\", \n      \"properties\": { \n        \"content_style\": { \"type\": \"string\" }, \n        \"niche_clarity\": { \n          \"type\": \"string\", \n          \"enum\": [\"weak\",\"moderate\",\"strong\"] \n        }, \n        \"niche_notes\": { \"type\": \"string\" } \n      }, \n      \"required\": [\n        \"content_style\",\n        \"niche_clarity\",\n        \"niche_notes\"\n      ] \n    },\n    \"brand_fit\": { \n      \"type\": \"object\", \n      \"properties\": { \n        \"best_fit_categories\": { \n          \"type\": \"array\", \n          \"items\": { \"type\": \"string\" } \n        }, \n        \"poor_fit_categories\": { \n          \"type\": \"array\", \n          \"items\": { \"type\": \"string\" } \n        }, \n        \"campaign_types\": { \n          \"type\": \"array\", \n          \"items\": { \"type\": \"string\" } \n        } \n      }, \n      \"required\": [\n        \"best_fit_categories\",\n        \"poor_fit_categories\",\n        \"campaign_types\"\n      ] \n    },\n    \"flags\": { \n      \"type\": \"array\", \n      \"items\": { \"type\": \"string\" } \n    },\n    \"recommended_action\": { \n      \"type\": \"string\", \n      \"enum\": [\"approve\",\"review\",\"reject\"] \n    },\n    \"recommended_action_reason\": { \"type\": \"string\" },\n    \"estimated_reach_per_post\": { \n      \"type\": \"object\", \n      \"properties\": { \n        \"low\": { \"type\": \"number\" }, \n        \"high\": { \"type\": \"number\" }, \n        \"basis\": { \"type\": \"string\" } \n      }, \n      \"required\": [\"low\",\"high\",\"basis\"] \n    }\n  },\n  \"required\": [\n    \"handle\",\n    \"summary\",\n    \"strengths\",\n    \"concerns\",\n    \"audience_analysis\",\n    \"growth_analysis\",\n    \"content_analysis\",\n    \"brand_fit\",\n    \"flags\",\n    \"recommended_action\",\n    \"recommended_action_reason\",\n    \"estimated_reach_per_post\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6d23d45c-dbd7-43f5-b31f-9c8432b0c71a",
      "name": "HubSpot \u2014 Discovery Creator",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1248,
        1200
      ],
      "parameters": {
        "email": "={{ $json.normalized_profile.identity.email }}",
        "options": {},
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "18be1e83-2399-498b-a283-79cf2ddaa4e9",
      "name": "Aggregate Discovery Results",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1136,
        912
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "e04f327f-22b4-44de-9ed7-2ef53ea2acd7",
      "name": "Pick Top Creator (Highest Reach)",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        912
      ],
      "parameters": {
        "jsCode": "// \u2500\u2500 Find creator with highest estimated_reach_per_post.high \u2500\u2500\n\nconst allData = items[0].json.data;\nconst creators = Array.isArray(allData) ? allData : [];\n\nlet topHandle = null;\nlet topReach = -1;\n\ncreators.forEach(item => {\n  const reach = item?.output?.estimated_reach_per_post?.high ?? 0;\n  const handle = item?.output?.handle ?? null;\n\n  if (reach > topReach && handle) {\n    topReach = reach;\n    topHandle = handle;\n  }\n});\n\n// Fallback if no valid result found\nif (!topHandle && creators.length > 0) {\n  topHandle = creators[0]?.output?.handle ?? 'unknown';\n  topReach = creators[0]?.output?.estimated_reach_per_post?.high ?? 0;\n}\n\nreturn [\n  {\n    json: {\n      lookalike_seed_handle: topHandle || 'unknown',\n      seed_reach_high: topReach\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "985c9e45-da91-4d31-9767-e00251f0dd19",
      "name": "Split Out Lookalike",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1872,
        912
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "accounts"
      },
      "typeVersion": 1
    },
    {
      "id": "e07f408a-9c39-4357-9933-6bcb55e6c825",
      "name": "Normalize Profile (Lookalike)",
      "type": "n8n-nodes-base.code",
      "position": [
        2368,
        896
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "function stripUrl(url){if(!url)return null;return typeof url==='string'&&url.includes('?')?url.split('?')[0]:url;}\nfunction normHandle(raw){if(!raw||typeof raw!=='string')return null;return raw.replace(/^@/,'').toLowerCase().trim();}\nfunction fmtFollowers(n){if(n==null)return null;if(n>=1000000)return`${(n/1000000).toFixed(1)}M`;if(n>=1000)return`${(n/1000).toFixed(0)}K`;return`${n}`;}\nfunction growthTrend(g){if(!g||typeof g!=='object')return null;const vals=[g['12_months_ago'],g['9_months_ago'],g['6_months_ago'],g['3_months_ago']].filter(v=>typeof v==='number');if(vals.length<2)return null;return vals[vals.length-1]>vals[0]?'accelerating':'decelerating';}\nfunction buildLinks(ch,handle){const l={};if(!handle)return l;if(Array.isArray(ch)){ch.forEach(e=>{if(e&&typeof e==='object')Object.entries(e).forEach(([p,u])=>{if(u)l[p]=u;});});}else if(ch&&typeof ch==='object'){if(ch.has_instagram||ch.instagram)l.instagram=`https://www.instagram.com/${handle}`;if(ch.has_tiktok)l.tiktok=`https://www.tiktok.com/@${handle}`;if(ch.has_youtube)l.youtube=`https://www.youtube.com/@${handle}`;if(ch.has_twitter)l.twitter=`https://twitter.com/${handle}`;if(ch.has_linktree)l.linktree=`https://linktr.ee/${handle}`;}return l;}\nfunction dedupCollabs(tagged){if(!Array.isArray(tagged))return[];const c={};tagged.forEach(t=>{if(t?.username)c[t.username]=(c[t.username]||0)+1;});return Object.entries(c).sort((a,b)=>b[1]-a[1]).slice(0,8).map(([u])=>u);}\n\nfunction normalize(entry) {\n  // Detect format A: { result: { instagram: {...}, ... }, credits_cost: 1 }\n  // Detect format B: { user_id, profile: { username, followers, ... } }\n  // Detect format C: flat enriched data directly\n\n  const isFormatA = !!(entry.result && entry.result.instagram);\n  const isFormatB = !!(entry.profile && entry.profile.username);\n\n  if (isFormatB) {\n    // Lightweight lookalike format\n    const profile = entry.profile;\n    const handle = normHandle(profile.username);\n    const followers = profile.followers ?? null;\n    const engPct = profile.engagement_percent ?? null;\n    return {\n      normalized_profile: {\n        identity: {\n          user_id: entry.user_id || null,\n          full_name: profile.full_name || null,\n          handle,\n          display_handle: handle ? `@${handle}` : null,\n          platform_primary: 'instagram',\n          profile_url: handle ? `https://www.instagram.com/${handle}` : null,\n          profile_picture: stripUrl(profile.picture),\n          email: null, is_verified: false, is_private: false,\n          is_business_account: false, account_type: 'personal',\n          category: null, niche_topics: []\n        },\n        cross_platform_links: { instagram: handle ? `https://www.instagram.com/${handle}` : null },\n        contact: { email: null, email_type: null, phone: null, has_link_in_bio: false, bio_links: [] },\n        audience: { follower_count: followers, follower_count_fmt: fmtFollowers(followers), following_count: null, media_count: null, top_country: null, state: null, city: null, location_certainty: null, language: null },\n        follower_growth: null,\n        engagement: { engagement_percent: engPct, avg_likes: null, avg_comments: null, median_likes: null, median_comments: null, comment_to_like_ratio_pct: null },\n        content: { posting_frequency_per_month: null, reels_percentage: null, video_content_creator: false, most_recent_post_date: null, top_hashtags: [], biography: null },\n        monetization: { has_brand_deals: false, has_merch: false, promotes_affiliate_links: false, estimated_income: null },\n        network: { frequent_collaborators: [], primary_locations: [] },\n        flags: { low_engagement: typeof engPct==='number'&&typeof followers==='number'&&engPct<1.0&&followers>10000, tiktok_id_only: false },\n        dedup_key: handle ? `instagram:${handle}` : entry.user_id ? `instagram:${entry.user_id}` : null\n      }\n    };\n  }\n\n  // Format A or C \u2014 full enrichment data\n  const raw = isFormatA ? entry.result : entry;\n  const ig = raw.instagram || {};\n\n  const handle = normHandle(ig?.username || ig?.handle || raw?.creator_handle);\n  const userId = ig?.userid || ig?.user_id || raw?.user_id || null;\n  const email = raw?.email || raw?.contact_email || ig?.email || null;\n  const followers = ig?.follower_count ?? ig?.followers ?? null;\n  const engPct = ig?.engagement_percent ?? null;\n  const avgLikes = ig?.avg_likes ?? ig?.average_likes ?? null;\n  const avgComments = ig?.avg_comments ?? ig?.average_comments ?? null;\n  const ctlRatio = (typeof avgLikes==='number'&&avgLikes>0&&typeof avgComments==='number') ? parseFloat(((avgComments/avgLikes)*100).toFixed(2)) : null;\n  const ch = raw?.creator_has || ig?.creator_has || null;\n  const xp = buildLinks(ch, handle);\n  if(handle && !xp.instagram) xp.instagram = `https://www.instagram.com/${handle}`;\n  const lt = ig?.linktree || raw?.linktree || null;\n  if(lt && !xp.linktree) xp.linktree = `https://linktr.ee/${lt}`;\n  const gr = ig?.creator_follower_growth || null;\n  const fg = gr ? {'3_months_ago_pct':gr['3_months_ago']??null,'6_months_ago_pct':gr['6_months_ago']??null,'9_months_ago_pct':gr['9_months_ago']??null,'12_months_ago_pct':gr['12_months_ago']??null,trend:growthTrend(gr)} : null;\n  const aud = { follower_count: followers, follower_count_fmt: fmtFollowers(followers), following_count: ig?.following_count??null, media_count: ig?.media_count??null, top_country: ig?.country||raw?.location||null, state: ig?.state||null, city: ig?.city||null, location_certainty: ig?.location_certainty??null, language: Array.isArray(ig?.language_code)?ig.language_code[0]:(raw?.speaking_language||ig?.language_code||null) };\n  const collabs = dedupCollabs(ig?.tagged||[]).filter(u=>u!==handle);\n  const locs = [...new Set((ig?.locations||[]).filter(Boolean))].slice(0,5);\n  const incRaw = ig?.income || raw?.income_data?.instagram || null;\n  const inc = incRaw ? {min_usd:incRaw.min??null,max_usd:incRaw.max??null,currency:incRaw.currency??null} : null;\n  let tags = [];\n  if(Array.isArray(ig?.hashtags_count)&&ig.hashtags_count.length){ tags=ig.hashtags_count.sort((a,b)=>b.count-a.count).slice(0,10).map(h=>h.name); }\n  else if(Array.isArray(ig?.hashtags)){ const seen=new Set(); tags=ig.hashtags.filter(h=>h&&h.length>1&&!seen.has(h)&&seen.add(h)).slice(0,10); }\n  const dk = handle?`instagram:${handle}`:userId?`instagram:${userId}`:null;\n\n  return {\n    normalized_profile: {\n      identity: { user_id: userId, full_name: ig?.full_name||raw?.first_name||null, handle, display_handle: handle?`@${handle}`:null, platform_primary:'instagram', profile_url: handle?`https://www.instagram.com/${handle}`:null, profile_picture: stripUrl(ig?.profile_picture||ig?.profile_picture_hd), email, is_verified: ig?.is_verified??false, is_private: ig?.is_private??false, is_business_account: ig?.is_business_account??raw?.is_business??false, account_type: raw?.is_creator?'creator':(ig?.account_type===3?'creator':'personal'), category: ig?.category||null, niche_topics: ig?.niche_class||[] },\n      cross_platform_links: xp,\n      contact: { email, email_type: raw?.email_type||null, phone: raw?.contact_phone_number?`+${String(raw.contact_phone_number).replace(/^\\+/,'')}` :(ig?.contact_phone_number||null), has_link_in_bio: ig?.uses_link_in_bio??raw?.has_link_in_bio??false, bio_links: ig?.links_in_bio||raw?.links_in_bio||[] },\n      audience: aud,\n      follower_growth: fg,\n      engagement: { engagement_percent: engPct, avg_likes: avgLikes, avg_comments: avgComments, median_likes: ig?.likes_median??null, median_comments: ig?.comments_median??null, comment_to_like_ratio_pct: ctlRatio },\n      content: { posting_frequency_per_month: ig?.posting_frequency_recent_months??null, reels_percentage: ig?.reels_percentage_last_12_posts??null, video_content_creator: ig?.video_content_creator??false, most_recent_post_date: ig?.most_recent_post_date||null, top_hashtags: tags, biography: ig?.biography||null },\n      monetization: { has_brand_deals: raw?.has_brand_deals??ig?.has_done_brand_deals??false, has_merch: ig?.has_merch??false, promotes_affiliate_links: ig?.promotes_affiliate_links??false, estimated_income: inc },\n      network: { frequent_collaborators: collabs, primary_locations: locs },\n      flags: { low_engagement: typeof engPct==='number'&&typeof followers==='number'&&engPct<1.0&&followers>10000, tiktok_id_only: !!(xp.tiktok&&/\\/\\d{10,}/.test(xp.tiktok)) },\n      dedup_key: dk\n    }\n  };\n}\n\n// Handle array or single item\nconst input = item.json;\nif (Array.isArray(input)) {\n  return input.map(entry => ({ json: normalize(entry) }));\n} else {\n  return { json: normalize(input) };\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "aa929ac2-a4fd-4f59-ab7b-88647428d3db",
      "name": "Loop Over Items (Lookalike)",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2608,
        896
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "661aae97-45fa-410e-8f7d-5f2a41db6108",
      "name": "AI Agent (Lookalike)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2864,
        912
      ],
      "parameters": {
        "text": "=Analyze the following normalized creator profile and provide a structured analysis.\n\nCreator Profile:\n{{ JSON.stringify($json.normalized_profile, null, 2) }}\n\nRespond ONLY with this JSON structure, no markdown, no extra text:\n\n{\n  \"summary\": \"2-3 sentence overview of who this creator is and their positioning\",\n  \"strengths\": [\"Specific strength with data evidence\"],\n  \"concerns\": [\"Specific concern with data evidence\"],\n  \"audience_analysis\": { \"authenticity_assessment\": \"string\", \"engagement_quality\": \"low | medium | high\", \"engagement_notes\": \"string\" },\n  \"growth_analysis\": { \"trajectory\": \"declining | stagnant | steady | accelerating\", \"notes\": \"string\" },\n  \"content_analysis\": { \"content_style\": \"string\", \"niche_clarity\": \"weak | moderate | strong\", \"niche_notes\": \"string\" },\n  \"brand_fit\": { \"best_fit_categories\": [\"string\"], \"poor_fit_categories\": [\"string\"], \"campaign_types\": [\"string\"] },\n  \"flags\": [\"string\"],\n  \"recommended_action\": \"approve | review | reject\",\n  \"recommended_action_reason\": \"string\",\n  \"estimated_reach_per_post\": { \"low\": 0, \"high\": 0, \"basis\": \"string\" }\n}",
        "options": {
          "systemMessage": "You are an expert influencer marketing analyst with deep knowledge of Instagram metrics, creator monetization, audience authenticity signals, and brand partnership strategy. Always respond with valid JSON only \u2014 no markdown code blocks, no preamble, no explanation outside the JSON object."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "2b189bd7-943b-473b-adf4-9304bbf69316",
      "name": "OpenAI Model (Lookalike)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2816,
        1120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "9a68ee5f-afde-495d-acd6-c7910021c1ec",
      "name": "Structured Output Parser (Lookalike)",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3056,
        1120
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"summary\": { \"type\": \"string\" },\n    \"strengths\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n    \"concerns\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n    \"audience_analysis\": { \"type\": \"object\", \"properties\": { \"authenticity_assessment\": { \"type\": \"string\" }, \"engagement_quality\": { \"type\": \"string\", \"enum\": [\"low\",\"medium\",\"high\"] }, \"engagement_notes\": { \"type\": \"string\" } }, \"required\": [\"authenticity_assessment\",\"engagement_quality\",\"engagement_notes\"] },\n    \"growth_analysis\": { \"type\": \"object\", \"properties\": { \"trajectory\": { \"type\": \"string\", \"enum\": [\"declining\",\"stagnant\",\"steady\",\"accelerating\"] }, \"notes\": { \"type\": \"string\" } }, \"required\": [\"trajectory\",\"notes\"] },\n    \"content_analysis\": { \"type\": \"object\", \"properties\": { \"content_style\": { \"type\": \"string\" }, \"niche_clarity\": { \"type\": \"string\", \"enum\": [\"weak\",\"moderate\",\"strong\"] }, \"niche_notes\": { \"type\": \"string\" } }, \"required\": [\"content_style\",\"niche_clarity\",\"niche_notes\"] },\n    \"brand_fit\": { \"type\": \"object\", \"properties\": { \"best_fit_categories\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }, \"poor_fit_categories\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }, \"campaign_types\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } } }, \"required\": [\"best_fit_categories\",\"poor_fit_categories\",\"campaign_types\"] },\n    \"flags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n    \"recommended_action\": { \"type\": \"string\", \"enum\": [\"approve\",\"review\",\"reject\"] },\n    \"recommended_action_reason\": { \"type\": \"string\" },\n    \"estimated_reach_per_post\": { \"type\": \"object\", \"properties\": { \"low\": { \"type\": \"number\" }, \"high\": { \"type\": \"number\" }, \"basis\": { \"type\": \"string\" } }, \"required\": [\"low\",\"high\",\"basis\"] }\n  },\n  \"required\": [\"summary\",\"strengths\",\"concerns\",\"audience_analysis\",\"growth_analysis\",\"content_analysis\",\"brand_fit\",\"flags\",\"recommended_action\",\"recommended_action_reason\",\"estimated_reach_per_post\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a136b780-c7ae-466c-a9aa-2c5646ece9a7",
      "name": "HubSpot \u2014 Lookalike Creator",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        3264,
        912
      ],
      "parameters": {
        "email": "={{ $json.normalized_profile.identity.email }}",
        "options": {},
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "62b14e29-dd8a-4582-9ee9-172b7d4dab17",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -688,
        1200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "bd39498f-d948-4061-911b-3c65765a9bfd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        256
      ],
      "parameters": {
        "width": 752,
        "content": "## Find new creators and lookalikes and add them to your CRM\n**Step by step workflow to discover creators with multi social (Instagram, Tiktok, Youtube, Twitter, Onlyfans, Twitch and more) data and find similar ones using the influencer.club API and Hubspot**. [Full explanation](https://influencers.club/creatorbook/find-creators-for-influencer-marketing-platform/)"
      },
      "typeVersion": 1
    },
    {
      "id": "6ff4f337-e2aa-4c1a-aa9a-c87259a40f31",
      "name": "Discovery",
      "type": "n8n-nodes-influencersclub.influencersClub",
      "position": [
        -432,
        1200
      ],
      "parameters": {
        "platform": "instagram",
        "resource": "discovery",
        "operation": "discovery",
        "discovery_page": 0,
        "advancedFilters": {},
        "discovery_limit": 5,
        "instagramFilters": {},
        "additionalOptions": {},
        "discovery_sort_by": "relevancy"
      },
      "credentials": {
        "influencersClubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ec2e575e-ce6b-4fd1-abd2-0ebd3d855c8f",
      "name": "Enrich by Handle (Full)",
      "type": "n8n-nodes-influencersclub.influencersClub",
      "onError": "continueErrorOutput",
      "position": [
        64,
        1200
      ],
      "parameters": {
        "handle": "={{ $json.profile.username }}",
        "operation": "enrichByHandle"
      },
      "credentials": {
        "influencersClubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9dbcc327-e7ce-4bbc-a881-d43c58962a31",
      "name": "Find Similar Creators",
      "type": "n8n-nodes-influencersclub.influencersClub",
      "position": [
        1648,
        912
      ],
      "parameters": {
        "platform": "instagram",
        "resource": "creator",
        "operation": "findLookalikes",
        "filter_key": "username",
        "filter_value": "={{ $json.lookalike_seed_handle }}",
        "advancedFilters": {},
        "instagramFilters": {},
        "additionalOptions": {}
      },
      "credentials": {
        "influencersClubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "34f05ca8-4b9c-4541-8cbe-82de37550e2c",
      "name": "Enrich by Handle (Full)1",
      "type": "n8n-nodes-influencersclub.influencersClub",
      "onError": "continueErrorOutput",
      "position": [
        2128,
        912
      ],
      "parameters": {
        "handle": "={{ $json.profile.username }}",
        "operation": "enrichByHandle"
      },
      "credentials": {
        "influencersClubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "d1b8bde2-ccc6-49ec-953f-321a38c2da5f",
  "connections": {
    "Discovery": {
      "main": [
        [
          {
            "node": "Split Out Discovery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Discovery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Discovery": {
      "main": [
        [
          {
            "node": "Enrich by Handle (Full)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Lookalike": {
      "main": [
        [
          {
            "node": "Enrich by Handle (Full)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent (Discovery)": {
      "main": [
        [
          {
            "node": "Loop Over Items (Discovery)",
            "type": "main",
            "index": 0
          },
          {
            "node": "HubSpot \u2014 Discovery Creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent (Lookalike)": {
      "main": [
        [
          {
            "node": "Loop Over Items (Lookalike)",
            "type": "main",
            "index": 0
          },
          {
            "node": "HubSpot \u2014 Lookalike Creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Similar Creators": {
      "main": [
        [
          {
            "node": "Split Out Lookalike",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich by Handle (Full)": {
      "main": [
        [
          {
            "node": "Normalize Profile (Discovery)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich by Handle (Full)1": {
      "main": [
        [
          {
            "node": "Normalize Profile (Lookalike)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model (Discovery)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent (Discovery)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model (Lookalike)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent (Lookalike)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Discovery Results": {
      "main": [
        [
          {
            "node": "Pick Top Creator (Highest Reach)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items (Discovery)": {
      "main": [
        [
          {
            "node": "Aggregate Discovery Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent (Discovery)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items (Lookalike)": {
      "main": [
        [],
        [
          {
            "node": "AI Agent (Lookalike)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Profile (Discovery)": {
      "main": [
        [
          {
            "node": "Loop Over Items (Discovery)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Profile (Lookalike)": {
      "main": [
        [
          {
            "node": "Loop Over Items (Lookalike)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick Top Creator (Highest Reach)": {
      "main": [
        [
          {
            "node": "Find Similar Creators",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser (Discovery)": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent (Discovery)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser (Lookalike)": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent (Lookalike)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}