0% found this document useful (0 votes)
190 views8 pages

n8n-workflow

The document outlines an automated workflow for fashion brand outreach using n8n, which includes steps for setting a website URL, retrieving content, analyzing it with AI, and finding contact emails. It processes the AI responses to compile brand information and generates a personalized outreach email template. Finally, the enriched data is saved to Google Sheets for tracking purposes.

Uploaded by

dmytropinchuk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views8 pages

n8n-workflow

The document outlines an automated workflow for fashion brand outreach using n8n, which includes steps for setting a website URL, retrieving content, analyzing it with AI, and finding contact emails. It processes the AI responses to compile brand information and generates a personalized outreach email template. Finally, the enriched data is saved to Google Sheets for tracking purposes.

Uploaded by

dmytropinchuk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

{

"name": "Fashion Brand Outreach Automation",


"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
240,
300
],
"id": "1a699f65-0c8f-4574-8b36-3af349c38612"
},
{
"parameters": {
"values": {
"string": [
{
"name": "websiteUrl",
"value": "={{ $json.websiteUrl }}"
}
]
},
"options": {}
},
"name": "Set Website URL",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
420,
300
],
"id": "9c8bb878-d73d-4f57-ba42-f23238bc3999"
},
{
"parameters": {
"url": "={{ $json.websiteUrl }}",
"options": {
"timeout": 30000
}
},
"name": "Get Website Content",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
620,
300
],
"id": "b0a0b0a7-a0a1-4a0a-b0a0-a0a0b0a0a0a0"
},
{
"parameters": {
"authentication": "predefinedCredentialType",
"nodeCredentialType": "openAiApi",
"operation": "completion",
"options": {
"model": "gpt-4",
"maxTokens": 1000,
"temperature": 0.7
},
"prompt": "You are a fashion marketing expert. Analyze this fashion brand
website content:\n\n{{ $json.data }}\n\nExtract the following information:\n1.
Brand name\n2. Three most popular products they sell (with specific names if
possible)\n3. Brand style/aesthetic in 1-2 sentences\n4. Target audience\n5.
Anything unique about the brand\n\nFormat your response as a valid JSON object with
these keys: brandName, popularProducts (array), brandStyle, targetAudience,
uniqueSellingPoints"
},
"name": "Analyze Website with AI",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1,
"position": [
820,
300
],
"id": "5f5f5f5f-5f5f-5f5f-5f5f-5f5f5f5f5f5f"
},
{
"parameters": {
"jsCode": "// Parse AI response to JSON\nlet aiResponse;\ntry {\n
aiResponse = JSON.parse($json.text);\n} catch (error) {\n // Extract JSON if the
AI didn't format it properly\n const jsonMatch = $json.text.match(/\\{[\\s\\
S]*\\}/);\n if (jsonMatch) {\n try {\n aiResponse =
JSON.parse(jsonMatch[0]);\n } catch (e) {\n aiResponse = {\n error:
'Could not parse AI response',\n raw: $json.text\n };\n }\n } else
{\n aiResponse = {\n error: 'Could not parse AI response',\n raw:
$json.text\n };\n }\n}\n\n// Extract domain from URL\nconst url = $node[\"Set
Website URL\"].json.websiteUrl;\nlet domain = url.replace(/^https?:\\/\\//, '');\
ndomain = domain.replace(/^www\\./, '');\ndomain = domain.split('/')[0];\n\n// Add
domain to the response\naiResponse.domain = domain;\n\n// Return the enriched data\
nreturn {\n json: aiResponse\n};"
},
"name": "Process AI Response",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
1020,
300
],
"id": "4a4a4a4a-4a4a-4a4a-4a4a-4a4a4a4a4a4a"
},
{
"parameters": {
"url": "https://api.prospeo.io/domain-search",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"httpHeaderAuth": {
"name": "X-KEY",
"value": "={{ $credentials.prospeoApi }}"
},
"method": "POST",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "domain",
"value": "={{ $json.domain }}"
}
]
},
"options": {}
},
"name": "Find Emails with Prospeo",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1220,
300
],
"id": "3a3a3a3a-3a3a-3a3a-3a3a-3a3a3a3a3a3a"
},
{
"parameters": {
"authentication": "predefinedCredentialType",
"nodeCredentialType": "openAiApi",
"operation": "completion",
"options": {
"model": "gpt-4",
"maxTokens": 1000,
"temperature": 0.7
},
"prompt": "You're an expert at email validation. Analyze these emails found
for the fashion brand {{ $json.brandName }}:\n\n{{ $json.emails }}\n\nSelect the
most appropriate email to contact. Prioritize in this order:\n1. Founder/CEO/Owner
emails (names of actual people)\n2. Partnership/collab specific emails\n3. Generic
contact emails like contact@domain.com \n4. Info emails as last resort\n\nFor the
selected email, explain why it's the best choice.\n\nFormat your response as a JSON
object with these keys: bestEmail, reasoning"
},
"name": "Analyze Emails with AI",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1,
"position": [
1420,
300
],
"id": "2b2b2b2b-2b2b-2b2b-2b2b-2b2b2b2b2b2b"
},
{
"parameters": {
"jsCode": "// Process Prospeo response\nconst prospeoData = $json;\n\n//
Process domain info from previous node\nconst brandInfo = $node[\"Process AI
Response\"].json;\n\n// Parse AI email analysis response to JSON\nlet
emailAnalysis;\ntry {\n emailAnalysis = JSON.parse($json.text);\n} catch (error)
{\n // Extract JSON if the AI didn't format it properly\n const jsonMatch =
$json.text.match(/\\{[\\s\\S]*\\}/);\n if (jsonMatch) {\n try {\n
emailAnalysis = JSON.parse(jsonMatch[0]);\n } catch (e) {\n emailAnalysis =
{\n bestEmail: prospeoData.response && prospeoData.response.emails &&
prospeoData.response.emails.length > 0 ? prospeoData.response.emails[0].email : 'No
email found',\n reasoning: 'AI could not analyze emails properly. Using
first available email.'\n };\n }\n } else {\n emailAnalysis = {\n
bestEmail: prospeoData.response && prospeoData.response.emails &&
prospeoData.response.emails.length > 0 ? prospeoData.response.emails[0].email : 'No
email found',\n reasoning: 'AI could not analyze emails properly. Using first
available email.'\n };\n }\n}\n\n// Compile final output with all the enriched
data\nconst finalOutput = {\n websiteUrl: $node[\"Set Website
URL\"].json.websiteUrl,\n domain: brandInfo.domain,\n brandName:
brandInfo.brandName,\n popularProducts: brandInfo.popularProducts,\n brandStyle:
brandInfo.brandStyle,\n targetAudience: brandInfo.targetAudience,\n
uniqueSellingPoints: brandInfo.uniqueSellingPoints,\n bestContactEmail:
emailAnalysis.bestEmail,\n emailReasoning: emailAnalysis.reasoning,\n allEmails:
prospeoData.response && prospeoData.response.emails ? prospeoData.response.emails :
[],\n timestamp: new Date().toISOString()\n};\n\nreturn {\n json: finalOutput\
n};"
},
"name": "Compile Final Data",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
1620,
300
],
"id": "7c7c7c7c-7c7c-7c7c-7c7c-7c7c7c7c7c7c"
},
{
"parameters": {
"authentication": "predefinedCredentialType",
"nodeCredentialType": "openAiApi",
"operation": "completion",
"options": {
"model": "gpt-4",
"maxTokens": 1500,
"temperature": 0.7
},
"prompt": "Create a personalized outreach email template for an influencer
collaboration opportunity with this fashion brand. Use the following details for
personalization:\n\nBrand name: {{ $json.brandName }}\nPopular products:
{{ $json.popularProducts }}\nBrand style: {{ $json.brandStyle }}\nTarget audience:
{{ $json.targetAudience }}\nUnique selling points: {{ $json.uniqueSellingPoints }}\
n\nMake the email friendly but professional. It should mention specific products
and why an influencer collaboration would be beneficial. Keep it under 200 words.
Format the email as a JSON object with these keys: subject, body"
},
"name": "Generate Email Template",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1,
"position": [
1820,
300
],
"id": "8d8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d"
},
{
"parameters": {
"jsCode": "// Parse the email template response\nlet emailTemplate;\ntry {\
n emailTemplate = JSON.parse($json.text);\n} catch (error) {\n // Extract JSON if
the AI didn't format it properly\n const jsonMatch = $json.text.match(/\\{[\\s\\
S]*\\}/);\n if (jsonMatch) {\n try {\n emailTemplate =
JSON.parse(jsonMatch[0]);\n } catch (e) {\n emailTemplate = {\n
subject: 'Influencer Collaboration Opportunity',\n body: 'Could not generate
email template. Please check the AI response.'\n };\n }\n } else {\n
emailTemplate = {\n subject: 'Influencer Collaboration Opportunity',\n
body: 'Could not generate email template. Please check the AI response.'\n };\n
}\n}\n\n// Compile the final data with the email template\nconst compiledData =
$node[\"Compile Final Data\"].json;\ncompiledData.emailSubject =
emailTemplate.subject;\ncompiledData.emailBody = emailTemplate.body;\n\nreturn {\n
json: compiledData\n};"
},
"name": "Process Email Template",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
2020,
300
],
"id": "9e9e9e9e-9e9e-9e9e-9e9e-9e9e9e9e9e9e"
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_SPREADSHEET_ID_HERE"
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Outreach Data"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"mappingMode": "defineBelow",
"value": [
{
"column": "Date",
"value": "={{ $json.timestamp }}"
},
{
"column": "Website URL",
"value": "={{ $json.websiteUrl }}"
},
{
"column": "Brand Name",
"value": "={{ $json.brandName }}"
},
{
"column": "Popular Products",
"value": "={{ $json.popularProducts.join(\", \") }}"
},
{
"column": "Brand Style",
"value": "={{ $json.brandStyle }}"
},
{
"column": "Target Audience",
"value": "={{ $json.targetAudience }}"
},
{
"column": "Unique Selling Points",
"value": "={{ $json.uniqueSellingPoints }}"
},
{
"column": "Best Contact Email",
"value": "={{ $json.bestContactEmail }}"
},
{
"column": "Email Reasoning",
"value": "={{ $json.emailReasoning }}"
},
{
"column": "Email Subject",
"value": "={{ $json.emailSubject }}"
},
{
"column": "Email Body",
"value": "={{ $json.emailBody }}"
}
]
}
},
"options": {}
},
"name": "Save to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 3,
"position": [
2220,
300
],
"id": "0f0f0f0f-0f0f-0f0f-0f0f-0f0f0f0f0f0f"
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Set Website URL",
"type": "main",
"index": 0
}
]
]
},
"Set Website URL": {
"main": [
[
{
"node": "Get Website Content",
"type": "main",
"index": 0
}
]
]
},
"Get Website Content": {
"main": [
[
{
"node": "Analyze Website with AI",
"type": "main",
"index": 0
}
]
]
},
"Analyze Website with AI": {
"main": [
[
{
"node": "Process AI Response",
"type": "main",
"index": 0
}
]
]
},
"Process AI Response": {
"main": [
[
{
"node": "Find Emails with Prospecto",
"type": "main",
"index": 0
}
]
]
},
"Find Emails with Prospecto": {
"main": [
[
{
"node": "Analyze Emails with AI",
"type": "main",
"index": 0
}
]
]
},
"Analyze Emails with AI": {
"main": [
[
{
"node": "Compile Final Data",
"type": "main",
"index": 0
}
]
]
},
"Compile Final Data": {
"main": [
[
{
"node": "Generate Email Template",
"type": "main",
"index": 0
}
]
]
},
"Generate Email Template": {
"main": [
[
{
"node": "Process Email Template",
"type": "main",
"index": 0
}
]
]
},
"Process Email Template": {
"main": [
[
{
"node": "Save to Google Sheets",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"tags": [
{
"name": "outreach"
},
{
"name": "marketing"
},
{
"name": "ai"
}
],
"pinData": {}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy