From e8c8a855565853b7913024f03b18001c1d4e56e8 Mon Sep 17 00:00:00 2001 From: nusquama Date: Sun, 15 Mar 2026 12:01:31 +0800 Subject: [PATCH] creation --- ..._contacts_with_influencers_club_gpt-4o-mini_and_sendgrid.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 workflows/Identify creators in Salesforce loyalty contacts with Influencers Club, GPT-4o-mini and SendGrid-13494/identify_creators_in_salesforce_loyalty_contacts_with_influencers_club_gpt-4o-mini_and_sendgrid.json diff --git a/workflows/Identify creators in Salesforce loyalty contacts with Influencers Club, GPT-4o-mini and SendGrid-13494/identify_creators_in_salesforce_loyalty_contacts_with_influencers_club_gpt-4o-mini_and_sendgrid.json b/workflows/Identify creators in Salesforce loyalty contacts with Influencers Club, GPT-4o-mini and SendGrid-13494/identify_creators_in_salesforce_loyalty_contacts_with_influencers_club_gpt-4o-mini_and_sendgrid.json new file mode 100644 index 000000000..3cc56f561 --- /dev/null +++ b/workflows/Identify creators in Salesforce loyalty contacts with Influencers Club, GPT-4o-mini and SendGrid-13494/identify_creators_in_salesforce_loyalty_contacts_with_influencers_club_gpt-4o-mini_and_sendgrid.json @@ -0,0 +1 @@ +{"id":"E3oa9wQgxcppjFtHFBSOy","meta":{"instanceId":"85adf2a35c28eb4259098779e620f01802fefc169e5e72d95fa3a1fcdca8b513","templateCredsSetupCompleted":true},"name":"Discover creators among loyalty program contacts on Salesforce and send email","tags":[],"nodes":[{"id":"d50c8ee8-ba01-4308-9c1a-3d019792b637","name":"Sticky Note - Header","type":"n8n-nodes-base.stickyNote","position":[2640,12480],"parameters":{"color":2,"width":920,"height":600,"content":"## šŸŽÆ Discover Creators Among Loyalty Program Customers and Activate Tiered Ambassador Programs\n\n\n### Setup steps\n\n**Required accounts:**\n- Salesforce (with loyalty_tier custom field)\n- influencers.club API key\n- OpenAI API key (GPT-4o-mini)\n- SendGrid account\n\n**Before running:**\n1. Create loyalty_tier custom field in Salesforce\n2. Add 20+ custom creator fields to Salesforce Contact object\n3. Configure Salesforce trigger\n4. Add your API keys to credentials\n5. Test with 1-2 contacts before scaling\n\n**Customize:**\n- Adjust tier thresholds in ambassador activation logic\n- Modify routing strategies for your programs\n- Update AI prompts for your brand voice"},"typeVersion":1},{"id":"e9301f6b-8818-4968-ba58-657c77aae2ac","name":"Sticky Note - Setup","type":"n8n-nodes-base.stickyNote","position":[8656,12576],"parameters":{"color":7,"width":680,"height":376,"content":"**šŸ“‹ SALESFORCE SETUP CHECKLIST**\n\nCreate these custom fields on the Contact object before running:\n\nāœ… **Creator Info:** Is_Creator__c, Creator_Tier__c, Creator_Niche__c, Creator_Subcategory__c, Primary_Platform__c\n\nāœ… **Metrics:** Follower_Count__c, Engagement_Rate__c, Social_Username__c, Profile_URL__c, Creator_Bio__c\n\nāœ… **Value:** Value_Score__c, Brand_Fit_Score__c, Content_Themes__c, Audience_Demographics__c\n\nāœ… **Ambassador:** Ambassador_Tier__c, Activation_Level__c, Activation_Date__c, Next_Activation_Action__c\n\nāœ… **Tracking:** Outreach_Strategy__c, Outreach_Priority__c, Outreach_Sent_Date__c, Personalization_Used__c"},"typeVersion":1},{"id":"43b79df3-0e3c-4473-b108-53ecf2b610a2","name":"Route Logic","type":"n8n-nodes-base.code","position":[5648,12896],"parameters":{"jsCode":"const items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n let classification;\n if (item.json.output && item.json.output.classification) {\n classification = item.json.output.classification;\n } else if (item.json.classification) {\n classification = item.json.classification;\n } else {\n results.push({json: {error: \"Classification missing\", data: item.json}});\n continue;\n }\n \n const tier = classification.tier;\n const engagement = classification.engagement_rate;\n const niche = classification.niche;\n const followers = classification.followers;\n const ecomNiches = ['fashion', 'beauty', 'fitness', 'home_lifestyle', 'pets', 'parenting', 'food'];\n \n let strategy = '';\n let reason = '';\n let perks = [];\n let action = '';\n \n if (['micro', 'mid', 'macro'].includes(tier)) {\n strategy = 'ambassador_program';\n reason = `${classification.tier_name}-tier (${followers.toLocaleString()} followers) qualifies for ambassador program`;\n perks = ['Exclusive codes', 'Monthly products', 'Commission', 'Featured placement', 'Early access'];\n action = 'Send ambassador invitation';\n }\n else if (tier === 'nano' && engagement >= 3) {\n strategy = 'surprise_rewards';\n reason = `Nano with ${engagement}% engagement deserves recognition`;\n perks = ['Gift package', 'Thank-you note', 'Early access', 'Personalized selection'];\n action = 'Send surprise gift';\n }\n else if (ecomNiches.includes(niche) && engagement >= 1) {\n strategy = 'niche_specific_perks';\n reason = `${classification.niche_name} creator aligned with brand`;\n const nicheMap = {\n fashion: ['Styling sessions', 'Lookbook features', 'Collection previews'],\n beauty: ['Product bundles', 'Tutorial collabs', 'Routine features'],\n fitness: ['Gear packages', 'Challenges', 'Community access'],\n home_lifestyle: ['Makeover features', 'DIY opportunities'],\n pets: ['Product lines', 'Rescue partnerships'],\n parenting: ['Family bundles', 'Community access'],\n food: ['Recipe collabs', 'Kitchen tools']\n };\n perks = nicheMap[niche] || ['Category benefits', 'Collaboration opportunities'];\n action = 'Send niche perk offer';\n }\n else {\n strategy = 'standard_outreach';\n reason = 'Standard customer engagement';\n perks = ['Newsletter', 'Promotions', 'Community', 'Loyalty points'];\n action = 'Add to nurture';\n }\n \n let name = classification.username.replace(/[^a-zA-Z]/g, '') || 'Creator';\n \n results.push({\n json: {\n classification,\n routing: {\n strategy,\n reason,\n recommended_perks: perks,\n next_action: action,\n requires_personalization: (strategy !== 'standard_outreach'),\n priority_level: ['macro', 'mid'].includes(tier) ? 'high' : tier === 'micro' ? 'medium' : 'standard'\n },\n profile_data: {\n customer_name: name,\n niche_subcategory: classification.niche_subcategory,\n content_themes: classification.content_themes,\n username: classification.username,\n engagement_rate: engagement,\n followers,\n bio: classification.audience_demographics || ''\n }\n }\n });\n}\n\nreturn results;"},"typeVersion":2},{"id":"f4a3ee4d-d3db-481f-8230-7b699fef4125","name":"Activation","type":"n8n-nodes-base.code","position":[7120,12784],"parameters":{"jsCode":"const items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const c = item.json.classification || {};\n const r = item.json.routing || {};\n const p = item.json.output?.personalization || item.json.personalization || null;\n\n const tier = (c.tier_name || c.tier || '').toLowerCase();\n const eng = Number(c.engagement_rate || 0);\n const fit = Number(c.brand_fit_score || 0);\n const val = Number(c.value_score || 0);\n\n let level = 'none';\n let actions = [];\n let ambTier = null;\n let out = 'no_activation';\n\n if (['macro', 'mid'].includes(tier) && eng >= 5 && fit >= 8 && val >= 70) {\n level = 'elite_ambassador';\n ambTier = 'Elite';\n out = 'elite';\n actions = ['Welcome package (24hr)', '1-on-1 call', '15% commission', 'Portal access', '$500/mo products', 'Content rights (paid)', 'Private channel'];\n } else if (['micro', 'mid'].includes(tier) && eng >= 4 && fit >= 7 && val >= 60) {\n level = 'core_ambassador';\n ambTier = 'Core';\n out = 'core';\n actions = ['Welcome email', '12% commission', 'Portal access', '$200/mo products', 'Content rights (credit)', 'Community group'];\n } else if (((tier === 'nano' && eng >= 5) || (tier === 'micro' && val >= 75)) && fit >= 7) {\n level = 'rising_star';\n ambTier = 'Rising Star';\n out = 'rising';\n actions = ['Welcome email', '10% referral', 'Quarterly samples', 'Virtual meetups'];\n } else if (r.strategy_type === 'ambassador') {\n level = 'standard_ambassador';\n ambTier = 'Standard';\n out = 'standard';\n actions = ['Welcome email', '8% referral', 'Resources', 'Public events'];\n } else {\n actions = ['Continue standard routing'];\n }\n\n results.push({\n json: {\n classification: c,\n personalization: p,\n activation: {\n level,\n ambassador_tier: ambTier,\n actions,\n routing_output: out\n },\n profile_data: item.json.profile_data || null\n }\n });\n}\n\nreturn results;"},"typeVersion":2},{"id":"2c4a726b-9cde-45a5-9515-56f177b89a4f","name":"Switch","type":"n8n-nodes-base.switch","position":[7568,12752],"parameters":{"mode":"expression","output":"={{ {elite:0,core:1,rising:2,standard:3,no_activation:3}[$json.activation?.routing_output] ?? 3 }}"},"typeVersion":3},{"id":"e98ac0b7-2b1a-4e9e-a51f-3a02c5a93f24","name":"Send Email","type":"n8n-nodes-base.sendGrid","disabled":true,"position":[8368,12784],"parameters":{"subject":"={{ $('Switch').item.json.output?.personalization?.email_subject || 'Partnership Opportunity' }}","toEmail":"={{ $('Extract Data Fields').first().json.email }}","fromName":"Partnership Team","resource":"mail","fromEmail":"user@example.com","contentValue":"={{ $('Switch').first().json.output?.personalization?.email_body || 'Thank you for being a valued customer!' }}","additionalFields":{}},"credentials":{"sendGridApi":{"id":"credential-id","name":"SendGrid account"}},"typeVersion":1},{"id":"940a3172-5e7b-45fd-8529-6a2e873c8504","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[3616,12608],"parameters":{"color":5,"width":360,"height":452,"content":"## STEP 1: Trigger on Contact Created\n\nMonitors Salesforce for newly created contacts and fires immediately. Captures contact ID, email, name, loyalty tier, and other relevant fields for downstream processing."},"typeVersion":1},{"id":"a86fa5c7-d242-4a47-91d1-6064133876b8","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[4000,12608],"parameters":{"color":5,"width":376,"height":452,"content":"## STEP 2: Extract Contact Details\n\nMaps Salesforce contact fields to a clean data object including email address (required for enrichment), name, loyalty tier, lifetime value, and signup date. Provides full context for downstream processing."},"typeVersion":1},{"id":"c9293338-e009-4aac-b81a-65b42d0cc939","name":"Sticky Note18","type":"n8n-nodes-base.stickyNote","position":[6976,12576],"parameters":{"color":4,"width":400,"height":372,"content":"## STEP 8: Ambassador Activation \n\nAssigns creators to tiered programs based on engagement, brand fit, and value: Elite (macro/mid, 5%+ engagement, 15% commission), Core (micro/mid, 4%+ engagement, 12% commission), Rising Star (nano 5%+ or micro 75+ value), Standard (basic program)."},"typeVersion":1},{"id":"be21edf0-7f1b-42cb-b476-6c03cf13caad","name":"Sticky Note19","type":"n8n-nodes-base.stickyNote","position":[7440,12576],"parameters":{"color":4,"width":360,"height":404,"content":"## STEP 9: Route by Tier\n\nSwitch node routes by ambassador tier: Elite (0) → Manual review. Core (1) → Automated monitoring. Rising (2) → Full automation. Standard/None (3) → Pure automation. Each path should get appropriate handling workflow."},"typeVersion":1},{"id":"e82add4c-577a-46c5-8c94-048723869327","name":"Sticky Note20","type":"n8n-nodes-base.stickyNote","position":[7840,12560],"parameters":{"color":5,"width":344,"height":468,"content":"## STEP 10: Update Salesforce CRM\n\nWrites 20+ custom fields to the Salesforce Contact record: creator classification (tier, niche, platform), social metrics (followers, engagement, username), partnership value (scores, themes), ambassador status (tier, activation date), and outreach tracking. Enables segmentation and analytics."},"typeVersion":1},{"id":"12ccba62-8802-47a3-866a-14b3e21b0ad9","name":"Sticky Note21","type":"n8n-nodes-base.stickyNote","position":[8240,12560],"parameters":{"color":4,"width":360,"height":404,"content":"## STEP 11: Send Personalized Email\n\nDelivers AI-generated, tier-appropriate email via SendGrid. Uses real person as sender (not marketing@) for higher open rates. Includes personalized subject, recognition-first body copy, and soft CTA. Tracks opens, clicks, bounces automatically."},"typeVersion":1},{"id":"22f42ff9-5672-46f8-9eb1-427584a1c50a","name":"Merge2","type":"n8n-nodes-base.merge","position":[6784,12672],"parameters":{"mode":"combine","options":{},"combineBy":"combineAll"},"typeVersion":3.2},{"id":"c84702e4-1bb1-420f-bb25-f6d89d218d4d","name":"Sticky Note14","type":"n8n-nodes-base.stickyNote","position":[4864,12048],"parameters":{"color":6,"width":508,"height":1184,"content":"## STEP 5: AI Creator Classification Agent\n\n**What happens here:**\nAI agent analyzes enriched social data and classifies the creator across 8 dimensions for partnership intelligence.\n\n**Classification outputs:**\n\n1. **Primary Platform:** Instagram/TikTok/YouTube/Twitter (highest engagement)\n\n2. **Influencer Tier:** Nano (<10K) | Micro (10K-100K) | Mid (100K-500K) | Macro (500K+)\n\n3. **Niche Detection:** Fashion, Beauty, Fitness, Food, Pets, Parenting, Tech, etc. with specific subcategories (e.g., Muay Thai training, sustainable fashion)\n\n4. **Value Score (0-100):** Calculated from tier + engagement + niche relevance + multi-platform + professional signals\n\n5. **Brand Fit Score (1-10):** Content quality, audience alignment, collaboration signals\n\n6. **Content Themes:** 3-5 specific recurring topics from bio (not just niche)\n\n7. **Audience Demographics:** Inferred gender, age range, interests\n\n8. **Reasoning:** 2-3 sentence explanation of classification decisions\n\n**Example output:**\nTier: Micro | Niche: Fitness > Muay Thai training | Value: 65 | Fit: 8\n\n**Processing time:** 2-4 seconds"},"typeVersion":1},{"id":"1ca2ce20-c288-4aee-9f8f-4a44c48f6ad6","name":"Sticky Note15","type":"n8n-nodes-base.stickyNote","position":[5456,12064],"parameters":{"color":6,"width":500,"height":1168,"content":"## STEP 6: Intelligent Routing Logic\n\n**4 Routing Strategies:**\n\n**Route 1: Ambassador Program**\n- Criteria: Micro/Mid/Macro tier\n- Perks: Discount codes, monthly products, commissions, featured placement, early access\n- Next: Send formal ambassador invitation\n\n**Route 2: Surprise Rewards**\n- Criteria: Nano tier + ≄3% engagement\n- Perks: Gift package, thank-you note, early access, personalized selection\n- Next: Send surprise (no ask required)\n\n**Route 3: Niche-Specific Perks**\n- Criteria: E-commerce niche + ≄1% engagement\n- Perks: Customized by niche (fitness: gear packages, beauty: bundles, fashion: styling sessions, etc.)\n- Next: Send niche perk offer\n\n**Route 4: Standard Outreach**\n- Criteria: All others\n- Perks: Newsletter, promotions, community, loyalty points\n- Next: General nurture sequence\n\n**Output enrichment:**\nAdds routing strategy, reason, perks, next action, priority level to data object"},"typeVersion":1},{"id":"27a7de65-760b-454f-a946-804189c34501","name":"Sticky Note16","type":"n8n-nodes-base.stickyNote","position":[6016,12064],"parameters":{"color":4,"width":668,"height":1156,"content":"## STEP 7: AI-Powered Message Personalization\n\n**Generated content:**\n\n1. **Email Subject:** Contextual, references achievements, avoids marketing language (40-60 chars)\n\n2. **Email Body:** Recognition of content themes, why they align with brand, tier-appropriate perks, soft next step\n\n3. **In-App Message:** Teaser that drives email open\n\n4. **SMS (optional):** High-priority only\n\n5. **Content Hooks:** 3-5 themes for follow-ups\n\n6. **Follow-up Timing:** Recommended wait (7/14/30 days)\n\n**Tone by strategy:**\n- Ambassador: Warm, earned opportunity\n- Surprise: Delight + appreciation\n- Niche Perk: Collaborative, content-first\n\n**Never mentions:**\n- Follower count mechanically\n- Request to post\n- Generic influencer language\n- Collaboration/partnership (too transactional)\n\n"},"typeVersion":1},{"id":"478078a4-c4dc-4d70-9db1-b58862c4335a","name":"Step 2 Header1","type":"n8n-nodes-base.stickyNote","position":[4416,12480],"parameters":{"color":3,"width":376,"height":590,"content":"## STEP 3: Enrich Creator Profile\n\n**API Call to influencers.club**\n- Uses `/public/v1/creators/enrich/email/`\n- Input: Creator email from Salesforce contact\n- Output: Complete main-platform profile\n\n**Configure:**\n1. Add your API key to HTTP Header Auth\n2. Error handling sends to fallback flow"},"typeVersion":1},{"id":"8243b04c-1869-49cd-bb44-8b7764d20b33","name":"OpenAI Classifier Model4","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[4896,13104],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{"temperature":0.3},"builtInTools":{}},"credentials":{"openAiApi":{"id":"credential-id","name":"N8N open AI"}},"typeVersion":1.3},{"id":"3235e9dc-f0dc-459d-ae89-ddbc6b76e9f5","name":"Classification Output Parser4","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[5264,13104],"parameters":{"schemaType":"manual","inputSchema":"{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"CreatorClassification\",\n \"type\": \"object\",\n \"required\": [\"classification\"],\n \"properties\": {\n \"classification\": {\n \"type\": \"object\",\n \"required\": [\"primary_platform\", \"tier\", \"niche\", \"niche_subcategory\", \"value_score\", \"reasoning\"],\n \"properties\": {\n \"primary_platform\": {\n \"type\": \"string\",\n \"enum\": [\"instagram\", \"tiktok\", \"youtube\", \"twitter\"],\n \"description\": \"Platform with highest engagement or most relevant audience\"\n },\n \"tier\": {\n \"type\": \"string\",\n \"enum\": [\"nano\", \"micro\", \"mid\", \"macro\"],\n \"description\": \"Influencer tier based on follower count\"\n },\n \"tier_name\": {\n \"type\": \"string\",\n \"description\": \"Human-readable tier name\"\n },\n \"niche\": {\n \"type\": \"string\",\n \"enum\": [\n \"fashion\",\n \"beauty\",\n \"fitness\",\n \"food\",\n \"home_lifestyle\",\n \"tech\",\n \"parenting\",\n \"travel\",\n \"pets\",\n \"business\",\n \"entertainment\",\n \"education\",\n \"art_photography\",\n \"automotive\",\n \"sports\",\n \"gaming\",\n \"music\",\n \"general\"\n ],\n \"description\": \"Primary content niche\"\n },\n \"niche_name\": {\n \"type\": \"string\",\n \"description\": \"Human-readable niche name\"\n },\n \"niche_subcategory\": {\n \"type\": \"string\",\n \"description\": \"Specific subcategory within niche (e.g., 'sustainable fashion', 'vegan cooking', 'exotic pets')\"\n },\n \"followers\": {\n \"type\": \"integer\",\n \"description\": \"Total follower count from primary platform\"\n },\n \"engagement_rate\": {\n \"type\": \"number\",\n \"description\": \"Engagement rate percentage\"\n },\n \"username\": {\n \"type\": \"string\",\n \"description\": \"Creator's username on primary platform\"\n },\n \"profile_url\": {\n \"type\": \"string\",\n \"description\": \"URL to primary platform profile\"\n },\n \"value_score\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 100,\n \"description\": \"Overall value score for partnership potential (0-100)\"\n },\n \"content_themes\": {\n \"type\": \"array\",\n \"items\": {\"type\": \"string\"},\n \"maxItems\": 5,\n \"description\": \"Key content themes or topics (max 5)\"\n },\n \"audience_demographics\": {\n \"type\": \"string\",\n \"description\": \"Likely audience demographics based on content\"\n },\n \"brand_fit_score\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 10,\n \"description\": \"How well they fit for e-commerce brand partnerships (1-10)\"\n },\n \"reasoning\": {\n \"type\": \"string\",\n \"description\": \"Brief explanation of classification decisions\"\n }\n }\n }\n }\n}\n"},"typeVersion":1.2},{"id":"98c5a6f8-474b-47d9-8f26-e3d4e245832e","name":"AI Creator Classification Agent4","type":"@n8n/n8n-nodes-langchain.agent","position":[5008,12896],"parameters":{"text":"={{ JSON.stringify($json) }}","options":{"systemMessage":"=You are an expert creator classification specialist for e-commerce brands. Your job is to analyze social media profiles and intelligently classify creators for partnership opportunities.\n\nINPUT:\nYou'll receive JSON with:\n- customer_name: First name of the customer\n- platforms: Array of platform objects with { name, followers, engagement, username, bio, url }\n\nYOUR TASK:\n1. Select the PRIMARY platform (highest engagement or most relevant for e-commerce)\n2. Classify influencer TIER based strictly on follower count\n3. Detect creator NICHE with nuance and subcategories\n4. Calculate VALUE SCORE for partnership potential\n5. Assign BRAND FIT SCORE (1–10)\n6. Extract 3–5 CONTENT THEMES\n7. Infer AUDIENCE DEMOGRAPHICS\n8. Provide clear REASONING\n\nOUTPUT MUST BE VALID JSON ONLY (no markdown, no extra text)\n\n--------------------------------------------------\n## PRIMARY PLATFORM SELECTION\n\n- Prioritize platform with HIGHEST engagement rate\n- If engagement rates are similar, prefer:\n Instagram > TikTok > YouTube > Twitter\n- For e-commerce, Instagram and TikTok are most valuable\n\n--------------------------------------------------\n## TIER CLASSIFICATION RULES\n\nFollower Count → Tier\n\n- < 10,000 → \"nano\" (Tier Name: \"Nano\")\n- 10,000 – 99,999 → \"micro\" (Tier Name: \"Micro\")\n- 100,000 – 499,999 → \"mid\" (Tier Name: \"Mid\")\n- 500,000+ → \"macro\" (Tier Name: \"Macro\")\n\n--------------------------------------------------\n## STRICT TIER ENFORCEMENT (MANDATORY)\n\nYou MUST classify influencer tier strictly using follower count and ONLY the ranges above.\n\nDo NOT use general influencer assumptions.\nDo NOT approximate.\nDo NOT override numeric mapping.\n\nBefore returning JSON:\n1. Verify follower count.\n2. Verify tier matches numeric range.\n3. If mismatch exists, correct it before output.\n\nExample:\nFollowers: 140,703\nCorrect Tier: \"mid\"\nNOT \"macro\"\n\n--------------------------------------------------\n## NICHE CLASSIFICATION (BE NUANCED)\n\nDetect primary niche and subcategory using bio signals and context.\n\nMajor Niches:\nFashion\nBeauty\nFitness\nFood\nHome/Lifestyle\nTech/Gadgets\nParenting\nTravel\nPets\nBusiness/Entrepreneur\nEntertainment\nEducation\nArt/Photography\nAutomotive\nSports\nGaming\nMusic\nGeneral (fallback only if truly unclear)\n\nUse specific subcategories when possible.\nExample: \"Muay Thai training\" not just \"fitness\"\nExample: \"sustainable fashion\" not just \"fashion\"\n\n--------------------------------------------------\n## VALUE SCORE CALCULATION (0–100)\n\nBase score by tier:\n- Nano: 10\n- Micro: 20\n- Mid: 30\n- Macro: 40\n\nEngagement bonus:\n- > 5% → +15\n- 3–5% → +10\n- 1–3% → +5\n- < 1% → +0\n\nNiche relevance for e-commerce (+10):\nFashion, Beauty, Fitness, Home/Lifestyle, Pets, Parenting, Food\n\nMulti-platform presence:\n- 2+ platforms → +5\n- 3+ platforms → +10\n\nProfessional signals in bio:\nBrand mentions, UGC, collaborations, media kit → +5\n\nCap at 100.\n\n--------------------------------------------------\n## BRAND FIT SCORE (1–10)\n\nConsider:\n- Content professionalism\n- Audience alignment with e-commerce\n- Collaboration signals\n- Authenticity vs spam\n\nScoring:\n1–3 = Poor fit\n4–6 = Moderate fit\n7–8 = Good fit\n9–10 = Excellent fit\n\n--------------------------------------------------\n## CONTENT THEMES\n\nExtract 3–5 specific recurring themes from bio or platform description.\n\nDo NOT just repeat the niche.\nBe specific.\n\nExample:\n- \"Muay Thai training\"\n- \"Thai boxing techniques\"\n- \"Gym motivation\"\n- \"Athlete empowerment\"\n\n--------------------------------------------------\n## AUDIENCE DEMOGRAPHICS\n\nInfer likely audience based on:\n- Platform\n- Niche\n- Bio tone\n- Engagement style\n\nFormat:\n\"Primarily [gender] aged [range], interested in [topics]\"\n\nExample:\n\"Primarily male aged 18–35, interested in martial arts and performance training\"\n\n--------------------------------------------------\n## REASONING\n\nProvide 2–3 sentences explaining:\n1. Why you chose the niche/subcategory\n2. Why you assigned the tier\n3. Why the value score and brand fit score make sense\n\nBe concise and analytical.\n\n--------------------------------------------------\n## OUTPUT FORMAT (STRICT JSON ONLY)\n\n{\n \"classification\": {\n \"primary_platform\": \"instagram\",\n \"tier\": \"mid\",\n \"tier_name\": \"Mid\",\n \"niche\": \"fitness\",\n \"niche_name\": \"Fitness\",\n \"niche_subcategory\": \"Muay Thai training\",\n \"followers\": 140703,\n \"engagement_rate\": 9.4,\n \"username\": \"tagmuaythai\",\n \"profile_url\": \"https://instagram.com/tagmuaythai\",\n \"value_score\": 65,\n \"content_themes\": [\"Muay Thai training\", \"gym motivation\", \"Thai boxing drills\"],\n \"audience_demographics\": \"Primarily male aged 18–35, interested in martial arts and performance training\",\n \"brand_fit_score\": 9,\n \"reasoning\": \"Classified as Muay Thai training within the fitness niche based on bio signals. Mid-tier due to 140K followers per strict range rules. Strong engagement (9.4%) and high brand alignment produce strong partnership value.\"\n }\n}"},"promptType":"define","hasOutputParser":true},"typeVersion":3.1},{"id":"e11d12e7-7918-4f0e-9f5b-c78909fd8170","name":"Classification Output Parser5","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[6496,13088],"parameters":{"schemaType":"manual","inputSchema":"{\n \"type\": \"object\",\n \"properties\": {\n \"personalization\": {\n \"type\": \"object\",\n \"properties\": {\n \"email_subject\": {\"type\": \"string\"},\n \"email_body\": {\"type\": \"string\"},\n \"in_app_message\": {\"type\": \"string\"},\n \"sms_message\": {\"type\": [\"string\", \"null\"]},\n \"personalization_notes\": {\"type\": \"string\"},\n \"follow_up_timing\": {\"type\": \"string\"},\n \"content_hooks\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}}\n },\n \"required\": [\"email_subject\", \"email_body\", \"in_app_message\", \"sms_message\", \"personalization_notes\", \"follow_up_timing\", \"content_hooks\"]\n }\n },\n \"required\": [\"personalization\"]\n}"},"typeVersion":1.2},{"id":"12232300-d95d-4c1f-83a1-29741aa73c33","name":"AI Creator Classification Agent5","type":"@n8n/n8n-nodes-langchain.agent","position":[6240,12880],"parameters":{"text":"={{ JSON.stringify($json) }}","options":{"systemMessage":"=You are a loyalty personalization specialist. Generate authentic messages that make creators feel SEEN, not sold.\n\nPRINCIPLES: Recognition>Request | Give>Ask | Authentic>Automated\n\nLENGTH (STRICT): Email 70-140 words | In-app <120 chars | SMS <140 chars | Rewrite if exceeded\n\nRULES: Never use generic templates. Never say influencer. Natural tone. Specific content themes. No posting requests.\n\nSTRATEGY TONES:\nAmbassador: Warm, earned opportunity\nSurprise: Delight + appreciation, zero expectations\nNiche: Collaborative, content-first\n\nOUTPUT: Valid JSON only, no markdown."},"promptType":"define","hasOutputParser":true},"typeVersion":3.1},{"id":"82f1c5f3-e712-4d98-9cbc-de2cae13b96c","name":"OpenAI Classifier Model5","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[6112,13088],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{"temperature":0.3},"builtInTools":{}},"credentials":{"openAiApi":{"id":"credential-id","name":"N8N open AI"}},"typeVersion":1.3},{"id":"1678c299-8137-44a7-9a36-f1fce067b33f","name":"Extract Data Fields","type":"n8n-nodes-base.set","position":[4144,12896],"parameters":{"options":{},"assignments":{"assignments":[{"id":"1","name":"email","type":"string","value":"={{ $json.Email }}"},{"id":"2","name":"member_name","type":"string","value":"={{ $json.FirstName }} {{ $json.LastName }}"},{"id":"3","name":"loyalty_tier","type":"string","value":"={{ $json.Loyalty_Tier__c }}"},{"id":"4","name":"lifetime_value","type":"number","value":"={{ $json.Lifetime_Value__c }}"},{"id":"5","name":"signup_date","type":"string","value":"={{ $json.CreatedDate }}"}]}},"typeVersion":3.4},{"id":"a3725467-64c9-4172-9737-bb72659eb252","name":"Salesforce Trigger","type":"n8n-nodes-base.salesforceTrigger","position":[3776,12896],"parameters":{"pollTimes":{"item":[{"mode":"everyMinute"}]},"triggerOn":"contactCreated"},"typeVersion":1},{"id":"0ff1e88d-b4b7-4873-8fd6-bde5bf406149","name":"Update a contact","type":"n8n-nodes-base.salesforce","position":[7952,12848],"parameters":{"resource":"contact","contactId":"={{ $('Salesforce Trigger').first().json.Id }}","operation":"update","updateFields":{"customFieldsUi":{"customFieldsValues":[{"value":"={{ $json.activation?.level !== 'none' }}","fieldId":"Is_Creator__c"},{"value":"={{ $json.classification?.tier_name || '' }}","fieldId":"Creator_Tier__c"},{"value":"={{ $json.classification?.niche_name || '' }}","fieldId":"Creator_Niche__c"},{"value":"={{ $json.classification?.niche_subcategory || '' }}","fieldId":"Creator_Subcategory__c"},{"value":"={{ $json.classification?.primary_platform || '' }}","fieldId":"Primary_Platform__c"},{"value":"={{ $json.classification?.followers || 0 }}","fieldId":"Follower_Count__c"},{"value":"={{ $json.classification?.engagement_rate || 0 }}","fieldId":"Engagement_Rate__c"},{"value":"={{ $json.classification?.username || '' }}","fieldId":"Social_Username__c"},{"value":"={{ $json.classification?.profile_url || '' }}","fieldId":"Profile_URL__c"},{"value":"={{ $json.classification?.value_score || 0 }}","fieldId":"Value_Score__c"},{"value":"={{ $json.classification?.brand_fit_score || 0 }}","fieldId":"Brand_Fit_Score__c"},{"value":"={{ ($json.classification?.content_themes || []).join(', ') }}","fieldId":"Content_Themes__c"},{"value":"={{ $json.classification?.audience_demographics || '' }}","fieldId":"Audience_Demographics__c"},{"value":"={{ $json.activation?.ambassador_tier || '' }}","fieldId":"Ambassador_Tier__c"},{"value":"={{ $json.activation?.level || '' }}","fieldId":"Activation_Level__c"},{"value":"={{ $now.toISO() }}","fieldId":"Activation_Date__c"},{"value":"={{ ($json.activation?.actions || []).join(', ') }}","fieldId":"Next_Activation_Action__c"},{"value":"={{ $json.classification?.routing?.strategy || '' }}","fieldId":"Outreach_Strategy__c"},{"value":"={{ $now.toISO() }}","fieldId":"Outreach_Sent_Date__c"}]}}},"typeVersion":1},{"id":"86c4ad7a-6b5c-4160-b4d6-f39861ba35ac","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[5536,11520],"parameters":{"width":752,"content":"## Find and activate creators inside your loyalty program\n**Step by step workflow to enrich loyalty programme customers emails on Salesforce with multi social (Instagram, Tiktok, Youtube, Twitter, Onlyfans, Twitch and more) and launch personalized emails using the influencer.club API and SendGrid**. [Full explanation](https://influencers.club/creatorbook/find-creators-inside-loyalty-program/)"},"typeVersion":1},{"id":"f7c02ff5-f991-47f5-a2d4-b51364cb2c5d","name":"Enrich by Email","type":"n8n-nodes-influencersclub.influencersClub","position":[4560,12896],"parameters":{"email":"={{ $json.email }}"},"credentials":{"influencersClubApi":{"id":"credential-id","name":"Influencers Club - Gjorgji"}},"typeVersion":1}],"active":false,"pinData":{},"settings":{"binaryMode":"separate","availableInMCP":false,"executionOrder":"v1"},"versionId":"2ecb09fe-f060-4e82-aace-919f2dbd3ce8","connections":{"Merge2":{"main":[[{"node":"Activation","type":"main","index":0}]]},"Switch":{"main":[[{"node":"Update a contact","type":"main","index":0}],[{"node":"Update a contact","type":"main","index":0}],[{"node":"Update a contact","type":"main","index":0}],[{"node":"Update a contact","type":"main","index":0}]]},"Activation":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Route Logic":{"main":[[{"node":"AI Creator Classification Agent5","type":"main","index":0},{"node":"Merge2","type":"main","index":0}]]},"Enrich by Email":{"main":[[{"node":"AI Creator Classification Agent4","type":"main","index":0}]]},"Update a contact":{"main":[[{"node":"Send Email","type":"main","index":0}]]},"Salesforce Trigger":{"main":[[{"node":"Extract Data Fields","type":"main","index":0}]]},"Extract Data Fields":{"main":[[{"node":"Enrich by Email","type":"main","index":0}]]},"OpenAI Classifier Model4":{"ai_languageModel":[[{"node":"AI Creator Classification Agent4","type":"ai_languageModel","index":0}]]},"OpenAI Classifier Model5":{"ai_languageModel":[[{"node":"AI Creator Classification Agent5","type":"ai_languageModel","index":0}]]},"Classification Output Parser4":{"ai_outputParser":[[{"node":"AI Creator Classification Agent4","type":"ai_outputParser","index":0}]]},"Classification Output Parser5":{"ai_outputParser":[[{"node":"AI Creator Classification Agent5","type":"ai_outputParser","index":0}]]},"AI Creator Classification Agent4":{"main":[[{"node":"Route Logic","type":"main","index":0}]]},"AI Creator Classification Agent5":{"main":[[{"node":"Merge2","type":"main","index":1}]]}}} \ No newline at end of file