This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Speed to lead via Gmail",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"filters": {}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.3,
"position": [
-576,
-176
],
"id": "00000000-0000-4000-8000-000000000001",
"name": "Gmail Trigger",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3,
"position": [
-400,
-176
],
"id": "00000000-0000-4000-8000-000000000002",
"name": "AI Agent"
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "ism-0.3-sibt"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
-416,
96
],
"id": "00000000-0000-4000-8000-000000000003",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3,
"position": [
144,
-192
],
"id": "00000000-0000-4000-8000-000000000004",
"name": "AI Agent1"
},
{
"parameters": {
"operation": "get",
"documentURL": "https://example1.com",
"simple": false
},
"type": "n8n-nodes-base.googleDocsTool",
"typeVersion": 2,
"position": [
448,
48
],
"id": "00000000-0000-4000-8000-000000000005",
"name": "Get a document in Google Docs",
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "get",
"documentURL": "https://example2.com",
"simple": false
},
"type": "n8n-nodes-base.googleDocsTool",
"typeVersion": 2,
"position": [
288,
48
],
"id": "00000000-0000-4000-8000-000000000006",
"name": "Get a document in Google Docs1",
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "reply",
"messageId": "123",
"emailType": "text",
"message": "hello",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
640,
-192
],
"id": "00000000-0000-4000-8000-000000000007",
"name": "Reply to a message",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "00000000-0000-4000-8000-000000000009",
"leftValue": "",
"rightValue": "",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-112,
-176
],
"id": "00000000-0000-4000-8000-00000000000a",
"name": "If"
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"filters": {}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.3,
"position": [
-544,
480
],
"id": "00000000-0000-4000-8000-00000000000b",
"name": "Gmail Trigger1",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "6ctDXv-ydPvbmefhKWAKM6DgJE2h4H7ZaxoyYZExcugY",
"mode": "list",
"cachedResultName": "Resource 1",
"cachedResultUrl": "https://example3.com"
},
"sheetName": {
"__rl": true,
"value": "zgk=4",
"mode": "list",
"cachedResultName": "Resource 2",
"cachedResultUrl": "https://example4.com"
},
"columns": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [
{
"id": "Name",
"displayName": "Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email",
"displayName": "Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Requested service",
"displayName": "Requested service",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Screening questions",
"displayName": "Screening questions",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Screening answers",
"displayName": "Screening answers",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Urgency classification",
"displayName": "Urgency classification",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Appointment date",
"displayName": "Appointment date",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Appointment status",
"displayName": "Appointment status",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Summary",
"displayName": "Summary",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
656,
0
],
"id": "00000000-0000-4000-8000-00000000000c",
"name": "Append row in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "6ctDXv-ydPvbmefhKWAKM6DgJE2h4H7ZaxoyYZExcugY",
"mode": "list",
"cachedResultName": "Resource 1",
"cachedResultUrl": "https://example3.com"
},
"sheetName": {
"__rl": true,
"value": "zgk=4",
"mode": "list",
"cachedResultName": "Resource 2",
"cachedResultUrl": "https://example4.com"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
-336,
480
],
"id": "00000000-0000-4000-8000-00000000000d",
"name": "Get row(s) in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "00000000-0000-4000-8000-00000000000e",
"leftValue": "",
"rightValue": "",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-128,
480
],
"id": "00000000-0000-4000-8000-00000000000f",
"name": "If1"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3,
"position": [
96,
464
],
"id": "00000000-0000-4000-8000-000000000010",
"name": "AI Agent2"
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "ism-0.3-sibt"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
32,
672
],
"id": "00000000-0000-4000-8000-000000000011",
"name": "OpenAI Chat Model1",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "get",
"documentURL": "https://example2.com",
"simple": false
},
"type": "n8n-nodes-base.googleDocsTool",
"typeVersion": 2,
"position": [
400,
704
],
"id": "00000000-0000-4000-8000-000000000012",
"name": "Get a document in Google Docs2",
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "getAll",
"calendar": {
"__rl": true,
"value": "iaodyqlzyv01@bowel.shz",
"mode": "list",
"cachedResultName": "Resource 3"
},
"timeMax": "={{ $now.plus({ week: 2 }) }}",
"options": {}
},
"type": "n8n-nodes-base.googleCalendarTool",
"typeVersion": 1.3,
"position": [
192,
688
],
"id": "00000000-0000-4000-8000-000000000013",
"name": "Get many events in Google Calendar",
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"calendar": {
"__rl": true,
"value": "iaodyqlzyv01@bowel.shz",
"mode": "list",
"cachedResultName": "Resource 3"
},
"additionalFields": {}
},
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1.3,
"position": [
640,
304
],
"id": "00000000-0000-4000-8000-000000000014",
"name": "Create an event",
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "reply",
"messageId": "123",
"emailType": "text",
"message": "hello",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
640,
464
],
"id": "00000000-0000-4000-8000-000000000015",
"name": "Reply to a message1",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "6ctDXv-ydPvbmefhKWAKM6DgJE2h4H7ZaxoyYZExcugY",
"mode": "list",
"cachedResultName": "Resource 1",
"cachedResultUrl": "https://example3.com"
},
"sheetName": {
"__rl": true,
"value": "zgk=4",
"mode": "list",
"cachedResultName": "Resource 2",
"cachedResultUrl": "https://example4.com"
},
"columns": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [
{
"id": "Name",
"displayName": "Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email",
"displayName": "Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Requested service",
"displayName": "Requested service",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Screening questions",
"displayName": "Screening questions",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Screening answers",
"displayName": "Screening answers",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Urgency classification",
"displayName": "Urgency classification",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Appointment date",
"displayName": "Appointment date",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Appointment status",
"displayName": "Appointment status",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Summary",
"displayName": "Summary",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
640,
640
],
"id": "00000000-0000-4000-8000-000000000017",
"name": "Update row in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Gmail Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
},
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Get a document in Google Docs": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get a document in Google Docs1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"AI Agent1": {
"main": [
[
{
"node": "Reply to a message",
"type": "main",
"index": 0
},
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Reply to a message": {
"main": [
[]
]
},
"If": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger1": {
"main": [
[
{
"node": "Get row(s) in sheet",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "AI Agent2",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent2",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get a document in Google Docs2": {
"ai_tool": [
[
{
"node": "AI Agent2",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get many events in Google Calendar": {
"ai_tool": [
[
{
"node": "AI Agent2",
"type": "ai_tool",
"index": 0
}
]
]
},
"AI Agent2": {
"main": [
[
{
"node": "Create an event",
"type": "main",
"index": 0
},
{
"node": "Reply to a message1",
"type": "main",
"index": 0
},
{
"node": "Update row in sheet",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "00000000-0000-4000-8000-000000000018",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "3UWCPRPxo0JMV0V7",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleCalendarOAuth2ApigoogleDocsOAuth2ApigoogleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Speed to lead via Gmail. Uses gmailTrigger, agent, lmChatOpenAi, googleDocsTool. Event-driven trigger; 19 nodes.
Source: https://gist.github.com/meeramnoor16/feea0a24a4d0cf1f45d6cbf299ad65a0 — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Inbox Guardian. Uses gmailTrigger, lmChatOpenAi, agent, textClassifier. Event-driven trigger; 66 nodes.
The workflow detects incoming job-application emails, extracts resumes, and parses them for AI analysis. It evaluates each candidate against three open roles and assigns a fit score with structured re
This n8n template demonstrates how to build an autonomous AI assistant that handles real business tasks through natural conversation on Telegram. The example shows meeting scheduling with CRM lookup a
This workflow automates customer outreach for marketing campaigns, including customer prioritization, AI-generated emails, automated sending, reply tracking, and meeting scheduling. Data Synchronizati
This workflow is designed for Scrum Masters and Agile Coaches who prepare and coordinate Sprint Planning sessions, using Google Calendar, Google Sheets, and OpenAI.