0% found this document useful (0 votes)
798 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)
798 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

{

"name": "Fashion Brand Outreach Automation",


"nodes": [
{
"parameters": {},
"name": "Start",
"type": "[Link]",
"typeVersion": 1,
"position": [
240,
300
],
"id": "1a699f65-0c8f-4574-8b36-3af349c38612"
},
{
"parameters": {
"values": {
"string": [
{
"name": "websiteUrl",
"value": "={{ $[Link] }}"
}
]
},
"options": {}
},
"name": "Set Website URL",
"type": "[Link]",
"typeVersion": 1,
"position": [
420,
300
],
"id": "9c8bb878-d73d-4f57-ba42-f23238bc3999"
},
{
"parameters": {
"url": "={{ $[Link] }}",
"options": {
"timeout": 30000
}
},
"name": "Get Website Content",
"type": "[Link]",
"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{{ $[Link] }}\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": "[Link]",
"typeVersion": 1,
"position": [
820,
300
],
"id": "5f5f5f5f-5f5f-5f5f-5f5f-5f5f5f5f5f5f"
},
{
"parameters": {
"jsCode": "// Parse AI response to JSON\nlet aiResponse;\ntry {\n
aiResponse = [Link]($[Link]);\n} catch (error) {\n // Extract JSON if the
AI didn't format it properly\n const jsonMatch = $[Link](/\\{[\\s\\
S]*\\}/);\n if (jsonMatch) {\n try {\n aiResponse =
[Link](jsonMatch[0]);\n } catch (e) {\n aiResponse = {\n error:
'Could not parse AI response',\n raw: $[Link]\n };\n }\n } else
{\n aiResponse = {\n error: 'Could not parse AI response',\n raw:
$[Link]\n };\n }\n}\n\n// Extract domain from URL\nconst url = $node[\"Set
Website URL\"].[Link];\nlet domain = [Link](/^https?:\\/\\//, '');\
ndomain = [Link](/^www\\./, '');\ndomain = [Link]('/')[0];\n\n// Add
domain to the response\[Link] = domain;\n\n// Return the enriched data\
nreturn {\n json: aiResponse\n};"
},
"name": "Process AI Response",
"type": "[Link]",
"typeVersion": 1,
"position": [
1020,
300
],
"id": "4a4a4a4a-4a4a-4a4a-4a4a-4a4a4a4a4a4a"
},
{
"parameters": {
"url": "[Link]
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"httpHeaderAuth": {
"name": "X-KEY",
"value": "={{ $[Link] }}"
},
"method": "POST",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "domain",
"value": "={{ $[Link] }}"
}
]
},
"options": {}
},
"name": "Find Emails with Prospeo",
"type": "[Link]",
"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 {{ $[Link] }}:\n\n{{ $[Link] }}\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@[Link] \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": "[Link]",
"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 = [Link]($[Link]);\n} catch (error)
{\n // Extract JSON if the AI didn't format it properly\n const jsonMatch =
$[Link](/\\{[\\s\\S]*\\}/);\n if (jsonMatch) {\n try {\n
emailAnalysis = [Link](jsonMatch[0]);\n } catch (e) {\n emailAnalysis =
{\n bestEmail: [Link] && [Link] &&
[Link] > 0 ? [Link][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: [Link] && [Link] &&
[Link] > 0 ? [Link][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\"].[Link],\n domain: [Link],\n brandName:
[Link],\n popularProducts: [Link],\n brandStyle:
[Link],\n targetAudience: [Link],\n
uniqueSellingPoints: [Link],\n bestContactEmail:
[Link],\n emailReasoning: [Link],\n allEmails:
[Link] && [Link] ? [Link] :
[],\n timestamp: new Date().toISOString()\n};\n\nreturn {\n json: finalOutput\
n};"
},
"name": "Compile Final Data",
"type": "[Link]",
"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: {{ $[Link] }}\nPopular products:
{{ $[Link] }}\nBrand style: {{ $[Link] }}\nTarget audience:
{{ $[Link] }}\nUnique selling points: {{ $[Link] }}\
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": "[Link]",
"typeVersion": 1,
"position": [
1820,
300
],
"id": "8d8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d"
},
{
"parameters": {
"jsCode": "// Parse the email template response\nlet emailTemplate;\ntry {\
n emailTemplate = [Link]($[Link]);\n} catch (error) {\n // Extract JSON if
the AI didn't format it properly\n const jsonMatch = $[Link](/\\{[\\s\\
S]*\\}/);\n if (jsonMatch) {\n try {\n emailTemplate =
[Link](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;\[Link] =
[Link];\[Link] = [Link];\n\nreturn {\n
json: compiledData\n};"
},
"name": "Process Email Template",
"type": "[Link]",
"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": "={{ $[Link] }}"
},
{
"column": "Website URL",
"value": "={{ $[Link] }}"
},
{
"column": "Brand Name",
"value": "={{ $[Link] }}"
},
{
"column": "Popular Products",
"value": "={{ $[Link](\", \") }}"
},
{
"column": "Brand Style",
"value": "={{ $[Link] }}"
},
{
"column": "Target Audience",
"value": "={{ $[Link] }}"
},
{
"column": "Unique Selling Points",
"value": "={{ $[Link] }}"
},
{
"column": "Best Contact Email",
"value": "={{ $[Link] }}"
},
{
"column": "Email Reasoning",
"value": "={{ $[Link] }}"
},
{
"column": "Email Subject",
"value": "={{ $[Link] }}"
},
{
"column": "Email Body",
"value": "={{ $[Link] }}"
}
]
}
},
"options": {}
},
"name": "Save to Google Sheets",
"type": "[Link]",
"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