JSON Body:
{
hash: $json.hash,
title: $json.title,
body_markdown: $json.caption,
image_url: $json.image_url_ai ?? $json.image_url ?? null,
status: "posted",
published_at: new Date().toISOString()
}
ТУТ весь код целиком, просто вставьте его и подключите свои аккаунты:
{
"name": "Telegram-канал",
"nodes": [
{
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"value": 15,
"unit": "minutes"
}
]
}
},
"id": "4ad87778-300b-4fa5-99be-15d59c4ec834",
"name": "Cron (hourly)",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [-740, -420]
},
{
"parameters": {
"url": "={{ `https://rsshub.app/telegram/channel/insight_rss_inbox?limit=50&_=${Math.floor(Date.now()/30000)}` }}",
"options": {
"ignoreSSL": false
}
},
"id": "b7bd4e68-8db1-4141-8c94-2f4c1906615a",
"name": "RSS Read",
"type": "n8n-nodes-base.rssFeedRead",
"typeVersion": 1,
"position": [-320, -520],
"retryOnFail": true,
"waitBetweenTries": 5000,
"alwaysOutputData": false,
"onError": "continueErrorOutput"
},
...
{
"id": "3aa1fb9d-588e-4750-b19b-c79e7668bc9b",
"name": "OpenAI (Author Text)",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [-700, 80],
"credentials": {
"openAiApi": {
"id": "[твой_Api]",
"name": "[твой_Api]"
}
}
},
...
{
"id": "aa8f4f55-e7ac-4752-8f14-6c482a5a5933",
"name": "OpenAI (Image)",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [320, 0],
"credentials": {
"openAiApi": {
"id": "[твой_Api]",
"name": "[твой_Api]"
}
}
},
...
{
"id": "5d421f2d-15e8-4503-a57e-a5b8f8df713d",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [900, 80],
"credentials": {
"telegramApi": {
"id": "[твой_Api]",
"name": "[твой_Api]"
}
}
},
...
{
"id": "4943cb02-dacd-4d21-b7f6-0a0dced4621a",
"name": "Mark as Published (Supabase)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [1220, 80],
"parameters": {
"method": "POST",
"url": "https://[твой_Api]/rest/v1/posts?on_conflict=hash",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{ "name": "Content-Type", "value": "application/json" },
{ "name": "apikey", "value": "[твой_Api]" },
{ "name": "Authorization", "value": "Bearer [твой_Api]" },
{ "name": "prefer", "value": "resolution=merge-duplicates,return=minimal" }
]
}
}
},
...
{
"id": "76948513-2245-407c-a6d5-8e4ecbcb45b4",
"name": "Gate: SELECT posts by hash",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [600, -240],
"parameters": {
"url": "https://[твой_Api]/rest/v1/posts?select=hash&hash=eq.{{$json.hash}}&limit=1",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{ "name": "apikey", "value": "[твой_Api]" },
{ "name": "Authorization", "value": "Bearer [твой_Api]" }
]
}
}
},
...
{
"id": "2a840998-5810-4467-9b46-d6b63103568a",
"name": "Recent posts (N days)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [-340, -220],
"parameters": {
"url": "https://[твой_Api]/rest/v1/posts",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{ "name": "apikey", "value": "[твой_Api]" },
{ "name": "Authorization", "value": "Bearer [твой_Api]" }
]
}
}
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "feb898ae-fac5-42fe-ad22-454da8e1c595",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "[твой_Api]"
},
"id": "CsO6MORfgeWgWlqe",
"tags": []
}