Skip to content

Commit 42b9298

Browse files
committed
Add n8n workflow for Telegram to Supabase
1 parent 2d733fd commit 42b9298

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed

workflows/telegram-supabase.json

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"name": "Telegram to Supabase",
3+
"nodes": [
4+
{
5+
"parameters": {
6+
"updates": [
7+
"message"
8+
]
9+
},
10+
"id": "1",
11+
"name": "Telegram Trigger",
12+
"type": "n8n-nodes-base.telegramTrigger",
13+
"typeVersion": 1,
14+
"position": [
15+
200,
16+
300
17+
],
18+
"credentials": {
19+
"telegramApi": {
20+
"id": "placeholder",
21+
"name": "Telegram Account"
22+
}
23+
}
24+
},
25+
{
26+
"parameters": {
27+
"functionCode": "return items.map(item => ({ json: {\n user_id: item.json.message.from.id,\n name: item.json.message.from.username || item.json.message.from.first_name,\n message: item.json.message.text,\n timestamp: item.json.message.date,\n embeddings: ''\n}}));"
28+
},
29+
"id": "2",
30+
"name": "Prepare Data",
31+
"type": "n8n-nodes-base.function",
32+
"typeVersion": 1,
33+
"position": [
34+
450,
35+
300
36+
]
37+
},
38+
{
39+
"parameters": {
40+
"resource": "row",
41+
"operation": "insert",
42+
"table": "messages",
43+
"additionalFields": {},
44+
"data": [
45+
{
46+
"name": "user_id",
47+
"value": "={{$json[\"user_id\"]}}"
48+
},
49+
{
50+
"name": "name",
51+
"value": "={{$json[\"name\"]}}"
52+
},
53+
{
54+
"name": "message",
55+
"value": "={{$json[\"message\"]}}"
56+
},
57+
{
58+
"name": "timestamp",
59+
"value": "={{$json[\"timestamp\"]}}"
60+
},
61+
{
62+
"name": "embeddings",
63+
"value": "={{$json[\"embeddings\"]}}"
64+
}
65+
]
66+
},
67+
"id": "3",
68+
"name": "Supabase Insert",
69+
"type": "n8n-nodes-base.supabase",
70+
"typeVersion": 1,
71+
"position": [
72+
700,
73+
300
74+
],
75+
"credentials": {
76+
"supabaseApi": {
77+
"id": "placeholder",
78+
"name": "Supabase Account"
79+
}
80+
}
81+
},
82+
{
83+
"parameters": {},
84+
"id": "4",
85+
"name": "Error NoOp",
86+
"type": "n8n-nodes-base.noOp",
87+
"typeVersion": 1,
88+
"position": [
89+
700,
90+
450
91+
]
92+
}
93+
],
94+
"connections": {
95+
"Telegram Trigger": {
96+
"main": [
97+
[
98+
{
99+
"node": "Prepare Data",
100+
"type": "main",
101+
"index": 0
102+
}
103+
]
104+
]
105+
},
106+
"Prepare Data": {
107+
"main": [
108+
[
109+
{
110+
"node": "Supabase Insert",
111+
"type": "main",
112+
"index": 0
113+
}
114+
]
115+
]
116+
},
117+
"Supabase Insert": {
118+
"main": [
119+
null,
120+
[
121+
{
122+
"node": "Error NoOp",
123+
"type": "main",
124+
"index": 0
125+
}
126+
]
127+
]
128+
}
129+
},
130+
"active": false,
131+
"settings": {},
132+
"tags": []
133+
}

0 commit comments

Comments
 (0)