Hi i have followed this flow (voice to send email)
but get the error in the logs “it seems you haven’t provided the recipient’s name or the content of the email you’d like me to draft. Could you please specify the details, including the recipient’s name and the purpose or main message of the email?” The voice agent in 11L says it has sent the email but it does not send, my contact data sheet is on my google drive. as you can tell im very new to this
{
“nodes”: [
{
“parameters”: {
“options”: {}
},
“id”: “f324e45f-063a-4250-b462-c944893ef718”,
“name”: “OpenAI Chat Model”,
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1,
“position”: [
160,
220
],
“credentials”: {
“openAiApi”: {
“id”: “Co43TImWNrXmsUx0”,
“name”: “n8n free OpenAI API credits”
}
}
},
{
“parameters”: {
“options”: {}
},
“id”: “e9b9e2ed-15c4-45d5-9aad-9392eadd6ee7”,
“name”: “Respond to Webhook”,
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.1,
“position”: [
600,
0
]
},
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “n8n”,
“responseMode”: “responseNode”,
“options”: {}
},
“id”: “a30bad94-cd4f-4437-bed9-dce7b79816f8”,
“name”: “Webhook”,
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2,
“position”: [
0,
0
],
“webhookId”: “44fd9c8a-250a-4c05-9035-91bf6f85d015”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=Email for: {{ $json.body.to }}\nEmail content: {{ $json.body.emailContent }}”,
“options”: {
“systemMessage”: “=# Overview \nYou are an AI agent responsible for drafting and sending professional emails based on user instructions. You have access to two tools: "ContactData" to find email addresses and "sendEmail" to compose and send emails. Your objective is to identify the recipient’s contact information, draft a professional email, and sign off as "[Steve]" before sending.\n\n—\n\n## Context \n- Incoming requests are received via webhook in natural language format (e.g., "Email John Doe to confirm the Tuesday meeting."). \n- The email should be formal, polite, and task-specific. \n- All emails should include a closing line and signature. \n- If contact data is not found, return an error message in the webhook response. \n\n—\n\n## Instructions \n1. Parse the request message to extract the recipient’s name and purpose of the email. \n2. Use the contactData tool to retrieve the recipient’s email address. \n3. Draft a professional email including: \n - Appropriate greeting \n - Main message based on the input \n - Sign-off line ("Best regards," or similar) \n - Signature as "[Steve]" \n4. Use the sendEmail tool with the recipient’s email, a suitable subject, and the drafted body. \n5. Return a response to the webhook indicating the email was successfully sent, or return an error if failed. \n\n—\n\n## Tools \n- contactData \n - Purpose: Look up recipient email addresses \n - Input: name
(e.g., "Jane Smith") \n - Output: email
(e.g., "[email protected]") \n\n- Gmail \n - Purpose: Send an email with subject and content \n - Input: \n - recipient
: Email address \n - subject
: Email subject line \n - body
: Full message body \n\n—\n\n## Examples \n- Input: "Send an email to Sarah Lee to thank her for her feedback on the proposal." \n- Output: \n - Subject: "Thank You for Your Feedback" \n - Body: \n "Hi Sarah, \n Thank you for your feedback on the proposal. I truly appreciate your input and suggestions. \n Best regards, \n [Steve]"\n\n—\n\n## SOP (Standard Operating Procedure) \n1. Receive input via webhook. \n2. Extract name and intent from message. \n3. Query contactData
using extracted name. \n4. If contact found: \n a. Draft email body based on intent. \n b. Compose a subject line from intent. \n c. Call sendEmail
with email, subject, and body. \n d. Return success message to webhook. \n5. If contact not found: \n a. Return error message to webhook indicating recipient not found. \n\n—\n\n## Final Notes \n- Keep the tone polite and professional. \n- Always include a greeting and closing in the message. \n- If more than one name is detected, default to the first unless specified. \n—\n”
}
},
“id”: “e1d04d01-4644-4167-bce8-3c6a7ce8c9e3”,
“name”: “Email Agent”,
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.7,
“position”: [
220,
0
]
},
{
“parameters”: {
“documentId”: {
“__rl”: true,
“value”: “1w5eMUty6Bzdd8gEO4Irp_n8NV9SJWKqLYqKjXPuKbrY”,
“mode”: “list”,
“cachedResultName”: “ContactData”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1w5eMUty6Bzdd8gEO4Irp_n8NV9SJWKqLYqKjXPuKbrY/edit?usp=drivesdk”
},
“sheetName”: {
“__rl”: true,
“value”: “gid=0”,
“mode”: “list”,
“cachedResultName”: “Sheet1”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1w5eMUty6Bzdd8gEO4Irp_n8NV9SJWKqLYqKjXPuKbrY/edit#gid=0”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheetsTool”,
“typeVersion”: 4.5,
“position”: [
360,
220
],
“id”: “4f672517-2638-4b7f-91ac-5facbf9a61c9”,
“name”: “Contact Data”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “DkBVfBIYMUB1U880”,
“name”: “Google Sheets account”
}
}
},
{
“parameters”: {
“sendTo”: “={{ $fromAI("emailaddress") }}”,
“subject”: “={{ $fromAI("Subject") }}”,
“emailType”: “text”,
“message”: “={{ $fromAI("emailbody") }}”,
“options”: {}
},
“type”: “n8n-nodes-base.gmailTool”,
“typeVersion”: 2.1,
“position”: [
480,
220
],
“id”: “d89cf9a0-2219-431e-a3d8-13626511736f”,
“name”: “sendEmail”,
“webhookId”: “dee5c1f2-dd6a-4f05-a0e7-9ae3f69fffb6”,
“credentials”: {
“gmailOAuth2”: {
“id”: “tlWkRfeFJH6KPKRH”,
“name”: “Gmail account”
}
}
}
],
“connections”: {
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “Email Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Webhook”: {
“main”: [
[
{
“node”: “Email Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Email Agent”: {
“main”: [
[
{
“node”: “Respond to Webhook”,
“type”: “main”,
“index”: 0
}
]
]
},
“Contact Data”: {
“ai_tool”: [
[
{
“node”: “Email Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“sendEmail”: {
“ai_tool”: [
[
{
“node”: “Email Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “382ebfd226b7d57a1b8cb1f0acd5a4e73279906faf7b3d563d15b8377371a9f2”
}
}