Here is the code of the version that is not working.
{
"name": "Test posting attachments",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"simple": false,
"filters": {
"labelIds": [
"Label_7413587365285494846"
]
},
"options": {
"dataPropertyAttachmentsPrefixName": "attachment_",
"downloadAttachments": true
}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.2,
"position": [
-300,
0
],
"id": "97b37ae3-61f7-44e5-8739-dbb4831207e7",
"name": "GmailTrigger",
"credentials": {
"gmailOAuth2": {
"id": "zhoNqeTTPqqwDJTA",
"name": "Gmail account 3"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "7133b422-4566-41ce-8f29-dd730c72b55e",
"leftValue": "={{\n $node[\"GmailTrigger\"].binary !== undefined && \n Object.keys($node[\"GmailTrigger\"].binary).some(key => \n $node[\"GmailTrigger\"].binary[key].mimeType === \"application/pdf\" ||\n $node[\"GmailTrigger\"].binary[key].fileName.toLowerCase().endsWith('.pdf')\n )\n}}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-80,
0
],
"id": "f53d8a4f-4b5f-4319-a2fd-5b42111c7f5b",
"name": "Check for pdf"
},
{
"parameters": {
"sendTo": "[email protected]",
"subject": "Attachment enclosed",
"message": "See attachment",
"options": {
"attachmentsUi": {
"attachmentsBinary": [
{
"property": "=attachment_0"
}
]
}
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
420,
-20
],
"id": "42edba13-c0a8-400f-8a12-f23479a4490e",
"name": "Gmail",
"webhookId": "3327f39c-7cc7-436c-b2ba-fbefa9ff3dc4",
"credentials": {
"gmailOAuth2": {
"id": "zhoNqeTTPqqwDJTA",
"name": "Gmail account 3"
}
}
},
{
"parameters": {
"text": "={{ $json.text }}",
"attributes": {
"attributes": [
{
"name": "company_name",
"description": "the name of the company that the update concerns",
"required": true
}
]
},
"options": {
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
}
},
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
"typeVersion": 1,
"position": [
80,
-240
],
"id": "60c50fc0-6509-49ce-88f3-48b99e70f173",
"name": "Information Extractor"
},
{
"parameters": {
"model": "claude-3-5-sonnet-20241022",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"typeVersion": 1.2,
"position": [
180,
-100
],
"id": "847e7b9d-1d67-48a5-ab49-d20bff332fe3",
"name": "Anthropic Chat Model",
"credentials": {
"anthropicApi": {
"id": "TPZ3pP8mkx93DY1Z",
"name": "Anthropic account"
}
}
}
],
"pinData": {},
"connections": {
"GmailTrigger": {
"main": [
[
{
"node": "Check for pdf",
"type": "main",
"index": 0
}
]
]
},
"Check for pdf": {
"main": [
[
{
"node": "Information Extractor",
"type": "main",
"index": 0
},
{
"node": "Gmail",
"type": "main",
"index": 0
}
],
[]
]
},
"Gmail": {
"main": [
[]
]
},
"Anthropic Chat Model": {
"ai_languageModel": [
[
{
"node": "Information Extractor",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Information Extractor": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "179a82cf-af65-42c0-b8a0-3ea0865959ed",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "7126a4a85868ea99d07cb37d30ec04878c3e9ccfdbfa44cfe54d9c6bc0bf6465"
},
"id": "o9ywZUwHkiLG5ysN",
"tags": []
}```