This workflow corresponds to n8n.io template #7714 — we link there as the canonical source.
This workflow follows the Google Sheets → OpenAI 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 →
{
"id": "7el5prnIFj3s0DOI",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Credit Card with Chatgpt Agent Prompt checks",
"tags": [],
"nodes": [
{
"id": "e869214b-4356-45f8-843a-1002fecfe015",
"name": "Get Question Text",
"type": "n8n-nodes-base.code",
"position": [
-704,
336
],
"parameters": {},
"typeVersion": 2
},
{
"id": "bc1e2374-5e1a-4bd0-8c96-85bfd94e1a00",
"name": "Send Question",
"type": "n8n-nodes-base.telegram",
"position": [
-336,
288
],
"parameters": {},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "c3cc1299-ee15-496c-8a49-477f44669b3d",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
-1040,
-80
],
"parameters": {},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "c3008975-38de-4aca-ad1e-984dfcbb120e",
"name": "Is Q7 Answered?",
"type": "n8n-nodes-base.if",
"position": [
-1056,
192
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "d17066e8-9fb1-42c5-91cf-9932695e3dea",
"name": "Fetch Cards",
"type": "n8n-nodes-base.googleSheets",
"position": [
-688,
-112
],
"parameters": {},
"typeVersion": 4.6
},
{
"id": "aec9f45b-29ef-476e-89a1-902ac19f16d5",
"name": "Clean Q1\u2013Q7 Inputs",
"type": "n8n-nodes-base.set",
"position": [
-688,
128
],
"parameters": {},
"executeOnce": true,
"typeVersion": 3.4,
"alwaysOutputData": true
},
{
"id": "2e850a37-bd00-469a-850c-fc5d2af9b164",
"name": "Trigger: Incoming Telegram Message",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-1104,
-640
],
"parameters": {},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "022df149-16cb-4887-9b44-b17eda095d05",
"name": "Extract Telegram Message Text",
"type": "n8n-nodes-base.code",
"position": [
-880,
-640
],
"parameters": {},
"typeVersion": 2
},
{
"id": "1618ceb8-9480-432f-b88d-7fe85e670b1c",
"name": "Lookup User State (Google Sheet)",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueRegularOutput",
"position": [
-656,
-736
],
"parameters": {},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "ac8551bc-19aa-431b-9fbc-e3fd168310ea",
"name": "Merge Incoming Message with State",
"type": "n8n-nodes-base.merge",
"position": [
-432,
-576
],
"parameters": {},
"typeVersion": 3.2,
"alwaysOutputData": true
},
{
"id": "36e658f2-1c7f-438b-a74e-88f0f48a8a0a",
"name": "Check if User Exists in DB",
"type": "n8n-nodes-base.if",
"position": [
-208,
-576
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "6f5ed263-2d00-46f8-8cc2-b28f947bbda6",
"name": "Map & Format Answer for Google Sheet",
"type": "n8n-nodes-base.code",
"position": [
208,
-528
],
"parameters": {},
"typeVersion": 2
},
{
"id": "9d1cccbc-9d7e-41da-9f45-28bded82540a",
"name": "Extract Metadata from Answer",
"type": "n8n-nodes-base.set",
"position": [
400,
-528
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "977b8392-ddb7-4063-afbe-cecccf8d23a6",
"name": "Append Full User State for Processing",
"type": "n8n-nodes-base.code",
"position": [
592,
-544
],
"parameters": {},
"typeVersion": 2
},
{
"id": "6a7b940f-5271-4d75-9aec-a920a46b37ca",
"name": "Merge Updated State for Next Step",
"type": "n8n-nodes-base.merge",
"position": [
736,
-800
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "56c50495-7c4c-4768-b9ec-613194c1a480",
"name": "Carry Forward Previous Answers",
"type": "n8n-nodes-base.set",
"position": [
944,
-816
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "964192de-8ead-41df-85f4-a8a97cba0463",
"name": "Update Answer in Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1136,
-800
],
"parameters": {},
"typeVersion": 4.6,
"alwaysOutputData": true
},
{
"id": "df3fa4be-5cb4-4cd2-a8cd-9518ccd68a21",
"name": "Insert New User into Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1088,
-560
],
"parameters": {},
"typeVersion": 4.5
},
{
"id": "9d8e2199-789d-4a74-a73a-bbf2053d2373",
"name": "Determine Next Quiz Question",
"type": "n8n-nodes-base.code",
"position": [
1328,
-624
],
"parameters": {},
"typeVersion": 2
},
{
"id": "a275010c-7616-4c2e-a44c-750ea4911145",
"name": "Check if More Questions Remaining",
"type": "n8n-nodes-base.switch",
"position": [
-1264,
48
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "0425f294-897e-44d1-a487-ee491aebd545",
"name": "Merge User Profile & Card Dataset",
"type": "n8n-nodes-base.merge",
"position": [
-320,
80
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "9664c35e-3b1c-4f5e-92b3-fd52b2876869",
"name": "Build GPT Prompt with User Profile & Card Data",
"type": "n8n-nodes-base.code",
"position": [
160,
112
],
"parameters": {},
"typeVersion": 2
},
{
"id": "002101d2-7798-464b-8542-e014735c4b53",
"name": "Send Prompt to GPT for Card Matching",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
352,
112
],
"parameters": {},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "cf11ccaf-40ee-4e44-89af-f4db4b93ac79",
"name": "Clean GPT Output & Split into Sections",
"type": "n8n-nodes-base.code",
"position": [
688,
112
],
"parameters": {},
"typeVersion": 2
},
{
"id": "babdd4b6-5f2f-4c24-aa3a-358560f97744",
"name": "Format GPT Card Recommendations for Telegram",
"type": "n8n-nodes-base.code",
"position": [
896,
112
],
"parameters": {},
"typeVersion": 2
},
{
"id": "e0fbd374-614c-4681-890a-a786b9ae0288",
"name": "Send Card Recommendations to Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
1120,
112
],
"parameters": {},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "f0acc684-bdf0-4193-9cfc-05bee0d9697e",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
608
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d5123091-7314-45ad-a937-0e6ece77efd2",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-880
],
"parameters": {},
"typeVersion": 1
},
{
"id": "2c6f97d4-261f-462f-a970-dafbc648f802",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-880
],
"parameters": {},
"typeVersion": 1
},
{
"id": "156beb71-93c6-4788-9dad-b735a6c4b7b4",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-160
],
"parameters": {},
"typeVersion": 1
},
{
"id": "60142bf7-eaf8-472d-bdfb-3a6cb79c1848",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
-160
],
"parameters": {},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "993b0eb6-0005-429e-8142-2c796c22e946",
"connections": {
"Fetch Cards": {
"main": [
[
{
"node": "Merge User Profile & Card Dataset",
"type": "main",
"index": 0
}
]
]
},
"Is Q7 Answered?": {
"main": [
[
{
"node": "Fetch Cards",
"type": "main",
"index": 0
},
{
"node": "Clean Q1\u2013Q7 Inputs",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Question Text",
"type": "main",
"index": 0
}
]
]
},
"Get Question Text": {
"main": [
[
{
"node": "Send Question",
"type": "main",
"index": 0
}
]
]
},
"Clean Q1\u2013Q7 Inputs": {
"main": [
[
{
"node": "Merge User Profile & Card Dataset",
"type": "main",
"index": 1
}
]
]
},
"Check if User Exists in DB": {
"main": [
[
{
"node": "Map & Format Answer for Google Sheet",
"type": "main",
"index": 0
}
],
[
{
"node": "Insert New User into Google Sheet",
"type": "main",
"index": 0
}
]
]
},
"Determine Next Quiz Question": {
"main": [
[
{
"node": "Check if More Questions Remaining",
"type": "main",
"index": 0
}
]
]
},
"Extract Metadata from Answer": {
"main": [
[
{
"node": "Append Full User State for Processing",
"type": "main",
"index": 0
}
]
]
},
"Extract Telegram Message Text": {
"main": [
[
{
"node": "Lookup User State (Google Sheet)",
"type": "main",
"index": 0
},
{
"node": "Merge Incoming Message with State",
"type": "main",
"index": 1
}
]
]
},
"Update Answer in Google Sheet": {
"main": [
[
{
"node": "Determine Next Quiz Question",
"type": "main",
"index": 0
}
]
]
},
"Carry Forward Previous Answers": {
"main": [
[
{
"node": "Update Answer in Google Sheet",
"type": "main",
"index": 0
}
]
]
},
"Lookup User State (Google Sheet)": {
"main": [
[
{
"node": "Merge Updated State for Next Step",
"type": "main",
"index": 0
},
{
"node": "Merge Incoming Message with State",
"type": "main",
"index": 0
}
]
]
},
"Check if More Questions Remaining": {
"main": [
[
{
"node": "Is Q7 Answered?",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"Insert New User into Google Sheet": {
"main": [
[
{
"node": "Determine Next Quiz Question",
"type": "main",
"index": 0
}
]
]
},
"Merge Incoming Message with State": {
"main": [
[
{
"node": "Check if User Exists in DB",
"type": "main",
"index": 0
}
]
]
},
"Merge Updated State for Next Step": {
"main": [
[
{
"node": "Carry Forward Previous Answers",
"type": "main",
"index": 0
}
]
]
},
"Merge User Profile & Card Dataset": {
"main": [
[
{
"node": "Build GPT Prompt with User Profile & Card Data",
"type": "main",
"index": 0
}
]
]
},
"Trigger: Incoming Telegram Message": {
"main": [
[
{
"node": "Extract Telegram Message Text",
"type": "main",
"index": 0
}
]
]
},
"Map & Format Answer for Google Sheet": {
"main": [
[
{
"node": "Extract Metadata from Answer",
"type": "main",
"index": 0
}
]
]
},
"Send Prompt to GPT for Card Matching": {
"main": [
[
{
"node": "Clean GPT Output & Split into Sections",
"type": "main",
"index": 0
}
]
]
},
"Append Full User State for Processing": {
"main": [
[
{
"node": "Merge Updated State for Next Step",
"type": "main",
"index": 1
}
]
]
},
"Clean GPT Output & Split into Sections": {
"main": [
[
{
"node": "Format GPT Card Recommendations for Telegram",
"type": "main",
"index": 0
}
]
]
},
"Format GPT Card Recommendations for Telegram": {
"main": [
[
{
"node": "Send Card Recommendations to Telegram",
"type": "main",
"index": 0
}
]
]
},
"Build GPT Prompt with User Profile & Card Data": {
"main": [
[
{
"node": "Send Prompt to GPT for Card Matching",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
openAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Overview
Source: https://n8n.io/workflows/7714/ — 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.
BoomerBobBot.TP. Uses agent, telegramTrigger, telegram, memoryBufferWindow. Event-driven trigger; 95 nodes.
Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.
This template is designed for marketers, content creators, and e-commerce brands who want to automate the creation of professional ad videos at scale. It’s ideal for teams looking to generate consiste
N8N-Workflow. Uses telegramTrigger, telegram, googleSheets, openAi. Event-driven trigger; 63 nodes.
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.