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 →
{
"name": "Expense Logger",
"nodes": [
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.3,
"position": [
0,
0
],
"id": "40a4a543-0457-43fc-9da2-51127412ebb5",
"name": "Telegram Trigger",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "GPT-4o-mini"
},
"responses": {
"values": [
{
"content": "=Extract the expense amount and what the money was spent on from the user's message.\n\nUser message: {{ $json.message.text }}\n\nCategorize \"spent_on\" into one of:\nFood\nTransport\nShopping\nBills\nEntertainment\nHealth\nEducation\nOther\n\nAlong with category name, also write the thing that person bought/spent rupees on. For example, Shopping (Trekking Shows/Tshirt/Jacket, etc.), Food (Pizza/Drink/Gujarati Thali, etc.), Ticket Book (Railway/Flight/Bus, etc.) and so on. So, user get to know which thing they spent on. (Mention in brackets with category name)"
}
]
},
"builtInTools": {},
"options": {
"textFormat": {
"textOptions": {
"type": "json_schema",
"schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"expense_value\": {\n \"type\": \"number\"\n },\n \"spent_on\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"expense_value\", \"spent_on\"],\n \"additionalProperties\": false\n}"
}
}
}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 2.3,
"position": [
208,
0
],
"id": "03b8053f-5bfc-484a-83d9-4b3748766330",
"name": "Message a model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "YOUR_GOOGLE_SHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Sheet1",
"mode": "name"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Expense Value": "=\u20b9{{ $json.output[0].content[0].text.expense_value }}",
"Spent On": "={{ $json.output[0].content[0].text.spent_on }}"
},
"matchingColumns": [],
"schema": [
{
"id": "Expense Value",
"displayName": "Expense Value",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Spent On",
"displayName": "Spent On",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
560,
0
],
"id": "8c69fe23-8ce1-48f4-b56f-45390320fbd0",
"name": "Append row in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "tg expense logger bot code: \n\nYOUR_TELEGRAM_BOT_TOKEN\n\nchatid: YOUR_TELEGRAM_CHAT_ID",
"height": 176,
"width": 256
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-352,
-16
],
"typeVersion": 1,
"id": "bb834bcf-a0fa-4533-94ef-77e62530a5d9",
"name": "Sticky Note"
}
],
"connections": {
"Telegram Trigger": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false
},
"staticData": null,
"triggerCount": 0,
"meta": {
"templateCredsSetupCompleted": true
}
}
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.
googleSheetsOAuth2ApiopenAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Expense Logger. Uses telegramTrigger, openAi, googleSheets. Event-driven trigger; 4 nodes.
Source: https://github.com/DuttPanchal04/n8n-ai-automation-portfolio/blob/main/expense-logger/expense-logger-workflow.json — 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.
This workflow allows users to generate AI images directly from Telegram while automatically logging each request to Google Sheets for tracking. When a user sends a prompt to your Telegram bot, the wor
Ask questions like “How much did I spend on food last month?” and get instant answers from your financial data — directly in Telegram.
> ⚠️ Disclaimer: This workflow uses Community Nodes and must be run on a self-hosted instance of n8n.
Viral Tik Tok Clone Finder. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 41 nodes.
This workflow is designed for content creators, agencies, influencers, and automation builders who want to transform viral videos into personalized avatar-based edits — and automatically publish them