Gmail Node - Get Many Messages - HTML as Text

Describe the problem/error/question

Hello, I have an AI workflow that extracts numbers from an email on a daily basis and puts them in to an airtable base. It works really well, apart from one issue.

For the gmail node I have to re-forward the email to myself to get the textashtml. Without re-forwarding I just get html that doesn’t include email body.

Without me forwarding the email to myself I only get HTML as a variable. This doesn’t contain the email body.

After forwarding to myself I get htmlasText that can be used in the Ai node.

How can I get the gmail node to get textasHTML without me having to re-forward each day.

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“triggerAtHour”: 10
}
]
}
},
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
-624,
432
],
“id”: “c19c334b-77fa-4a20-bf06-c79380f20c15”,
“name”: “Schedule Trigger”
},
{
“parameters”: {
“operation”: “getAll”,
“limit”: 1,
“simple”: false,
“filters”: {
“labelIds”: [
“Label_7548288498897665131”
],
“readStatus”: “unread”
},
“options”: {}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [
-272,
432
],
“id”: “ef09ed72-bf8d-4d76-a534-b22ac52ce5d9”,
“name”: “Get many messages”,
“webhookId”: “28aa610d-b05c-4051-9281-2a82f39bb560”,
“credentials”: {
“gmailOAuth2”: {
“id”: “342WqGXoDgujaTAn”,
“name”: “Gmail account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.textAsHtml }}. Please read this HMTL text. Please extract data from the paragraphs “P&P Yesterday’s Task Summary &lt” and “P&P Yesterday’s Task Summary - London”.\n\nEach paragraph will have breaks that include 9 integers. These integers need to be mapped in order according to the titles below:\n\n"DROPPED_BY" as an email or null, \n1.“Bonus Swap” as an Integer, \n2.“Battery Swap” as an integer, \n3.“Rescue” as an Integer, \n4"Rebalance" as an Integer,\n5.“Deploy” as an Integer, \n6.“Rebalance&amp/…” as an integer, \n7.“IFQC” as an integer, \n8.“IFR” as an integer,\n9.“Repark” as an integer. \n\nPlease complete each text break individually\n\nPlease assign Oxford as the city for any data from the paragraph titled “P&P Yesterday’s Task Summary &lt” and London for any data from paragraph “P&P Yesterday’s Task Summary - London”. The date (the date will be one day previous to the date of the email and must be in ISO 8601 format).”,
“hasOutputParser”: true,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2.1,
“position”: [
-64,
432
],
“id”: “e392d7f4-44a4-404b-97b6-9a768cb81e9f”,
“name”: “Tasks Agent”,
“retryOnFail”: true,
“onError”: “continueRegularOutput”
}
],
“connections”: {
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Get many messages”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get many messages”: {
“main”: [
[
{
“node”: “Tasks Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Tasks Agent”: {
“main”: [

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “038dbcdf23f69cd7b392e56d74dd34415b051665c2f28de5bb4b4107fb4aeee8”
}
}
Share the output returned by the last node

Information on your n8n setup

  • n8n version: up to date
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: Mac

Hey @kingbee_619 hope all is good.

Could you pin one such email which doesn’t include htmlAsText for us to take a look at and share your workflow?

it has html raw is not supported by markdown parser.

Feel free to upload it elsewhere - google doc or gist or any other storage with a public link.

My understanding of your issue so far - when you get the original message, you need to extract some data, but you cannot find it in the body of the email, and it only becomes visible after you re-forward the email to yourself.

I would carefully analyze the fields available in the output of Gmail node and see which one has the data you are interested in. It cannot NOT have it (unless magic exists :slight_smile: ).

Ping the output of the Gmail node, share the workflow and tell which information you need to extract, we should be able to figure something out.

https://www.loom.com/share/2adeac9c8c5843e896fea40454181bfb?sid=e7b94b77-0c7a-4e3d-a694-9156fa59a3c2
Check This Link

Above Loom Video Will Might Help You With The Trouble You Are Getting .