247 lines
10 KiB
JSON
247 lines
10 KiB
JSON
{
|
||
"name": "Partner Sheets → Analiz → PostgreSQL",
|
||
"nodes": [
|
||
{
|
||
"parameters": {
|
||
"rule": {
|
||
"interval": [
|
||
{
|
||
"field": "cronExpression",
|
||
"expression": "0 9 * * *"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.scheduleTrigger",
|
||
"typeVersion": 1.2,
|
||
"position": [0, 0],
|
||
"id": "aaa00001-0000-0000-0000-000000000001",
|
||
"name": "Her Gün Saat 09:00"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "getAll",
|
||
"documentId": {
|
||
"__rl": true,
|
||
"value": "SHEETS_DOCUMENT_ID",
|
||
"mode": "id"
|
||
},
|
||
"sheetName": {
|
||
"__rl": true,
|
||
"value": "Sheet1",
|
||
"mode": "name"
|
||
},
|
||
"returnAll": true,
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.googleSheets",
|
||
"typeVersion": 4.5,
|
||
"position": [240, 0],
|
||
"id": "aaa00002-0000-0000-0000-000000000002",
|
||
"name": "Sheets - Tüm Satırları Çek",
|
||
"credentials": {
|
||
"googleSheetsOAuth2Api": {
|
||
"id": "SHEETS_CREDENTIAL_ID",
|
||
"name": "Google Sheets account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "// Sadece completed = FALSE veya boş olanları döndür\nconst rows = $input.all();\nconst pending = rows.filter(item => {\n const completed = String(item.json.completed || '').toUpperCase();\n return completed !== 'TRUE' && completed !== 'TAMAMLANDI' && completed !== '1';\n});\n\nif (pending.length === 0) {\n // İşlenecek satır yok\n return [];\n}\n\nreturn pending;"
|
||
},
|
||
"id": "aaa00003-0000-0000-0000-000000000003",
|
||
"name": "Bekleyenleri Filtrele",
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [480, 0]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.splitInBatches",
|
||
"typeVersion": 3,
|
||
"position": [720, 0],
|
||
"id": "aaa00004-0000-0000-0000-000000000004",
|
||
"name": "Loop Over Items"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"modelId": {
|
||
"__rl": true,
|
||
"value": "models/gemini-2.5-flash",
|
||
"mode": "list",
|
||
"cachedResultName": "models/gemini-2.5-flash"
|
||
},
|
||
"messages": {
|
||
"values": [
|
||
{
|
||
"content": "={{ $json.domain }}\n\nSen bir full-stack yazılım ve teknoloji şirketinin admin paneli için veri otomasyon asistanısın. Görevin, şirketin web sitesi tasarımı veya yazılım hizmeti sunduğu partner firmaların (müşterilerin) web sitelerini analiz etmek ve bunları \"Partnerler\" sayfasındaki grid yapısına uygun şekilde JSON formatına dönüştürmektir.\n\nSana gönderilen web sitesi adresini analiz et ve YALNIZCA aşağıdaki JSON formatında çıktı ver. JSON dışında hiçbir açıklama, markdown kodu (```json vb.) veya ön söz/son söz ekleme.\n\n### ÇIKTI FORMATI:\n{\n \"partner_ismi\": \"Firma adı (örn: MUĞLA SÜRÜCÜ KURSU)\",\n \"monogram\": \"Firmanın baş harflerinden oluşan 3 harfli büyük harf kombinasyonu (örn: MSK)\",\n \"kategori\": \"Yazılım şirketinin o firmaya sunduğu hizmet odağı. Tek veya iki kelime, dikkat çekici, teknolojik alt başlık (Örn: TEKNOLOJİ, WEB3 ALTYAPISI, TEDARİK ZİNCİRİ, KÜRESEL ÖDEMELER, GERÇEK ZAMANLI VERİ, HEADLESS WEB)\",\n \"aciklama\": \"Yazılım şirketinin bu partner ile olan teknolojik ortaklığını, sağladığı altyapıyı veya geliştirdiği çözümü anlatan, kurumsal, havalı ve 'ortaklığa' vurgu yapan tek cümlelik tanım.\"\n}\n\n### KURALLAR:\n1. \"partner_ismi\" kısmında firmanın resmi veya jenerik tam adını yaz.\n2. \"monogram\" her zaman 3 harfli ve tamamen BÜYÜK harf olmalı.\n3. \"kategori\" firmanın kendi sektörü DEĞİL, yazılımcı olarak senin ona dokunduğun teknolojik dikey olmalı.\n4. \"aciklama\" cümlesi kesinlikle profesyonel, ajans dilinde olmalı.\n5. \"yil\" alanı EKLEME — sistem otomatik ekleyecek.\n6. Çıktıda temiz JSON dışında hiçbir şey bulunmamalıdır."
|
||
}
|
||
]
|
||
},
|
||
"builtInTools": {},
|
||
"options": {}
|
||
},
|
||
"type": "@n8n/n8n-nodes-langchain.googleGemini",
|
||
"typeVersion": 1.1,
|
||
"position": [960, 0],
|
||
"id": "aaa00005-0000-0000-0000-000000000005",
|
||
"name": "Gemini Analiz",
|
||
"credentials": {
|
||
"googlePalmApi": {
|
||
"id": "Bu5nSnIxNY3DvfGa",
|
||
"name": "n8nautomation"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const input = $input.first().json;\n\nconst raw = input.text \n || input.content?.parts?.[0]?.text \n || (typeof input.content === 'string' ? input.content : '')\n || '';\n\nconst cleaned = String(raw).replace(/```json/g, '').replace(/```/g, '').trim();\n\nlet parsed;\ntry {\n parsed = JSON.parse(cleaned);\n} catch(e) {\n const domain = $('Loop Over Items').item.json.domain || '';\n parsed = {\n partner_ismi: domain,\n monogram: domain.replace(/https?:\\/\\//, '').substring(0, 3).toUpperCase(),\n kategori: 'Diğer',\n aciklama: 'Otomatik analiz başarısız oldu.'\n };\n}\n\n// Yılı her zaman sistem üzerinden al — Gemini'ye bırakma\nparsed.yil = new Date().getFullYear().toString();\n\n// Row number'ı da taşı (Sheets güncellemesi için)\nparsed._rowNumber = $('Loop Over Items').item.json.row_number \n || $('Loop Over Items').item.json._rowNumber\n || null;\n\nreturn [{ json: parsed }];"
|
||
},
|
||
"id": "aaa00006-0000-0000-0000-000000000006",
|
||
"name": "Parse JSON",
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [1200, 0]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"schema": {
|
||
"__rl": true,
|
||
"mode": "list",
|
||
"value": "public"
|
||
},
|
||
"table": {
|
||
"__rl": true,
|
||
"value": "Partner",
|
||
"mode": "list",
|
||
"cachedResultName": "Partner"
|
||
},
|
||
"columns": {
|
||
"mappingMode": "defineBelow",
|
||
"value": {
|
||
"name": "={{ $json.partner_ismi }}",
|
||
"desc": "={{ $json.aciklama }}",
|
||
"mono": "={{ $json.monogram }}",
|
||
"tag": "={{ $json.kategori }}",
|
||
"year": "={{ $json.yil }}"
|
||
},
|
||
"matchingColumns": ["id"],
|
||
"schema": [
|
||
{ "id": "id", "displayName": "id", "required": false, "defaultMatch": true, "display": true, "type": "number", "canBeUsedToMatch": true, "removed": true },
|
||
{ "id": "name", "displayName": "name", "required": true, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
|
||
{ "id": "tag", "displayName": "tag", "required": true, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
|
||
{ "id": "mono", "displayName": "mono", "required": true, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
|
||
{ "id": "year", "displayName": "year", "required": true, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
|
||
{ "id": "desc", "displayName": "desc", "required": true, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }
|
||
],
|
||
"attemptToConvertTypes": false,
|
||
"convertFieldsToString": false
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.postgres",
|
||
"typeVersion": 2.6,
|
||
"position": [1440, 0],
|
||
"id": "aaa00007-0000-0000-0000-000000000007",
|
||
"name": "PostgreSQL Insert",
|
||
"credentials": {
|
||
"postgres": {
|
||
"id": "T6YReSQ3PnkNwvnZ",
|
||
"name": "AyrisTech"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "update",
|
||
"documentId": {
|
||
"__rl": true,
|
||
"value": "SHEETS_DOCUMENT_ID",
|
||
"mode": "id"
|
||
},
|
||
"sheetName": {
|
||
"__rl": true,
|
||
"value": "Sheet1",
|
||
"mode": "name"
|
||
},
|
||
"columns": {
|
||
"mappingMode": "defineBelow",
|
||
"value": {
|
||
"completed": "TRUE"
|
||
},
|
||
"matchingColumns": ["domain"],
|
||
"schema": [
|
||
{ "id": "domain", "displayName": "domain", "required": false, "defaultMatch": true, "display": true, "type": "string", "canBeUsedToMatch": true },
|
||
{ "id": "completed", "displayName": "completed", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": false }
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.googleSheets",
|
||
"typeVersion": 4.5,
|
||
"position": [1680, 0],
|
||
"id": "aaa00008-0000-0000-0000-000000000008",
|
||
"name": "Sheets - Completed Yap",
|
||
"credentials": {
|
||
"googleSheetsOAuth2Api": {
|
||
"id": "SHEETS_CREDENTIAL_ID",
|
||
"name": "Google Sheets account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {},
|
||
"type": "n8n-nodes-base.noOp",
|
||
"typeVersion": 1,
|
||
"position": [1680, -200],
|
||
"id": "aaa00009-0000-0000-0000-000000000009",
|
||
"name": "İşlenecek kayıt yok"
|
||
}
|
||
],
|
||
"pinData": {},
|
||
"connections": {
|
||
"Her Gün Saat 09:00": {
|
||
"main": [[{ "node": "Sheets - Tüm Satırları Çek", "type": "main", "index": 0 }]]
|
||
},
|
||
"Sheets - Tüm Satırları Çek": {
|
||
"main": [[{ "node": "Bekleyenleri Filtrele", "type": "main", "index": 0 }]]
|
||
},
|
||
"Bekleyenleri Filtrele": {
|
||
"main": [[{ "node": "Loop Over Items", "type": "main", "index": 0 }]]
|
||
},
|
||
"Loop Over Items": {
|
||
"main": [
|
||
[{ "node": "İşlenecek kayıt yok", "type": "main", "index": 0 }],
|
||
[{ "node": "Gemini Analiz", "type": "main", "index": 0 }]
|
||
]
|
||
},
|
||
"Gemini Analiz": {
|
||
"main": [[{ "node": "Parse JSON", "type": "main", "index": 0 }]]
|
||
},
|
||
"Parse JSON": {
|
||
"main": [[{ "node": "PostgreSQL Insert", "type": "main", "index": 0 }]]
|
||
},
|
||
"PostgreSQL Insert": {
|
||
"main": [[{ "node": "Sheets - Completed Yap", "type": "main", "index": 0 }]]
|
||
},
|
||
"Sheets - Completed Yap": {
|
||
"main": [[{ "node": "Loop Over Items", "type": "main", "index": 0 }]]
|
||
}
|
||
},
|
||
"active": false,
|
||
"settings": {
|
||
"executionOrder": "v1",
|
||
"binaryMode": "separate",
|
||
"availableInMCP": false
|
||
},
|
||
"meta": {
|
||
"templateCredsSetupCompleted": true,
|
||
"instanceId": "79d13d1a6fcae5c2e451a2b02247a15904071a685f973aa3c0464bf9f4cd5f82"
|
||
},
|
||
"id": "triMzeBHtCmmToakgy6Ri",
|
||
"tags": []
|
||
}
|