Files
mstfyldz/n8n_journal_workflow.json
T

172 lines
5.9 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"name": "mstfyldz Journal - Full Telegram & AI Automation",
"nodes": [
{
"parameters": {
"updates": [
"message"
]
},
"id": "node-telegram-trigger",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.1,
"position": [
100,
300
]
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.message.from.id }}",
"operation": "equal",
"value2": 123456789
}
]
}
},
"id": "node-auth-check",
"name": "Security Check (Chat ID)",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
320,
300
]
},
{
"parameters": {
"model": "gpt-4o-mini",
"options": {
"temperature": 0.7
},
"prompt": "=Sen Mustafa Yıldız'ın (mstfyldz) kişisel dijital günlüğünün AI yayın editörüsün. Telegram'dan gelen bu içeriği analiz et ve SADECE geçerli bir JSON nesnesi döndür.\n\nGelen Metin: \"{{ $json.message.text || $json.message.caption || '' }}\"\n\nKurallar:\n- mood: 'spark' | 'focus' | 'night' | 'calm' | 'visual'\n- moodLabel: 'Fikir Patlaması' | 'Aşırı Odak & Kaos' | 'Gece Melankolisi' | 'Sakin & Karalama' | 'Polaroid & Kırıntılar'\n- type: 'sticky' | 'notebook' | 'code' | 'polaroid' | 'audio'\n- stampedText: 'ONAYLANDI' | 'COMPILED' | 'DOĞRU TESPİT' | 'SUÇLU' | 'KARALAMA'\n- marginNotes: [ \"← samimi el yazısı kenar notu\" ]\n- tags: [ \"etiket1\", \"etiket2\" ]\n- title: \"Kısa ilgi çekici başlık (varsa metin yoksa null)\"\n\nBeklenen Çıktı Örneği:\n{\n \"type\": \"sticky\",\n \"mood\": \"spark\",\n \"moodLabel\": \"Fikir Patlaması\",\n \"title\": \"Sadelik Üzerine\",\n \"stampedText\": \"ONAYLANDI\",\n \"marginNotes\": [\"← tam olarak bu!\"],\n \"tags\": [\"felsefe\", \"yazılım\"]\n}"
},
"id": "node-openai-curator",
"name": "OpenAI Mood & Curator",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1,
"position": [
560,
300
]
},
{
"parameters": {
"jsCode": "const msg = $(\"Telegram Trigger\").first().json.message;\nlet aiParsed = {};\ntry {\n const rawText = $input.first().json.message?.content || $input.first().json.text || '{}';\n aiParsed = JSON.parse(rawText.replace(/```json|```/g, '').trim());\n} catch (e) {\n aiParsed = {};\n}\n\nconst now = new Date();\nconst dateStr = now.toLocaleDateString('tr-TR', { day: '2-digit', month: 'short', year: 'numeric' }).toUpperCase();\nconst timeStr = now.toLocaleTimeString('tr-TR', { hour: '2-digit', minute: '2-digit' });\n\nreturn {\n json: {\n id: `post-tg-${Date.now()}`,\n type: aiParsed.type || 'sticky',\n date: dateStr,\n timestamp: timeStr,\n mood: aiParsed.mood || 'spark',\n moodLabel: aiParsed.moodLabel || 'Fikir Patlaması',\n title: aiParsed.title || undefined,\n content: msg.text || msg.caption || '',\n marginNotes: aiParsed.marginNotes || ['← Telegram ile atıldı 📱'],\n tags: aiParsed.tags || ['telegram'],\n likes: 1,\n stampedText: aiParsed.stampedText || 'TELEGRAM'\n }\n};\n"
},
"id": "node-code-formatter",
"name": "Format Journal Payload",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
780,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://mstfyldz.com/api/posts",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify($json) }}"
},
"id": "node-http-post",
"name": "HTTP POST to Journal API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
1000,
300
]
},
{
"parameters": {
"chatId": "={{ $(\"Telegram Trigger\").first().json.message.chat.id }}",
"text": "=✅ *Not Deftere Karalandı!*\n\n📖 *Format:* {{ $(\"Format Journal Payload\").first().json.type }}\n💡 *Mood:* {{ $(\"Format Journal Payload\").first().json.moodLabel }}\n📌 *Başlık:* {{ $(\"Format Journal Payload\").first().json.title || 'Başlıksız Not' }}\n🏷️ *Etiketler:* #{{ $(\"Format Journal Payload\").first().json.tags.join(' #') }}\n\n✍️ _\"{{ $(\"Format Journal Payload\").first().json.marginNotes[0] || '' }}\"_",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"id": "node-telegram-reply",
"name": "Telegram Send Confirmation",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1220,
300
]
}
],
"connections": {
"Telegram Trigger": {
"main": [
[
{
"node": "Security Check (Chat ID)",
"type": "main",
"index": 0
}
]
]
},
"Security Check (Chat ID)": {
"main": [
[
{
"node": "OpenAI Mood & Curator",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Mood & Curator": {
"main": [
[
{
"node": "Format Journal Payload",
"type": "main",
"index": 0
}
]
]
},
"Format Journal Payload": {
"main": [
[
{
"node": "HTTP POST to Journal API",
"type": "main",
"index": 0
}
]
]
},
"HTTP POST to Journal API": {
"main": [
[
{
"node": "Telegram Send Confirmation",
"type": "main",
"index": 0
}
]
]
}
}
}