i used the email trigger node in n8n and this was the output: [
{
“id”: “19834dc22f32bb15”,
“threadId”: “19834dc22f32bb15”,
“snippet”: “Hi Ruth, We recently came across your content and were genuinely impressed by the quality and thought leadership you bring to your platform. Your voice stands out, and it's clear that your audience”,
“payload”: {
“mimeType”: “multipart/alternative”
},
“sizeEstimate”: 7502,
“historyId”: “4033805”,
“internalDate”: “1753233486000”,
“labels”: [
{
“id”: “INBOX”,
“name”: “INBOX”
},
{
“id”: “IMPORTANT”,
“name”: “IMPORTANT”
},
{
“id”: “CATEGORY_PERSONAL”,
“name”: “CATEGORY_PERSONAL”
},
{
“id”: “UNREAD”,
“name”: “UNREAD”
}
],
“From”: “Ruth Orekogbe [email protected]”,
“Subject”: “Paid Partnership Opportunity with Substack”,
“To”: “[email protected]”
}
]
However this i what im meant to get as output
[
{
“id”: “19834dc22f32bb15”,
“threadId”: “19834dc22f32bb15”,
“labelIds”: [
“UNREAD”,
“IMPORTANT”,
“CATEGORY_PERSONAL”,
“INBOX”
],
“sizeEstimate”: 7502,
“headers”: {
“delivered-to”: “Delivered-To: [email protected]”,
“received”: “Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])\r\n by mx.google.com with SMTPS id a640c23a62f3a-af275196ab2sor88604066b.10.2025.07.22.18.18.18\r\n for [email protected]\r\n (Google Transport Security);\r\n Tue, 22 Jul 2025 18:18:18 -0700 (PDT)”,
“x-received”: “X-Received: by 2002:a17:907:e849:b0:ae3:6390:6ad3 with SMTP id\r\n a640c23a62f3a-af2f6d3ee85mr87104266b.22.1753233497962; Tue, 22 Jul 2025\r\n 18:18:17 -0700 (PDT)”,
“arc-seal”: “ARC-Seal: i=1; a=rsa-sha256; t=1753233498; cv=none;\r\n d=google.com; s=arc-20240605;\r\n b=RbPkuypMxsmGVHEt+wjzIMQ7Ja1Jlztc8ZDiEcpZaO5eXcd+HV0n0a4za/4rn7nXCd\r\n ZZKIumA8h0aTNwbhW73bvJF9KFjAyfl7Ip7N31VIMnQdPjMgYVdiw6F28zXUTwFUDa/Z\r\n 8s8y0k8mv2lCz0+eZXo1rsY3d45mXztQ9qjnCULkb9Vao8hRyQn85okt3K3y6YTUdUGR\r\n 8Q+v+IxL/Yu/sOKM35dkoANdDw6RP3/y9RxNjD5Uwiq3KEPChtk9NcFuDRfMUfECBSvM\r\n KwOYq7GwWrL0P6dUONzlTi0HgYzko9VM+MjJ2iwM1avX7bWd7Tt5tXMl5QuDv+jPVT5B\r\n yLJQ==”,
“arc-message-signature”: “ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;\r\n h=to:subject:message-id:date:from:mime-version:dkim-signature;\r\n bh=lKNBKh3MUuVxYPpIkqLldhPJK2l+O2p05gr43ZjwjPU=;\r\n fh=mv2C/zMOoh/cWFsVKIQfTsiME83xvlKjZUTymhRHps8=;\r\n b=T4S6HW1fkLPskTkAa/0OezCzziLvNUm3LnUE3uLgpPMr6RkY38mnP8pTmLTlONGHew\r\n weRYKaAAnQbbq2aYdhqYHu4iWIYF5j0p6vjDLPgUjKH5nKid5oYLs7wRonVm7Fthv2H5\r\n 7ZYFBwfKIxk6RkV7okO2Ur2zBycugyjCnvRp1ltjdBxpIgVeTyw3Lai6n3CSothGzPeC\r\n oSjr7s11CbXfUWOEz0PfQ4cJfPzPc5m/FkZB9h1Ep+jODZf2doPnHYsabxqE1fS3ntfM\r\n eZ4dO9C2n5Ntbom4o2uEOckZ+xsJa5/9+1UNtfEJwBYcz+00AU7SLZb1ZZRX7HEO5T0N\r\n 9/fg==;\r\n dara=google.com”,
“arc-authentication-results”: “ARC-Authentication-Results: i=1; mx.google.com;\r\n dkim=pass [email protected] header.s=20230601 header.b=nRnb1arM;\r\n spf=pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) [email protected];\r\n dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;\r\n dara=pass [email protected]”,
“return-path”: “Return-Path: [email protected]”,
“received-spf”: “Received-SPF: pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;”,
“authentication-results”: “Authentication-Results: mx.google.com;\r\n dkim=pass [email protected] header.s=20230601 header.b=nRnb1arM;\r\n spf=pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) [email protected];\r\n dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;\r\n dara=pass [email protected]”,
“dkim-signature”: “DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n d=gmail.com; s=20230601; t=1753233498; x=1753838298; dara=google.com;\r\n h=to:subject:message-id:date:from:mime-version:from:to:cc:subject\r\n message-id:reply-to;\r\n bh=lKNBKh3MUuVxYPpIkqLldhPJK2l+O2p05gr43ZjwjPU=;\r\n b=nRnb1arMMC1A+kx2CaAPZKykH1WNMVt2G5MmNQ7Ex70clkuFg4xXjHKPqznDNg+93F\r\n XRuUpqSAz8OpPm2BBf0pbacKZymIVwWaZUCPEdEnZNpROpmNEJAfbEP962yQI3/WXap2\r\n tyDjaNoQjMfm4wKcu5dN1kvFXXB0Td3an6zw1YmBqC+dX7rNP8/ZdwDxkrPYZ9fZeAEF\r\n ecDqvuEPSyroj/hI6Tkkm+XXyb79iMQmOiu2PeXJo4jrldfah653/1A/FdFjtQGOmGjJ\r\n yRlwDK+XilkoejAf45sPr0BGudwP7vie2EKzgF3SYnWCRTdl1873MvDGYvTvcXZSn0yT\r\n P5BQ==”,
“x-google-dkim-signature”: “X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n d=1e100.net; s=20230601; t=1753233498; x=1753838298;\r\n h=to:subject:message-id:date:from:mime-version:x-gm-message-state\r\n :from:to:cc:subject:date:message-id:reply-to;\r\n bh=lKNBKh3MUuVxYPpIkqLldhPJK2l+O2p05gr43ZjwjPU=;\r\n b=SQzIf396tqkIOyrMn1FkU/dBbTsEJKZzdMHDcPoYJf6aDNYX5l3ER5M4DT2ju670JU\r\n 5yHimdjWq4eJznOFz3iHEiT+bF6PmBMXd9ZoIrCWzfHA2bttQllcPLUdVyFGm/h5Uhkp\r\n cCOnP3HbuWEkuY3sEiL8FudgXYGGbC4+rsqhy+gNL1lSLkXfehMvr+ToUz1bch18cKcl\r\n K7n/IeTd+eesRq+H6uNj/OO/AMWJz5GV/iE+9bkGaePGt0fCuDooiiiFLG5ZxgsN2q6l\r\n Kgyege1EMJlSaFDyeQZJf+pMI6bK+PzmmrpmqVHsJHbntkKnAI5XD+oCp1H1+JwXc05y\r\n miTg==”,
“x-gm-message-state”: “X-Gm-Message-State: AOJu0YzjrUU+1MLSZhXbs+fuI3GUtk9pNP3PTTu+XcDs3u6K/LSaAULv\r\n\tT19G5s7cDLxDhNdHpwLUoVQZ+elhIkk7MIHjw8iPzP0Z3oeWfI0nu8MlP0PtvpyPl2mB/XAN7GG\r\n\t6g/LSezbb01pDXrcwy7ipvuoMF+wOC92BZa7hKwJlDQ==”,
“x-gm-gg”: “X-Gm-Gg: ASbGncukw8nysz6km6536AZ30FNxx1WzaJdpFM6eRa92QE+E6jv/5wPiosmwehbEAdA\r\n\tQdRWcYADigbqFqVpUHstXH22/hDzlP3J9Z2RKJpCtNhpILSilQ3aoH1s6QhMhQ+WG9Js+IFmMPc\r\n\tbK/CA5DOd9Z8nO2cvmRO9HUjLXgoww/BVgTtQh7m7WrGl59cQSmfXKDNlUHwtRsGqHS/33mPJSZ\r\n\t4ouN69F56ka6VDrPO4=”,
“x-google-smtp-source”: “X-Google-Smtp-Source: AGHT+IFyPM0DrOoC5TAs+STxAXXFxTIrUDKfodldHbb0SQMe40rO4XC00D+Ad9gB07Ze+ncYNoEBQ3L0oAlaC4YN6tk=”,
“mime-version”: “MIME-Version: 1.0”,
“from”: “From: Ruth Orekogbe [email protected]”,
“date”: “Date: Wed, 23 Jul 2025 02:18:06 +0100”,
“x-gm-features”: “X-Gm-Features: Ac12FXzPnFN7kBz0iHNwDQngDCEJEV2jJuHbrSgviA4BFVW2id5VuNIwYM4Ggfc”,
“message-id”: “Message-ID: CAPPNvQ2MiocDRU=jusSms4uxx9W6Cduv5mLodONfaA+fTkaSvg@mail.gmail.com”,
“subject”: “Subject: Paid Partnership Opportunity with Substack”,
“to”: “To: [email protected]”,
“content-type”: “Content-Type: multipart/alternative; boundary="000000000000dabd02063a8e7b24"”
},
“html”: “<div dir="ltr"><p class="gmail-p1">Hi Ruth,
<p class="gmail-p1">Best regards,\n<p class="gmail-p1">Rio Lynn\n<p class="gmail-p1">Partnerships Manager\n<p class="gmail-p1">Substack\n<p class="gmail-p1">780-782-4576
\n”,
“text”: “Hi Ruth,\n\nWe recently came across your content and were genuinely impressed by the\nquality and thought leadership you bring to your platform. Your voice\nstands out, and it’s clear that your audience trusts your perspective.\n\nWe’d love to explore a paid partnership with you through your Substack,\nparticularly in a way that not only shares our work but also aligns with\nyour mission of amplifying other people’s voices in tech and innovation.\n\nCould you kindly share your current partnership rates and any media kit or\npackages you offer? We’re excited about the potential to collaborate.\n\nLooking forward to your response.\n\n\nBest regards,\n\nRio Lynn\n\nPartnerships Manager\n\nSubstack\n\n780-782-4576\n”,
“textAsHtml”: “
Hi Ruth,
We recently came across your content and were genuinely impressed by the
quality and thought leadership you bring to your platform. Your voice
stands out, and it’s clear that your audience trusts your perspective.
We’d love to explore a paid partnership with you through your Substack,
particularly in a way that not only shares our work but also aligns with
your mission of amplifying other people’s voices in tech and innovation.
Could you kindly share your current partnership rates and any media kit or
packages you offer? We’re excited about the potential to collaborate.
Looking forward to your response.
Best regards,
Rio Lynn
Partnerships Manager
Substack
780-782-4576
”,“subject”: “Paid Partnership Opportunity with Substack”,
“date”: “2025-07-23T01:18:06.000Z”,
“to”: {
“value”: [
{
“address”: “[email protected]”,
“name”: “”
}
],
“html”: “<span class="mp_address_group"><a href="mailto:[email protected]" class="mp_address_email">[email protected]”,
“text”: “[email protected]”
},
“from”: {
“value”: [
{
“address”: “[email protected]”,
“name”: “Ruth Orekogbe”
}
],
“html”: “<span class="mp_address_group"><span class="mp_address_name">Ruth Orekogbe <<a href="mailto:[email protected]" class="mp_address_email">[email protected]>”,
“text”: “"Ruth Orekogbe" [email protected]”
},
“messageId”: “CAPPNvQ2MiocDRU=jusSms4uxx9W6Cduv5mLodONfaA+fTkaSvg@mail.gmail.com”
}
]
What would be the potential problems?
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"filters": {
"readStatus": "unread"
}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.2,
"position": [
-2020,
280
],
"id": "bedf9ef0-af29-4ee1-9ade-0d9fb286a417",
"name": "Gmail Trigger",
"credentials": {
"gmailOAuth2": {
"id": "N6psEFaHIR6T1Kxl",
"name": "Gmail account"
}
},
"notes": "give the full email"
},
{
"parameters": {
"promptType": "define",
"text": "=Extract the name of the sender from the following email. Only return the full name from the send address {{ $json.From }}. If no sender name, return empty string.",
"batching": {}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.7,
"position": [
-1800,
280
],
"id": "ac47772a-21f9-403e-9811-64d2d3df6839",
"name": "Basic LLM Chain"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-1700,
500
],
"id": "c4cef38e-c8a2-4625-893b-3364b9f28486",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"id": "QkHwa5FeSO1wbNfN",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "029e4caa-1bd2-4752-a112-7ca6b2e1659e",
"leftValue": "={{ $json.text }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-1440,
280
],
"id": "e52d1aca-8f35-4b1f-8650-713b085eb154",
"name": "If"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "1c37f5ab-2d08-4d1c-a457-a58e10209fc6",
"name": "introduction",
"value": "={{ $json.text }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1220,
180
],
"id": "61c37fbb-b7e0-4574-b9cb-0cc7c2adf32f",
"name": "Name Found"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3327a78a-92fd-4168-bbbc-efb45690361a",
"name": "Introduction",
"value": "Hey there!",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1220,
400
],
"id": "9c85f193-66cb-4340-8a8d-6922a3e42fd4",
"name": "Edit Fields"
},
{
"parameters": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
-980,
300
],
"id": "0abaf4f8-443c-4de8-b409-5f7db728f9f4",
"name": "Merge"
},
{
"parameters": {
"inputText": "={{ $('Gmail Trigger').item.json.Subject }}{{ $('Gmail Trigger').item.json.snippet }}",
"categories": {
"categories": [
{
"category": "Paid Partnership",
"description": "This is about paid partnerships and collaborations with brands"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"typeVersion": 1.1,
"position": [
-460,
300
],
"id": "0cb2f01b-c8c6-4867-8eb7-4396a082e43d",
"name": "Text Classifier"
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-420,
520
],
"id": "5a2f3975-095e-4ac7-88d9-dd5f5a48539e",
"name": "OpenAI Chat Model1",
"credentials": {
"openAiApi": {
"id": "QkHwa5FeSO1wbNfN",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "fa0e0805-8565-4c87-8ff4-418d15150298",
"name": "introduction",
"value": "={{ $json.introduction }}",
"type": "string"
},
{
"id": "141842d5-c63d-46d3-a132-08ec5b07cb70",
"name": "emailbody",
"value": "={{ $('Gmail Trigger').item.json.snippet }}",
"type": "string"
},
{
"id": "0c1840d9-1ea0-413e-904a-af1d76223ca2",
"name": "threadID",
"value": "={{ $('Gmail Trigger').item.json.threadId }}",
"type": "string"
},
{
"id": "d589f87c-ac4b-4be3-aa13-9412efeb2a04",
"name": "labelID",
"value": "={{ $('Gmail Trigger').item.json.labels[0].id }}",
"type": "string"
}
]
},
"includeOtherFields": true,
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-760,
300
],
"id": "1bfac67a-1f9c-4265-b301-bed99a135492",
"name": "Edit Fields1"
}
],
"connections": {
"Gmail Trigger": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "Name Found",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Name Found": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Text Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Text Classifier",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "cf1e9f6c8cb1f1775e7e8668beeffea63b392e226a2f48568e9d46e16a6c3f1c"
}
}
type or paste code here