This workflow corresponds to n8n.io template #12620 — we link there as the canonical source.
This workflow follows the Gmail → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "lOjrv5FMUcjl813N",
"name": "Sponsor-Package Matching Agent",
"tags": [],
"nodes": [
{
"id": "6eb9a11e-7e74-41e1-8d0f-0edaf2d9037d",
"name": "Set Workflow Variables",
"type": "n8n-nodes-base.set",
"position": [
-18224,
2672
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "sponsorsSheetId",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Google Sheets ID for Sponsors sheet__>"
},
{
"id": "id-2",
"name": "packagesSheetId",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Google Sheets ID for Packages sheet__>"
},
{
"id": "id-3",
"name": "logSheetId",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Google Sheets ID for Match Log sheet__>"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "8f06ecd8-3a1c-4202-810f-21bf3e6d0bea",
"name": "Fetch Sponsors Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
-17888,
2592
],
"parameters": {
"options": {
"returnFirstMatch": false
},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Sponsors"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set Workflow Variables').first().json.sponsorsSheetId }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "18785402-bec0-4dcb-9d73-46babc60200b",
"name": "Fetch Packages Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
-17888,
2752
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Packages"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set Workflow Variables').first().json.packagesSheetId }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "31f792d9-48ac-4c4e-9862-a50d2cd3ce3f",
"name": "Aggregate Packages",
"type": "n8n-nodes-base.aggregate",
"position": [
-17664,
2752
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "allPackages"
},
"typeVersion": 1
},
{
"id": "51d3e91d-5de0-4036-beec-446df55ac27c",
"name": "Match Packages with GPT-4o",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-17104,
2576
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {},
"responses": {
"values": [
{
"content": "=You are an AI sponsor-package matching assistant.\n\nYour task is to analyze the sponsor details and recommend the top 1-3 most suitable sponsorship packages from the available options.\n\nSponsor Details:\n- Name: {{ $json.SponsorName }}\n- Industry: {{ $json.Industry }}\n- Budget: {{ $json.Budget }}\n- Goals: {{ $json.Goals }}\n- Notes: {{ $json.Notes }}\n\nAvailable Packages:\n{{ $json.allPackages }}\n\nFor each recommended package, provide:\n1. Package name\n2. Match score (0-100)\n3. Brief reason why it fits\n\nReturn your response as valid JSON in this exact format:\n{\n \"recommendations\": [\n {\n \"packageName\": \"Package Name\",\n \"score\": 95,\n \"reason\": \"Brief explanation\"\n }\n ],\n \"summaryText\": \"A brief summary paragraph explaining the overall recommendation strategy for this sponsor.\"\n}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "faa82b3c-0c36-4fff-aa09-686c5a6b3563",
"name": "Parse AI Response",
"type": "n8n-nodes-base.set",
"position": [
-16848,
2576
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "aiResponse",
"type": "object",
"value": "={{ JSON.parse($json.message.content) }}"
},
{
"id": "id-2",
"name": "topPackage",
"type": "string",
"value": "={{ JSON.parse($json.message.content).recommendations[0].packageName }}"
},
{
"id": "id-3",
"name": "topScore",
"type": "number",
"value": "={{ JSON.parse($json.message.content).recommendations[0].score }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "e3753ec4-9b72-40ac-8673-500592de848d",
"name": "Log Results to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
-16240,
2752
],
"parameters": {
"columns": {
"value": {
"TopScore": "={{ $json.matchScore }}",
"Timestamp": "={{ $now.toISO() }}",
"SponsorName": "={{ $json.SponsorName }}",
"RecommendedPackages": "={{ $json.topMatches.map(m => m.packageName).join(', ') }}"
},
"schema": [
{
"id": "SponsorName",
"required": false,
"displayName": "SponsorName",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "RecommendedPackages",
"required": false,
"displayName": "RecommendedPackages",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "TopScore",
"required": false,
"displayName": "TopScore",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Timestamp",
"required": false,
"displayName": "Timestamp",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"SponsorName",
"RecommendedPackages",
"TopScore",
"Timestamp"
]
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "MatchLog"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set Workflow Variables').first().json.logSheetId }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "79ee6bbd-eb21-41b6-88a4-10bb1aeed81d",
"name": "Loop Over Sponsors",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-17664,
2592
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "64bff306-38a1-4590-ba1c-10f7c52b7fdf",
"name": "Merge Sponsor with Packages",
"type": "n8n-nodes-base.merge",
"position": [
-17472,
2592
],
"parameters": {
"mode": "combine",
"options": {
"includeUnpaired": true
},
"combineBy": "combineByPosition"
},
"typeVersion": 3.2
},
{
"id": "75f69710-4ba6-4e8c-9e45-d595c2f57719",
"name": "Prepare AI Context",
"type": "n8n-nodes-base.set",
"position": [
-17232,
2576
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "allPackages",
"type": "string",
"value": "={{ $input.last().json.allPackages }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "bdcabb00-e7cf-44e0-938f-4af7358366c6",
"name": "Extract Top Match Rankings",
"type": "n8n-nodes-base.code",
"position": [
-16640,
2576
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "const aiOutput = $json.message?.content || $json.aiResponse;\nlet matches;\n\ntry {\n matches = typeof aiOutput === 'string' ? JSON.parse(aiOutput) : aiOutput;\n} catch (e) {\n matches = { recommendations: [] };\n}\n\nconst topMatches = matches.recommendations?.slice(0, 3) || [];\nconst bestPackage = topMatches[0] || {};\nconst matchScore = bestPackage.score || 0;\n\nreturn {\n json: {\n ...$json,\n topMatches,\n bestPackage,\n matchScore,\n aiResponse: matches\n }\n};"
},
"typeVersion": 2
},
{
"id": "7df7df3a-1bf8-4a5c-b30f-348216162a9d",
"name": "If Match Score \u2265 70",
"type": "n8n-nodes-base.if",
"position": [
-16496,
2576
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "id-1",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.matchScore }}",
"rightValue": "70"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "5b234747-7098-49f1-ad5a-e22a055d1f56",
"name": "Send Match Summary via Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
-16240,
2576
],
"parameters": {
"sendTo": "={{ $json.OwnerEmail }}",
"message": "=<h2>Hi {{ $json.SponsorName }},</h2>\n\n<p>Based on your profile (<strong>{{ $json.Industry }}</strong>, ${{ $json.Budget }} budget), here are your top package matches:</p>\n\n<h3>Recommended Packages:</h3>\n<ul>\n{{ $json.topMatches.map(m => `<li><strong>${m.packageName}</strong> (Score: ${m.score}/100)<br><em>${m.reason}</em></li>`).join(\"\") }}\n</ul>\n\n<p><strong>Best option:</strong> {{ $json.bestPackage.packageName }}</p>\n\n<p>Reply to discuss!</p>\n\n<p><em>This recommendation was generated by AI based on your sponsor profile.</em></p>",
"options": {},
"subject": "=\ud83c\udfaf {{ $json.SponsorName }} - Top Package Matches (Score: {{ $json.matchScore }})"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "41939ab6-d366-4bca-9563-06b519509d15",
"name": "Intro: Sponsor-Package Matching Agent",
"type": "n8n-nodes-base.stickyNote",
"position": [
-18528,
1968
],
"parameters": {
"width": 540,
"height": 960,
"content": "## Sponsor-Package Matching Agent\n\n### **What it does:**\nAutomatically matches event sponsors to the best-fit sponsorship packages using AI scoring, then sends personalized email recommendations and logs results.\n\n### **Why it matters:**\nEliminates manual sponsor-package matching, ensuring every sponsor gets data-driven recommendations that maximize revenue fit and satisfaction.\n\n### **How it works:**\n- Step 1: Reads sponsor profiles (Industry, Budget, Goals) and package catalog from Google Sheets\n- Step 2: Loops through each sponsor, attaching the full package context\n- Step 3: GPT-4o scores the top 3 package matches with reasoning (JSON output)\n- Step 4: Filters matches scoring \u2265 70, sends personalized Gmail summaries\n- Step 5: Logs all match results to a Google Sheets audit trail\n\n### **Setup steps:**\n1. Set your three Google Sheets IDs in the **Set Workflow Variables** node (Sponsors, Packages, MatchLog)\n2. Connect **Google Sheets OAuth2** credential\n3. Connect **OpenAI API** credential (GPT-4o)\n4. Connect **Gmail OAuth2** credential\n5. Ensure Sponsors sheet has columns: SponsorName, Industry, Budget, Goals, OwnerEmail\n6. Ensure Packages sheet has columns: Name, Price, Benefits\n7. Test with 3 sponsors and 5 packages \u2192 execute manually"
},
"typeVersion": 1
},
{
"id": "40b7ad35-7e26-4eab-b077-92615f5d1c0c",
"name": "Section 1: Fetch & Prepare Data",
"type": "n8n-nodes-base.stickyNote",
"position": [
-17968,
2400
],
"parameters": {
"color": 4,
"width": 684,
"height": 520,
"content": "## 1. Fetch & Prepare Data\n\nReads sponsor profiles and sponsorship packages from two Google Sheets, then aggregates the package catalog for AI context injection.\n\n- **Sponsors Sheet:** SponsorName, Industry, Budget, Goals, OwnerEmail\n- **Packages Sheet:** Name, Price, Benefits"
},
"typeVersion": 1
},
{
"id": "277649dd-6d71-4752-8b1d-466676970d94",
"name": "Section 2: AI Matching Engine",
"type": "n8n-nodes-base.stickyNote",
"position": [
-17264,
2400
],
"parameters": {
"color": 2,
"width": 580,
"height": 520,
"content": "## 2. AI Matching Engine\n\nLoops through each sponsor, merges their profile with the full package catalog, and sends the context to GPT-4o. The model returns a JSON object with the top 3 package matches, each scored 0\u2013100 with reasoning."
},
"typeVersion": 1
},
{
"id": "adcb5365-69f1-4e9c-a11d-e9424f5ae431",
"name": "Section 3: Outreach & Logging",
"type": "n8n-nodes-base.stickyNote",
"position": [
-16672,
2400
],
"parameters": {
"color": 5,
"width": 668,
"height": 520,
"content": "## 3. Outreach & Logging\n\nParses the AI response, filters out low-confidence matches (score < 70), sends personalized Gmail recommendations to qualifying sponsors, and logs all results to a Google Sheets audit trail."
},
"typeVersion": 1
},
{
"id": "ade9ee4f-0501-44b8-ad22-2005ca3577f4",
"name": "Run Weekdays at 9 AM",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-18464,
2672
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1,
2,
3,
4,
5
],
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.3
},
{
"id": "c46f9dca-e830-4175-8648-4e52020ea605",
"name": "Contact: Braia Labs",
"type": "n8n-nodes-base.stickyNote",
"position": [
-15968,
1712
],
"parameters": {
"width": 540,
"height": 1200,
"content": "## Was this helpful? Get in touch! \n\n[](https://tally.so/r/EkKGgB)\n\nI really hope this automation helped you. Your feedback is incredibly valuable and helps me create better resources for business and the n8n community.\n\n### **Have Feedback, a Question, or a Project Idea?**\n\nI've streamlined the way we connect. It all starts with one simple form that takes less than 10 seconds. After that, you'll chat with my AI assistant who will gather the key details and pass them directly on to me.\n\n#### **[Start the conversation here](https://tally.so/r/EkKGgB)** \n\n* **Give Feedback:** Share your thoughts on this template\u2014whether you found a typo, encountered an unexpected error, have a suggestion, or just want to say thanks!\n\n* **n8n Consulting:** Have a complex business challenge or need a custom workflow built from scratch? Let's partner on a powerful automation solution tailored to your specific needs.\n\n* **Join your team:** We can work together to get you launched with confidence. \n\n---\n\nHappy Automating!\n[Milo Bravo](https://linkedin.com/in/MiloBravo/) | BRaiA Labs | Automation & BI Systems + AI Integration\n"
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"availableInMCP": false,
"executionOrder": "v1",
"saveManualExecutions": true,
"saveExecutionProgress": true,
"saveDataErrorExecution": "all"
},
"versionId": "d740db23-ed10-46b5-9b55-67dab5be92ae",
"connections": {
"Parse AI Response": {
"main": [
[
{
"node": "Extract Top Match Rankings",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Packages": {
"main": [
[
{
"node": "Merge Sponsor with Packages",
"type": "main",
"index": 1
}
]
]
},
"Loop Over Sponsors": {
"main": [
[
{
"node": "Merge Sponsor with Packages",
"type": "main",
"index": 0
}
]
]
},
"Prepare AI Context": {
"main": [
[
{
"node": "Match Packages with GPT-4o",
"type": "main",
"index": 0
}
]
]
},
"Fetch Packages Sheet": {
"main": [
[
{
"node": "Aggregate Packages",
"type": "main",
"index": 0
}
]
]
},
"Fetch Sponsors Sheet": {
"main": [
[
{
"node": "Loop Over Sponsors",
"type": "main",
"index": 0
}
]
]
},
"Run Weekdays at 9 AM": {
"main": [
[
{
"node": "Set Workflow Variables",
"type": "main",
"index": 0
}
]
]
},
"If Match Score \u2265 70": {
"main": [
[
{
"node": "Send Match Summary via Gmail",
"type": "main",
"index": 0
},
{
"node": "Log Results to Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Set Workflow Variables": {
"main": [
[
{
"node": "Fetch Sponsors Sheet",
"type": "main",
"index": 0
},
{
"node": "Fetch Packages Sheet",
"type": "main",
"index": 0
}
]
]
},
"Extract Top Match Rankings": {
"main": [
[
{
"node": "If Match Score \u2265 70",
"type": "main",
"index": 0
}
]
]
},
"Match Packages with GPT-4o": {
"main": [
[
{
"node": "Parse AI Response",
"type": "main",
"index": 0
}
]
]
},
"Merge Sponsor with Packages": {
"main": [
[
{
"node": "Prepare AI Context",
"type": "main",
"index": 0
}
]
]
},
"Log Results to Google Sheets": {
"main": [
[
{
"node": "Loop Over Sponsors",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Who is this for? Event planners, conference organizers, non-profits, and partnership managers who manage sponsor spreadsheets and want AI-powered package recommendations to maximize revenue.
Source: https://n8n.io/workflows/12620/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p
This workflow automates customer outreach for marketing campaigns, including customer prioritization, AI-generated emails, automated sending, reply tracking, and meeting scheduling. Data Synchronizati
This workflow automates the process of generating, reviewing, and publishing blog posts across multiple platforms, now enhanced with support for RSS Feeds as a content source. It streamlines the manag
This n8n template shows you how to turn outbound sales into a fully automated machine: scrape verified leads, research them with AI, and fire off personalized cold emails while you sleep.
Business Ideas AI Agent. Uses reddit, openAi, googleSheets, formTrigger. Scheduled trigger; 22 nodes.