Describe the problem/error/question
I have an agent that lets users search for documents in our MongoDB database using a Vector Search. The AI Agent does a good job in retrieving those documents based on chat input. Each document has a corresponding file located in an S3 bucket. I was hoping the AI Agent could access the AWS S3 tool to download the file and email it to the user using a Gmail node. Everything seems to work great until sending the email with the attachment. I don’t think the attachment is making its way back from S3, through the AI Agent, and over to Gmail. I have tried setting the S3 “Put Output File in Field” to the same value as the Gmail “Attachment Field Name” as well as setting both to be determined by the model and I get the same error regardless. If anyone can give me a tip or two as to how to get this on track, I would appreciate it. Workflow is shown below, but be advised, I removed the AI System prompt from this message for confidentiality.
What is the error message (if any)?
When trying to send the email with the attachment, I get the following error: "Cannot read properties of undefined (reading ‘0’) (item 0)
Please share your workflow
Share the output returned by the last node
The input to Gmail is this:
{
“Subject”: “Report for Instruction ASA-10009-HON”,
“Message”: “Please find attached the report for Instruction ASA-10009-HON.”,
“attachmentsBinary0_Attachment_Field_Name”: “reportPath”
}
The output from Gmail is just the error message:
Cannot read properties of undefined (reading ‘0’) (item 0)
Information on your n8n setup
- n8n version: 1.93.0
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Hosted on elect.io
- Operating system: Ubuntu