Describe the problem/error/question
The AI Agent is not able to pass the attached file to the Google Drive integration tool
What is the error message (if any)?
Cannot read properties of undefined (reading ‘0’)
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“options”: {
“allowFileUploads”: true,
“allowedFilesMimeTypes”: “application/pdf”
}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-360,
-140
],
“id”: “8b74d1d4-1b7f-40f0-bbf8-3c04ea2d02d9”,
“name”: “When chat message received”,
“webhookId”: “76f29326-929f-4f2b-aed1-5cedc0f2d0bc”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “upload the file in the attachment using the tool called Google Drive1”,
“options”: {
“systemMessage”: “You are a helpful assistant who uploads the received attachment into Google drive folder using the available tool called "Google Drive1" please pass the binary file data0 as input parameter for this tool.”,
“returnIntermediateSteps”: true,
“passthroughBinaryImages”: true
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.7,
“position”: [
-140,
-140
],
“id”: “a9533418-4dc0-443d-ba27-59b0e255a571”,
“name”: “AI Agent”,
“alwaysOutputData”: true
},
{
“parameters”: {
“model”: “gpt-4o-2024-11-20”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1,
“position”: [
-120,
80
],
“id”: “9cad8319-3ca1-48ba-8bb1-e7073d72f2c2”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “SyYuiVVR2JZyzMYB”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“descriptionType”: “manual”,
“toolDescription”: “upload the attached PDF file submitted by the user in chat to specified Google Drive”,
“inputDataFieldName”: “=data0”,
“name”: “=test.pdf”,
“driveId”: {
“__rl”: true,
“mode”: “list”,
“value”: “My Drive”
},
“folderId”: {
“__rl”: true,
“value”: “1pG8l8fElEngitDUIulcs6DaZPdqlp2HW”,
“mode”: “list”,
“cachedResultName”: “resumes”,
“cachedResultUrl”: “https://drive.google.com/drive/folders/1pG8l8fElEngitDUIulcs6DaZPdqlp2HW”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleDriveTool”,
“typeVersion”: 3,
“position”: [
380,
120
],
“id”: “df6d0c3f-8b02-4b2d-a732-2300e5cd62ca”,
“name”: “Google Drive1”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “AUeuxZQHz4U1RzJt”,
“name”: “Google Drive account”
}
}
}
],
“connections”: {
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Google Drive1”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- **n8n version:**[email protected]
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
- Operating system: Windows