There is an error when clicking the test button after authorizing the Gmail account

<{
“nodes”: [
{
“parameters”: {
“sendTo”: “={{ $json[‘邮箱’] }}”,
“subject”: “天下无敌财团”,
“emailType”: “text”,
“message”: “={{ $json[‘姓’] }}{{ $json[‘名’] }},你好,很高姓你选择我们的服务,我们将在一天内根据你的需求提供完整的落地方案”,
“options”: {}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [
360,
-380
],
“id”: “17075654-4e9a-4c60-a9bd-8b27406842e6”,
“name”: “Gmail”,
“webhookId”: “22d494e5-811d-4c23-aad0-2b294b54dd72”,
“credentials”: {
“gmailOAuth2”: {
“id”: “xBhgGTeWbCAdb6Nr”,
“name”: “Gmail account”
}
}
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “98714e2b063e6914b2eeee137f9776d3255361437fa9f65fb862f526d2d3562f”
}
}>

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(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

<{
“errorMessage”: “Bad request - please check your parameters (item 0)”,
“errorDescription”: “Precondition check failed.”,
“errorDetails”: {
“rawErrorMessage”: [
“400 - {"error":{"code":400,"message":"Precondition check failed.","errors":[{"message":"Precondition check failed.","domain":"global","reason":"failedPrecondition"}],"status":"FAILED_PRECONDITION"}}”
]
},
“n8nDetails”: {
“nodeName”: “Gmail”,
“nodeType”: “n8n-nodes-base.gmail”,
“nodeVersion”: 2.1,
“resource”: “message”,
“operation”: “send”,
“itemIndex”: 0,
“time”: “2025/4/21 15:25:20”,
“n8nVersion”: “1.88.0 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeOperationError: Bad request - please check your parameters (item 0)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Gmail/v2/GmailV2.node.js:666:15)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:51”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20"
]
}
}>

Information on your n8n setup

Its difficult to figure out what you are doing as there is no overall flow and with the chinese characters. But by the screenshot you shared you might want to check what is the previous node returning. if you remove the dynamic fields and put in hard coded data for email, subject and message and see if it works. If yes then most probably your dynamic values has some issue. My hunch is the email that you are getting in the previous step might not be getting parsed correctly. Gmail in particular doesnt like its email in “” or <>. Why dont you put a set node before gmail to check if the values coming are correct or not.

I have solved the problem. It was a problem with Google. It seems that the authorization was not done in a timely manner.

1 Like