{
"updatedAt": "2025-12-10T02:57:33.000Z",
"createdAt": "2025-12-09T17:51:41.677Z",
"id": "leS7vcfjDNDlHg0o",
"name": "Geni_AI_FLUX_v002",
"description": null,
"active": false,
"isArchived": false,
"nodes": [
{
"parameters": {
"method": "PATCH",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/tasks?id=eq.{{ $item(0).$node['task_create'].json.id }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
},
{
"name": "Prefer",
"value": "return=representation"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"status\": \"refunded\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
8944,
2768
],
"id": "9b13bb92-5dc3-4d21-84ca-02b8bab6fe98",
"name": "refund_status",
"alwaysOutputData": false,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"chatId": "={{ $json.chatId }}",
"text": "={{ $json.lang === 'en'\n\t? 'Not enough credits on your account. Please top up your balance via /buy_credits or the “Account” menu.'\n\t: 'Недостаточно Кредитов на аккаунте. Пожалуйста, пополните счёт через /buy_credits или раздел «Аккаунт».'\n}}",
"additionalFields": {
"appendAttribution": false,
"parse_mode": "HTML"
}
},
"id": "8ce35754-80f2-4038-bf39-cd02f3331fff",
"name": "Telegram35",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
3664,
2608
],
"webhookId": "5b8729ef-53a1-4f11-9007-70726cf83481",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"method": "POST",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/rpc/wallet_credit",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"p_user_id\": \"{{ $('Merge12').item.json.user_id }}\",\n \"p_amount\": {{ $('Merge12').item.json.price }},\n \"p_kind\": \"refund\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
8704,
2544
],
"id": "c8bd04a7-6aad-4149-a0b4-31c9cd7cfc87",
"name": "wallet_credit_refund",
"alwaysOutputData": false,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"chatId": "={{ $item(0).$node['Merge11'].json.chatId }}",
"text": "={{ $('Merge12').item.json.lang === 'en'\n\t? '❌ Generation error\\n'\n\t\t+ 'Reason: ' + ($json.error || 'unknown') + '\\n'\n\t\t+ 'Status: ' + ($json.status || '-') + '\\n'\n\t\t+ '⚡Refund ' + $('Merge12').item.json.price + ' credits.\\n'\n\t\t+ '💰Balance ' + $json.balance + ' credits.'\n\t: '❌ Ошибка генерации\\n'\n\t\t+ 'Причина: ' + ($json.error || 'unknown') + '\\n'\n\t\t+ 'Статус: ' + ($json.status || '-') + '\\n'\n\t\t+ '⚡Возврат ' + $('Merge12').item.json.price + ' Кредитов.\\n'\n\t\t+ '💰Баланс ' + $json.balance + ' Кредитов.'\n}}\n",
"additionalFields": {
"appendAttribution": false
}
},
"id": "80f30da7-5846-49a2-ba3b-c928df73ee60",
"name": "Telegram37",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
8944,
2544
],
"webhookId": "c67e9de0-1b05-4204-8cfc-f063cba8ab7d",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"method": "PATCH",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/tasks?id=eq.{{ $item(0).$node['task_create'].json.id }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
},
{
"name": "Prefer",
"value": "return=representation"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"status\": \"running\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
6240,
2480
],
"id": "e0301063-227b-4537-b947-c9babbc52c62",
"name": "wallet_credit_refund3",
"alwaysOutputData": false,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"resource": "file",
"fileId": "={{ $json.photo_file_id }}",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
4320,
2464
],
"id": "26392809-2bc0-4a51-9f95-f5c7e90cad61",
"name": "Get a file2",
"webhookId": "57677f94-8c71-4408-81e8-440760062699",
"alwaysOutputData": false,
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"value": "={{ ($binary.data ) }}"
}
]
},
"options": {
"dotNotation": true
}
},
"id": "66c22cea-d915-40bc-ac54-54e10d306fa2",
"name": "Set Chat ID1",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
4528,
2464
]
},
{
"parameters": {
"operation": "binaryToPropery",
"options": {
"keepSource": "json"
}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
4736,
2464
],
"id": "7f300f00-1313-4df4-a368-54faa137818e",
"name": "Extract from File"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "7fea9554-5179-4301-a172-372b975a514e",
"name": "dataUrl",
"value": "=data:{{ $json.propertyName.mimeType }};base64,{{ $json.data }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
4928,
2464
],
"id": "cd629aa6-91b5-4056-87cc-dd15ea344d19",
"name": "Edit Fields9"
},
{
"parameters": {
"jsCode": "// СЮДА приходят items с { dataUrl, prompt, chatId, ... } (по одному на фото)\nconst items = $items();\n\nconst dataUrls = items\n .map(it => (it.json?.dataUrl || '').trim())\n .filter(Boolean);\n\n// на всякий случай ограничим до 5 (многие провайдеры дают лимит)\nconst MAX = 5;\nconst images = dataUrls.slice(-MAX);\n\nreturn [{\n json: {\n images, // массив всех data:image/...;base64,...\n }\n}];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
5120,
2464
],
"id": "cc3689ae-be1e-4d64-9840-2704115557df",
"name": "photo array"
},
{
"parameters": {
"method": "POST",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/rpc/wallet_debit",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"p_user_id\": \"{{ $json.user_id }}\",\n \"p_amount\": \"{{ $json.price }}\",\n \"p_kind\": \"debit\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
5824,
2464
],
"id": "4a61c5b4-fa1c-4f19-b3ae-4d1433c458c1",
"name": "wallet_debit",
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
5360,
2448
],
"id": "0a2686cd-90e1-4ae8-980f-f9978c5be3c4",
"name": "Merge4"
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"input\": {\n \"workflow\": {\n \"51\": {\n \"inputs\": {\n \"samples\": [\n \"795\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEDecode\",\n \"_meta\": {\n \"title\": \"Декодировать VAE\"\n }\n },\n \"94\": {\n \"inputs\": {\n \"clip_name1\": \"clip_l.safetensors\",\n \"clip_name2\": \"t5xxl_fp8_e4m3fn_scaled.safetensors\",\n \"type\": \"flux\",\n \"device\": \"default\"\n },\n \"class_type\": \"DualCLIPLoader\",\n \"_meta\": {\n \"title\": \"Двойной загрузчик CLIP\"\n }\n },\n \"448\": {\n \"inputs\": {\n \"vae_name\": \"flux_vae.safetensors\"\n },\n \"class_type\": \"VAELoader\",\n \"_meta\": {\n \"title\": \"Загрузить VAE\"\n }\n },\n \"451\": {\n \"inputs\": {\n \"guidance\": 4,\n \"conditioning\": [\n \"846\",\n 0\n ]\n },\n \"class_type\": \"FluxGuidance\",\n \"_meta\": {\n \"title\": \"Направление Flux\"\n }\n },\n \"453\": {\n \"inputs\": {\n \"conditioning\": [\n \"846\",\n 0\n ]\n },\n \"class_type\": \"ConditioningZeroOut\",\n \"_meta\": {\n \"title\": \"Обнуление кондиционирования\"\n }\n },\n \"610\": {\n \"inputs\": {\n \"max_shift\": 1.2,\n \"base_shift\": 0.5,\n \"width\": [\n \"852\",\n 0\n ],\n \"height\": [\n \"853\",\n 0\n ],\n \"model\": [\n \"866\",\n 0\n ]\n },\n \"class_type\": \"ModelSamplingFlux\",\n \"_meta\": {\n \"title\": \"Выборка модели Flux\"\n }\n },\n \"661\": {\n \"inputs\": {\n \"text\": \"{{ $json.prompt }}\",\n \"clip\": [\n \"866\",\n 1\n ]\n },\n \"class_type\": \"CLIPTextEncode\",\n \"_meta\": {\n \"title\": \"Кодирование текста CLIP (Запрос)\"\n }\n },\n \"713\": {\n \"inputs\": {\n \"samples\": [\n \"854\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEDecode\",\n \"_meta\": {\n \"title\": \"Декодировать VAE\"\n }\n },\n \"715\": {\n \"inputs\": {\n \"pixels\": [\n \"811\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEEncode\",\n \"_meta\": {\n \"title\": \"Кодировать VAE\"\n }\n },\n \"716\": {\n \"inputs\": {\n \"seed\": 1112142953358039,\n \"steps\": 4,\n \"cfg\": 1,\n \"sampler_name\": \"dpmpp_2m\",\n \"scheduler\": \"simple\",\n \"denoise\": 0.45,\n \"model\": [\n \"610\",\n 0\n ],\n \"positive\": [\n \"451\",\n 0\n ],\n \"negative\": [\n \"453\",\n 0\n ],\n \"latent_image\": [\n \"715\",\n 0\n ]\n },\n \"class_type\": \"KSampler\",\n \"_meta\": {\n \"title\": \"KSampler\"\n }\n },\n \"771\": {\n \"inputs\": {\n \"width\": [\n \"852\",\n 0\n ],\n \"height\": [\n \"853\",\n 0\n ],\n \"batch_size\": 1\n },\n \"class_type\": \"EmptyLatentImage\",\n \"_meta\": {\n \"title\": \"Пустое латентное изображение\"\n }\n },\n \"793\": {\n \"inputs\": {\n \"ckpt_name\": \"flux1-krea-dev_fp8_scaled.safetensors\"\n },\n \"class_type\": \"CheckpointLoaderSimple\",\n \"_meta\": {\n \"title\": \"Загрузить сheckpoint\"\n }\n },\n \"795\": {\n \"inputs\": {\n \"seed\": {{ $json.seed }},\n \"steps\": 8,\n \"cfg\": 1,\n \"sampler_name\": \"euler\",\n \"scheduler\": \"simple\",\n \"denoise\": 1,\n \"model\": [\n \"610\",\n 0\n ],\n \"positive\": [\n \"451\",\n 0\n ],\n \"negative\": [\n \"453\",\n 0\n ],\n \"latent_image\": [\n \"771\",\n 0\n ]\n },\n \"class_type\": \"KSampler\",\n \"_meta\": {\n \"title\": \"KSampler\"\n }\n },\n \"808\": {\n \"inputs\": {\n \"model_name\": \"2xLiveActionV1_SPAN_490000.pth\"\n },\n \"class_type\": \"UpscaleModelLoader\",\n \"_meta\": {\n \"title\": \"Загрузить модель апскейла\"\n }\n },\n \"809\": {\n \"inputs\": {\n \"upscale_model\": [\n \"808\",\n 0\n ],\n \"image\": [\n \"51\",\n 0\n ]\n },\n \"class_type\": \"ImageUpscaleWithModel\",\n \"_meta\": {\n \"title\": \"Апскейл изображения (с использованием модели)\"\n }\n },\n \"811\": {\n \"inputs\": {\n \"upscale_method\": \"lanczos\",\n \"scale_by\": 0.72,\n \"image\": [\n \"809\",\n 0\n ]\n },\n \"class_type\": \"ImageScaleBy\",\n \"_meta\": {\n \"title\": \"Масштабировать изображение на\"\n }\n },\n \"815\": {\n \"inputs\": {\n \"width\": [\n \"836\",\n 0\n ],\n \"height\": [\n \"835\",\n 0\n ],\n \"batch_size\": 1,\n \"color\": 0\n },\n \"class_type\": \"EmptyImage\",\n \"_meta\": {\n \"title\": \"Пустое изображение\"\n }\n },\n \"818\": {\n \"inputs\": {\n \"image\": [\n \"815\",\n 0\n ]\n },\n \"class_type\": \"GetImageSize+\",\n \"_meta\": {\n \"title\": \"🔧 Get Image Size\"\n }\n },\n \"822\": {\n \"inputs\": {\n \"target_width\": [\n \"818\",\n 0\n ],\n \"target_height\": [\n \"818\",\n 1\n ]\n },\n \"class_type\": \"SDXL Recommended Resolution Calc (JPS)\",\n \"_meta\": {\n \"title\": \"SDXL Recommended Resolution Calc (JPS)\"\n }\n },\n \"835\": {\n \"inputs\": {\n \"value\": {{ $json.h }}\n },\n \"class_type\": \"PrimitiveInt\",\n \"_meta\": {\n \"title\": \"Int\"\n }\n },\n \"836\": {\n \"inputs\": {\n \"value\": {{ $json.w }}\n },\n \"class_type\": \"PrimitiveInt\",\n \"_meta\": {\n \"title\": \"Int\"\n }\n },\n \"837\": {\n \"inputs\": {\n \"style_model_name\": \"flux1-redux-dev.safetensors\"\n },\n \"class_type\": \"StyleModelLoader\",\n \"_meta\": {\n \"title\": \"Загрузить модель стиля\"\n }\n },\n \"838\": {\n \"inputs\": {\n \"clip_name\": \"sigclip_vision_patch14_384.safetensors\"\n },\n \"class_type\": \"CLIPVisionLoader\",\n \"_meta\": {\n \"title\": \"Загрузить видение CLIP\"\n }\n },\n \"840\": {\n \"inputs\": {\n \"image\": \"input_image_1.png\"\n },\n \"class_type\": \"LoadImage\",\n \"_meta\": {\n \"title\": \"Load Image Prompt\"\n }\n },\n \"846\": {\n \"inputs\": {\n \"boolean\": [\n \"847\",\n 0\n ],\n \"on_true\": [\n \"892\",\n 0\n ],\n \"on_false\": [\n \"661\",\n 0\n ]\n },\n \"class_type\": \"easy ifElse\",\n \"_meta\": {\n \"title\": \"If else\"\n }\n },\n \"847\": {\n \"inputs\": {\n \"int\": [\n \"870\",\n 0\n ]\n },\n \"class_type\": \"Int To Bool (mtb)\",\n \"_meta\": {\n \"title\": \"Int To Bool (mtb)\"\n }\n },\n \"852\": {\n \"inputs\": {\n \"expression\": \"a*1\",\n \"a\": [\n \"822\",\n 0\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"853\": {\n \"inputs\": {\n \"expression\": \"a*1\",\n \"a\": [\n \"822\",\n 1\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"854\": {\n \"inputs\": {\n \"boolean\": {{ $json.quality }},\n \"on_true\": [\n \"716\",\n 0\n ],\n \"on_false\": [\n \"795\",\n 0\n ]\n },\n \"class_type\": \"easy ifElse\",\n \"_meta\": {\n \"title\": \"If else\"\n }\n },\n \"864\": {\n \"inputs\": {\n \"lora_name\": \"diffusion_pytorch_model.safetensors\",\n \"strength_model\": 1,\n \"strength_clip\": 1,\n \"model\": [\n \"793\",\n 0\n ],\n \"clip\": [\n \"94\",\n 0\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"865\": {\n \"inputs\": {\n \"lora_name\": \"nsfw_flux_lora_v1.safetensors\",\n \"strength_model\": -0.3,\n \"strength_clip\": 1,\n \"model\": [\n \"864\",\n 0\n ],\n \"clip\": [\n \"864\",\n 1\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"866\": {\n \"inputs\": {\n \"lora_name\": \"SameFace_Fix.safetensors\",\n \"strength_model\": -0.45,\n \"strength_clip\": 1,\n \"model\": [\n \"865\",\n 0\n ],\n \"clip\": [\n \"865\",\n 1\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"870\": {\n \"inputs\": {\n \"expression\": \"a>0\",\n \"a\": [\n \"891\",\n 0\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"891\": {\n \"inputs\": {\n \"value\": {{ $json.refInterp }}\n },\n \"class_type\": \"easy float\",\n \"_meta\": {\n \"title\": \"Float\"\n }\n },\n \"892\": {\n \"inputs\": {\n \"downsampling_factor\": [\n \"891\",\n 0\n ],\n \"downsampling_function\": \"area\",\n \"mode\": \"center crop (square)\",\n \"weight\": 1,\n \"autocrop_margin\": 0.1,\n \"conditioning\": [\n \"661\",\n 0\n ],\n \"style_model\": [\n \"837\",\n 0\n ],\n \"clip_vision\": [\n \"838\",\n 0\n ],\n \"image\": [\n \"840\",\n 0\n ]\n },\n \"class_type\": \"ReduxAdvanced\",\n \"_meta\": {\n \"title\": \"ReduxAdvanced\"\n }\n },\n \"894\": {\n \"inputs\": {\n \"text\": \"True\",\n \"anything\": [\n \"847\",\n 0\n ]\n },\n \"class_type\": \"easy showAnything\",\n \"_meta\": {\n \"title\": \"Show Any\"\n }\n },\n \"895\": {\n \"inputs\": {\n \"filename_prefix\": \"ComfyUI\",\n \"images\": [\n \"713\",\n 0\n ]\n },\n \"class_type\": \"SaveImage\",\n \"_meta\": {\n \"title\": \"Сохранить изображение\"\n }\n }\n},\n \"images\": [\n {\n \"name\": \"input_image_1.png\",\n \"image\": \"{{ $json.images[0] }}\"\n }\n ]\n }\n}",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
7280,
2432
],
"id": "6c6136f9-aad4-4ff2-8b21-491395d487b3",
"name": "WF_img"
},
{
"parameters": {
"chatId": "={{ $item(0).$node['Merge11'].json.chatId }}",
"text": "={{ \n $('Merge12').item.json.lang === 'en'\n ? '⚠️ Warming up the server.\\nThe first generation may take up to 1–2 minutes because the GPU is waking up.'\n : '⚠️ Сервер просыпается.\\nПервая генерация может занять до 1–2 минут, пока поднимается GPU.'\n}}",
"additionalFields": {
"appendAttribution": false
}
},
"id": "3eb0c7d0-14dd-4d21-bc67-bb566a29ca05",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
7872,
2400
],
"webhookId": "7be88993-abc0-495b-8dd1-0a7f3d071d82",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"method": "POST",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/tasks",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
},
{
"name": "Prefer",
"value": "return=representation"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"user_id\": \"{{ $json.user_id }}\",\n \"tool\": \"flux\",\n \"model\": \"none\",\n \"cost\": {{ $json.price }},\n \"status\": \"created\",\n \"meta\": \"promt:{{ $json.prompt }}\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
3664,
2384
],
"id": "593aacf2-045e-4fd8-898b-ce7566bdc2aa",
"name": "task_create",
"alwaysOutputData": false,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"method": "POST",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/rpc/get_user_id_and_balance",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"p_tg_user_id\": \"{{ $json.chatId }}\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
3008,
2384
],
"id": "65457d57-0573-4409-9707-2d2b1a7b92c2",
"name": "id_and_balance1",
"retryOnFail": true,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"mode": "chooseBranch"
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
6512,
2336
],
"id": "f05d4b0d-3ab2-4473-95a6-f9bbc2b5b215",
"name": "Merge14"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
6016,
2304
],
"id": "02583b19-8326-418a-adc6-9bf99ee0ebe7",
"name": "Merge11"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
2800,
2304
],
"id": "64af0dba-4597-4a15-bf25-ad91c0689cbc",
"name": "No Operation, do nothing"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
6912,
2288
],
"id": "e5c8cdfd-25b2-4211-acc5-4f41338661da",
"name": "Merge12"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
3856,
2288
],
"id": "c2515e25-faaf-467e-8a13-85a37c06fff9",
"name": "Merge13"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "d6fc6a81-7010-4119-9d91-c66d79e68ac8",
"leftValue": "={{ $json.photo_file_id }}",
"rightValue": "t2i",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "6337ea59-4635-406e-89d4-62505dae4f35",
"leftValue": "={{ $json.photo_file_id }}",
"rightValue": "i2i",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "and"
}
}
]
},
"looseTypeValidation": true,
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
4048,
2288
],
"id": "d11b8ffa-f68e-4790-8c70-dea5320bf477",
"name": "Switch14"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
5616,
2288
],
"id": "4d8a9f58-bc22-432a-a2f7-ae46a5cd8d90",
"name": "No Operation, do nothing1"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "d6fc6a81-7010-4119-9d91-c66d79e68ac8",
"leftValue": "={{ $json.photo_file_id }}",
"rightValue": "t2i",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "6337ea59-4635-406e-89d4-62505dae4f35",
"leftValue": "={{ $json.photo_file_id }}",
"rightValue": "i2i",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "and"
}
}
]
},
"looseTypeValidation": true,
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
7104,
2288
],
"id": "03d446b5-b05c-4de8-b967-a2548da0262c",
"name": "Switch"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "b179c4d4-e190-4a40-b8d5-5845171a56fd",
"leftValue": "={{ $json.balance }}",
"rightValue": "={{ $json.price }}",
"operator": {
"type": "number",
"operation": "gte"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "a9f7ce9b-cd18-4138-83f1-8cb70c4643ed",
"leftValue": "={{ $json.balance }}",
"rightValue": "={{ $json.price }}",
"operator": {
"type": "number",
"operation": "lt"
}
}
],
"combinator": "and"
}
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
3360,
2288
],
"id": "e0aec147-f4f0-4d48-a2f8-56e4fbfd113a",
"name": "Switch3"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "de5109f1-817a-4dac-8e36-b93403249092",
"leftValue": "={{ $json.workers.ready }}",
"rightValue": 0,
"operator": {
"type": "number",
"operation": "gt"
}
},
{
"id": "e4d0c933-1e3e-4214-bd45-0fde5fd58217",
"leftValue": "={{ $json.workers.running }}",
"rightValue": 0,
"operator": {
"type": "number",
"operation": "gt"
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
7648,
2288
],
"id": "f928e7a4-5021-4995-936e-c8b2ef2c72c5",
"name": "If"
},
{
"parameters": {
"url": "https://api.runpod.ai/v2/lnswxmxeu2hi7c/health",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer rpa_KCRQ01OGH5HZ2YI1ATBAD5G16TCNGJOYRIDK5WBQzngaw7"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
7472,
2288
],
"id": "ad37e96a-538a-472f-8390-ed4519036370",
"name": "health_check"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
3200,
2288
],
"id": "712d923a-8d9c-46b4-8689-363220a64a7c",
"name": "Merge15"
},
{
"parameters": {
"method": "POST",
"url": "https://api.runpod.ai/v2/lnswxmxeu2hi7c/runsync",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer rpa_KCRQ01OGH5HZ2YI1ATBAD5G16TCNGJOYRIDK5WBQzngaw7"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ $json}}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
8112,
2272
],
"id": "4f93f7c1-3d47-47e1-807b-a1f2d1e85368",
"name": "HTTP Request4",
"disabled": true
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "d6118487-1b89-488d-b480-16427ec08d06",
"leftValue": "={{ $json.status }}",
"rightValue": "COMPLETED",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
8304,
2272
],
"id": "fbb602c4-0f6a-481b-9a43-b639f5dac787",
"name": "If3"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "d6118487-1b89-488d-b480-16427ec08d06",
"leftValue": "={{ $json.status }}",
"rightValue": "IN_QUEUE",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
},
{
"id": "7632558d-cdb3-49e6-9784-85449f8b34ff",
"leftValue": "={{ $json.status }}",
"rightValue": "IN_PROGRESS",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
8512,
2272
],
"id": "30210a19-1e46-48a5-aaca-1543a46b92eb",
"name": "If4"
},
{
"parameters": {
"amount": "=4"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
8720,
2272
],
"id": "b6cc2900-0410-4efb-8d12-079a97c27851",
"name": "Wait1",
"webhookId": "9fd30849-bbbb-464d-afce-e3f08981d3c9"
},
{
"parameters": {
"url": "=https://api.runpod.ai/v2/lnswxmxeu2hi7c/status/{{ $json.id }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer rpa_KCRQ01OGH5HZ2YI1ATBAD5G16TCNGJOYRIDK5WBQzngaw7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
8944,
2272
],
"id": "31034bca-032e-4690-a149-1ae1f642d41e",
"name": "HTTP Request",
"retryOnFail": true
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"input\": {\n \"workflow\": {\n \"51\": {\n \"inputs\": {\n \"samples\": [\n \"795\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEDecode\",\n \"_meta\": {\n \"title\": \"Декодировать VAE\"\n }\n },\n \"94\": {\n \"inputs\": {\n \"clip_name1\": \"clip_l.safetensors\",\n \"clip_name2\": \"t5xxl_fp8_e4m3fn_scaled.safetensors\",\n \"type\": \"flux\",\n \"device\": \"default\"\n },\n \"class_type\": \"DualCLIPLoader\",\n \"_meta\": {\n \"title\": \"Двойной загрузчик CLIP\"\n }\n },\n \"448\": {\n \"inputs\": {\n \"vae_name\": \"flux_vae.safetensors\"\n },\n \"class_type\": \"VAELoader\",\n \"_meta\": {\n \"title\": \"Загрузить VAE\"\n }\n },\n \"451\": {\n \"inputs\": {\n \"guidance\": 4,\n \"conditioning\": [\n \"846\",\n 0\n ]\n },\n \"class_type\": \"FluxGuidance\",\n \"_meta\": {\n \"title\": \"Направление Flux\"\n }\n },\n \"453\": {\n \"inputs\": {\n \"conditioning\": [\n \"846\",\n 0\n ]\n },\n \"class_type\": \"ConditioningZeroOut\",\n \"_meta\": {\n \"title\": \"Обнуление кондиционирования\"\n }\n },\n \"610\": {\n \"inputs\": {\n \"max_shift\": 1.2,\n \"base_shift\": 0.5,\n \"width\": [\n \"852\",\n 0\n ],\n \"height\": [\n \"853\",\n 0\n ],\n \"model\": [\n \"866\",\n 0\n ]\n },\n \"class_type\": \"ModelSamplingFlux\",\n \"_meta\": {\n \"title\": \"Выборка модели Flux\"\n }\n },\n \"661\": {\n \"inputs\": {\n \"text\": \"{{ $json.prompt }}\",\n \"clip\": [\n \"866\",\n 1\n ]\n },\n \"class_type\": \"CLIPTextEncode\",\n \"_meta\": {\n \"title\": \"Кодирование текста CLIP (Запрос)\"\n }\n },\n \"713\": {\n \"inputs\": {\n \"samples\": [\n \"854\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEDecode\",\n \"_meta\": {\n \"title\": \"Декодировать VAE\"\n }\n },\n \"715\": {\n \"inputs\": {\n \"pixels\": [\n \"811\",\n 0\n ],\n \"vae\": [\n \"448\",\n 0\n ]\n },\n \"class_type\": \"VAEEncode\",\n \"_meta\": {\n \"title\": \"Кодировать VAE\"\n }\n },\n \"716\": {\n \"inputs\": {\n \"seed\": 1112142953358039,\n \"steps\": 4,\n \"cfg\": 1,\n \"sampler_name\": \"dpmpp_2m\",\n \"scheduler\": \"simple\",\n \"denoise\": 0.45,\n \"model\": [\n \"610\",\n 0\n ],\n \"positive\": [\n \"451\",\n 0\n ],\n \"negative\": [\n \"453\",\n 0\n ],\n \"latent_image\": [\n \"715\",\n 0\n ]\n },\n \"class_type\": \"KSampler\",\n \"_meta\": {\n \"title\": \"KSampler\"\n }\n },\n \"771\": {\n \"inputs\": {\n \"width\": [\n \"852\",\n 0\n ],\n \"height\": [\n \"853\",\n 0\n ],\n \"batch_size\": 1\n },\n \"class_type\": \"EmptyLatentImage\",\n \"_meta\": {\n \"title\": \"Пустое латентное изображение\"\n }\n },\n \"793\": {\n \"inputs\": {\n \"ckpt_name\": \"flux1-krea-dev_fp8_scaled.safetensors\"\n },\n \"class_type\": \"CheckpointLoaderSimple\",\n \"_meta\": {\n \"title\": \"Загрузить сheckpoint\"\n }\n },\n \"795\": {\n \"inputs\": {\n \"seed\": {{ $json.seed }},\n \"steps\": 8,\n \"cfg\": 1,\n \"sampler_name\": \"euler\",\n \"scheduler\": \"simple\",\n \"denoise\": 1,\n \"model\": [\n \"610\",\n 0\n ],\n \"positive\": [\n \"451\",\n 0\n ],\n \"negative\": [\n \"453\",\n 0\n ],\n \"latent_image\": [\n \"771\",\n 0\n ]\n },\n \"class_type\": \"KSampler\",\n \"_meta\": {\n \"title\": \"KSampler\"\n }\n },\n \"808\": {\n \"inputs\": {\n \"model_name\": \"2xLiveActionV1_SPAN_490000.pth\"\n },\n \"class_type\": \"UpscaleModelLoader\",\n \"_meta\": {\n \"title\": \"Загрузить модель апскейла\"\n }\n },\n \"809\": {\n \"inputs\": {\n \"upscale_model\": [\n \"808\",\n 0\n ],\n \"image\": [\n \"51\",\n 0\n ]\n },\n \"class_type\": \"ImageUpscaleWithModel\",\n \"_meta\": {\n \"title\": \"Апскейл изображения (с использованием модели)\"\n }\n },\n \"811\": {\n \"inputs\": {\n \"upscale_method\": \"lanczos\",\n \"scale_by\": 0.72,\n \"image\": [\n \"809\",\n 0\n ]\n },\n \"class_type\": \"ImageScaleBy\",\n \"_meta\": {\n \"title\": \"Масштабировать изображение на\"\n }\n },\n \"815\": {\n \"inputs\": {\n \"width\": [\n \"836\",\n 0\n ],\n \"height\": [\n \"835\",\n 0\n ],\n \"batch_size\": 1,\n \"color\": 0\n },\n \"class_type\": \"EmptyImage\",\n \"_meta\": {\n \"title\": \"Пустое изображение\"\n }\n },\n \"818\": {\n \"inputs\": {\n \"image\": [\n \"815\",\n 0\n ]\n },\n \"class_type\": \"GetImageSize+\",\n \"_meta\": {\n \"title\": \"🔧 Get Image Size\"\n }\n },\n \"822\": {\n \"inputs\": {\n \"target_width\": [\n \"818\",\n 0\n ],\n \"target_height\": [\n \"818\",\n 1\n ]\n },\n \"class_type\": \"SDXL Recommended Resolution Calc (JPS)\",\n \"_meta\": {\n \"title\": \"SDXL Recommended Resolution Calc (JPS)\"\n }\n },\n \"835\": {\n \"inputs\": {\n \"value\": {{ $json.h }}\n },\n \"class_type\": \"PrimitiveInt\",\n \"_meta\": {\n \"title\": \"Int\"\n }\n },\n \"836\": {\n \"inputs\": {\n \"value\": {{ $json.w }}\n },\n \"class_type\": \"PrimitiveInt\",\n \"_meta\": {\n \"title\": \"Int\"\n }\n },\n \"837\": {\n \"inputs\": {\n \"style_model_name\": \"flux1-redux-dev.safetensors\"\n },\n \"class_type\": \"StyleModelLoader\",\n \"_meta\": {\n \"title\": \"Загрузить модель стиля\"\n }\n },\n \"838\": {\n \"inputs\": {\n \"clip_name\": \"sigclip_vision_patch14_384.safetensors\"\n },\n \"class_type\": \"CLIPVisionLoader\",\n \"_meta\": {\n \"title\": \"Загрузить видение CLIP\"\n }\n },\n \"840\": {\n \"inputs\": {\n \"image\": \"example.png\"\n },\n \"class_type\": \"LoadImage\",\n \"_meta\": {\n \"title\": \"Load Image Prompt\"\n }\n },\n \"846\": {\n \"inputs\": {\n \"boolean\": [\n \"847\",\n 0\n ],\n \"on_true\": [\n \"892\",\n 0\n ],\n \"on_false\": [\n \"661\",\n 0\n ]\n },\n \"class_type\": \"easy ifElse\",\n \"_meta\": {\n \"title\": \"If else\"\n }\n },\n \"847\": {\n \"inputs\": {\n \"int\": [\n \"870\",\n 0\n ]\n },\n \"class_type\": \"Int To Bool (mtb)\",\n \"_meta\": {\n \"title\": \"Int To Bool (mtb)\"\n }\n },\n \"852\": {\n \"inputs\": {\n \"expression\": \"a*1\",\n \"a\": [\n \"822\",\n 0\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"853\": {\n \"inputs\": {\n \"expression\": \"a*1\",\n \"a\": [\n \"822\",\n 1\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"854\": {\n \"inputs\": {\n \"boolean\": {{ $json.quality }},\n \"on_true\": [\n \"716\",\n 0\n ],\n \"on_false\": [\n \"795\",\n 0\n ]\n },\n \"class_type\": \"easy ifElse\",\n \"_meta\": {\n \"title\": \"If else\"\n }\n },\n \"864\": {\n \"inputs\": {\n \"lora_name\": \"diffusion_pytorch_model.safetensors\",\n \"strength_model\": 1,\n \"strength_clip\": 1,\n \"model\": [\n \"793\",\n 0\n ],\n \"clip\": [\n \"94\",\n 0\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"865\": {\n \"inputs\": {\n \"lora_name\": \"nsfw_flux_lora_v1.safetensors\",\n \"strength_model\": -0.3,\n \"strength_clip\": 1,\n \"model\": [\n \"864\",\n 0\n ],\n \"clip\": [\n \"864\",\n 1\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"866\": {\n \"inputs\": {\n \"lora_name\": \"SameFace_Fix.safetensors\",\n \"strength_model\": -0.45,\n \"strength_clip\": 1,\n \"model\": [\n \"865\",\n 0\n ],\n \"clip\": [\n \"865\",\n 1\n ]\n },\n \"class_type\": \"LoraLoader\",\n \"_meta\": {\n \"title\": \"Загрузить LoRA\"\n }\n },\n \"870\": {\n \"inputs\": {\n \"expression\": \"a>0\",\n \"a\": [\n \"891\",\n 0\n ]\n },\n \"class_type\": \"MathExpression|pysssss\",\n \"_meta\": {\n \"title\": \"Math Expression 🐍\"\n }\n },\n \"891\": {\n \"inputs\": {\n \"value\": {{ $json.refInterp }}\n },\n \"class_type\": \"easy float\",\n \"_meta\": {\n \"title\": \"Float\"\n }\n },\n \"892\": {\n \"inputs\": {\n \"downsampling_factor\": [\n \"891\",\n 0\n ],\n \"downsampling_function\": \"area\",\n \"mode\": \"center crop (square)\",\n \"weight\": 1,\n \"autocrop_margin\": 0.1,\n \"conditioning\": [\n \"661\",\n 0\n ],\n \"style_model\": [\n \"837\",\n 0\n ],\n \"clip_vision\": [\n \"838\",\n 0\n ],\n \"image\": [\n \"840\",\n 0\n ]\n },\n \"class_type\": \"ReduxAdvanced\",\n \"_meta\": {\n \"title\": \"ReduxAdvanced\"\n }\n },\n \"894\": {\n \"inputs\": {\n \"text\": \"True\",\n \"anything\": [\n \"847\",\n 0\n ]\n },\n \"class_type\": \"easy showAnything\",\n \"_meta\": {\n \"title\": \"Show Any\"\n }\n },\n \"895\": {\n \"inputs\": {\n \"filename_prefix\": \"ComfyUI\",\n \"images\": [\n \"713\",\n 0\n ]\n },\n \"class_type\": \"SaveImage\",\n \"_meta\": {\n \"title\": \"Сохранить изображение\"\n }\n }\n}\n }\n}",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
7280,
2160
],
"id": "0d289f5f-1892-4e43-9596-1906a6d9824b",
"name": "WF_txt"
},
{
"parameters": {
"chatId": "={{ $json.chatId }}",
"text": "={{ $json.lang === 'en'\n\t? 'Sent to generation, prompt: ' + $json.prompt + '\\n'\n\t\t+ '⚡Charged ' + $json.price + ' credits.\\n'\n\t\t+ '💰Balance ' + $json.balance + ' credits.'\n\t: 'Отправлено на генерацию, промт: ' + $json.prompt + '\\n'\n\t\t+ '⚡Списано ' + $json.price + ' Кредитов.\\n'\n\t\t+ '💰Баланс ' + $json.balance + ' Кредитов.'\n}}",
"additionalFields": {
"appendAttribution": false
}
},
"id": "7b25bd1c-c883-4327-b462-aa4b34e9bb9d",
"name": "Telegram30",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
6256,
2128
],
"webhookId": "28a1cc26-6d21-4d26-b7a0-b44c07ab62f8",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "4f2c9aac-1eab-4828-b0e7-66e4f61d168c",
"name": "message_id",
"value": "={{ $json.result.message_id }}",
"type": "number"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
6736,
2128
],
"id": "fd27b792-0a60-40ab-9333-4f57e82083d3",
"name": "del_m1"
},
{
"parameters": {
"operation": "sendSticker",
"chatId": "={{ $('Merge11').item.json.chatId }}",
"file": "CAACAgIAAxkBAAIDgmjU7Q8JXli4dNnce74U4jcRozo2AAK0IwACmEspSN65vs0qW-TZNgQ",
"additionalFields": {
"disable_notification": true
}
},
"id": "4f2b8302-2a06-43fc-96d5-6b96913c71d0",
"name": "Telegram38",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
6512,
2128
],
"webhookId": "fea47c70-ab8e-426c-967a-1b46c5bf1343",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"method": "PATCH",
"url": "=https://bwbsclwdkighhzlyiman.supabase.co/rest/v1/tasks?id=eq.{{ $item(0).$node['task_create'].json.id }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": " application/json"
},
{
"name": "Prefer",
"value": "return=representation"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"status\": \"success\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
9328,
2096
],
"id": "411df4c2-db8c-435d-a3ac-04b2dba735fc",
"name": "status_to_success",
"alwaysOutputData": false,
"credentials": {
"supabaseApi": {
"id": "jGgpXKPYHiL193Rz",
"name": "Supabase account"
}
}
},
{
"parameters": {
"operation": "sendPhoto",
"chatId": "={{ $('Merge11').item.json.chatId }}",
"binaryData": true,
"additionalFields": {}
},
"id": "ebb0a990-7f43-4765-a73b-6fecc0244953",
"name": "Telegram6",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
8944,
1888
],
"webhookId": "95a1706a-e942-4ab5-9b0b-1cae74def65c",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"operation": "toBinary",
"sourceProperty": "output.images[0].data",
"options": {
"fileName": "={{ $json.output.images[0].filename }}",
"mimeType": "image/png"
}
},
"id": "8474318f-b652-44e9-b0bc-9b88c14cab82",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
8752,
1888
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "de5109f1-817a-4dac-8e36-b93403249092",
"leftValue": "={{ $json.output.images[0].filename }}",
"rightValue": 0,
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
8512,
1888
],
"id": "345606d6-bb39-4ba0-a2be-4aa3cf56038a",
"name": "If1"
},
{
"parameters": {
"operation": "deleteMessage",
"chatId": "={{ $('Merge12').item.json.chatId }}",
"messageId": "={{ $('Merge12').item.json.message_id }}"
},
"id": "812d2416-456f-43a7-9edf-1aaf72233f6d",
"name": "Telegram39",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
9328,
1680
],
"webhookId": "14827afa-712f-4136-9090-394c5cddadb0",
"credentials": {
"telegramApi": {
"id": "ur7jSUPdiAaPVhCf",
"name": "Geni AI"
}
}
},
{
"parameters": {
"inputSource": "passthrough"
},
"id": "1de73718-fa00-420e-9739-91b3c1f38ef2",
"typeVersion": 1.1,
"name": "Start",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
2592,
2304
]
},
{
"parameters": {
"includeOtherFields": true,
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
9328,
1888
],
"id": "07b821b9-9740-443a-9b40-1a7fb0dfc196",
"name": "Return",
"disabled": true
}
],
"connections": {
"Telegram6": {
"main": [
[
{
"node": "status_to_success",
"type": "main",
"index": 0
},
{
"node": "Telegram39",
"type": "main",
"index": 0
},
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Get a file2": {
"main": [
[
{
"node": "Set Chat ID1",
"type": "main",
"index": 0
}
]
]
},
"Set Chat ID1": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Edit Fields9",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields9": {
"main": [
[
{
"node": "photo array",
"type": "main",
"index": 0
}
]
]
},
"Telegram30": {
"main": [
[
{
"node": "Telegram38",
"type": "main",
"index": 0
}
]
]
},
"photo array": {
"main": [
[
{
"node": "Merge4",
"type": "main",
"index": 1
}
]
]
},
"wallet_debit": {
"main": [
[
{
"node": "Merge11",
"type": "main",
"index": 1
}
]
]
},
"Merge11": {
"main": [
[
{
"node": "wallet_credit_refund3",
"type": "main",
"index": 0
},
{
"node": "Telegram30",
"type": "main",
"index": 0
},
{
"node": "Merge14",
"type": "main",
"index": 0
}
]
]
},
"task_create": {
"main": [
[
{
"node": "Merge13",
"type": "main",
"index": 1
}
]
]
},
"del_m1": {
"main": [
[
{
"node": "Merge12",
"type": "main",
"index": 0
}
]
]
},
"Merge12": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Merge13": {
"main": [
[
{
"node": "Switch14",
"type": "main",
"index": 0
}
]
]
},
"Switch14": {
"main": [
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
],
[
{
"node": "Get a file2",
"type": "main",
"index": 0
},
{
"node": "Merge4",
"type": "main",
"index": 0
}
]
]
},
"No Operation, do nothing1": {
"main": [
[
{
"node": "Merge11",
"type": "main",
"index": 0
},
{
"node": "wallet_debit",
"type": "main",
"index": 0
}
]
]
},
"Merge4": {
"main": [
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
]
]
},
"wallet_credit_refund3": {
"main": [
[
{
"node": "Merge14",
"type": "main",
"index": 1
}
]
]
},
"Telegram38": {
"main": [
[
{
"node": "del_m1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request4": {
"main": [
[
{
"node": "If3",
"type": "main",
"index": 0
}
]
]
},
"Convert to File": {
"main": [
[
{
"node": "Telegram6",
"type": "main",
"index": 0
}
]
]
},
"If3": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
],
[
{
"node": "If4",
"type": "main",
"index": 0
}
]
]
},
"If4": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
],
[
{
"node": "wallet_credit_refund",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "If3",
"type": "main",
"index": 0
}
]
]
},
"WF_img": {
"main": [
[
{
"node": "health_check",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "WF_txt",
"type": "main",
"index": 0
}
],
[
{
"node": "WF_img",
"type": "main",
"index": 0
}
]
]
},
"WF_txt": {
"main": [
[
{
"node": "health_check",
"type": "main",
"index": 0
}
]
]
},
"wallet_credit_refund": {
"main": [
[
{
"node": "Telegram37",
"type": "main",
"index": 0
},
{
"node": "refund_status",
"type": "main",
"index": 0
}
]
]
},
"Telegram37": {
"main": [
[
{
"node": "Telegram39",
"type": "main",
"index": 0
},
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Switch3": {
"main": [
[
{
"node": "Merge13",
"type": "main",
"index": 0
},
{
"node": "task_create",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram35",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "HTTP Request4",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"health_check": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Telegram": {
"main": [
[
{
"node": "HTTP Request4",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
],
[
{
"node": "wallet_credit_refund",
"type": "main",
"index": 0
}
]
]
},
"Merge14": {
"main": [
[
{
"node": "Merge12",
"type": "main",
"index": 1
}
]
]
},
"id_and_balance1": {
"main": [
[
{
"node": "Merge15",
"type": "main",
"index": 1
}
]
]
},
"Merge15": {
"main": [
[
{
"node": "Switch3",
"type": "main",
"index": 0
}
]
]
},
"No Operation, do nothing": {
"main": [
[
{
"node": "id_and_balance1",
"type": "main",
"index": 0
},
{
"node": "Merge15",
"type": "main",
"index": 0
}
]
]
},
"Start": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"meta": null,
"pinData": {},
"versionId": "1618ba9f-cb32-49ef-a524-4784ee55493b",
"activeVersionId": null,
"versionCounter": 5,
"triggerCount": 0,
"shared": [
{
"updatedAt": "2025-12-09T17:51:41.681Z",
"createdAt": "2025-12-09T17:51:41.681Z",
"role": "workflow:owner",
"workflowId": "leS7vcfjDNDlHg0o",
"projectId": "MHclKTSzdRCLxmxU",
"project": {
"updatedAt": "2025-05-06T12:49:51.317Z",
"createdAt": "2025-05-06T12:48:38.577Z",
"id": "MHclKTSzdRCLxmxU",
"name": "Grigoriy Voyakin <grigoriyvoyakinwork@gmail.com>",
"type": "personal",
"icon": null,
"description": null,
"projectRelations": [
{
"updatedAt": "2025-05-06T12:48:38.577Z",
"createdAt": "2025-05-06T12:48:38.577Z",
"userId": "15659665-1e18-4119-8f87-b50a3cb257b7",
"projectId": "MHclKTSzdRCLxmxU",
"user": {
"updatedAt": "2025-12-10T02:57:46.000Z",
"createdAt": "2025-05-06T12:48:38.340Z",
"id": "15659665-1e18-4119-8f87-b50a3cb257b7",
"email": "grigoriyvoyakinwork@gmail.com",
"firstName": "Grigoriy",
"lastName": "Voyakin",
"personalizationAnswers": {
"version": "v4",
"personalization_survey_submitted_at": "2025-05-09T12:49:28.002Z",
"personalization_survey_n8n_version": "1.91.3"
},
"settings": {
"userActivated": true,
"easyAIWorkflowOnboarded": true,
"firstSuccessfulWorkflowId": "6ndVsjNc12yZ7vD6",
"userActivatedAt": 1747397744116,
"npsSurvey": {
"responded": true,
"lastShownAt": 1756144477136
}
},
"disabled": false,
"mfaEnabled": false,
"lastActiveAt": "2025-12-09",
"isPending": false
}
}
]
}
}
],
"tags": [
{
"updatedAt": "2025-10-29T09:15:49.403Z",
"createdAt": "2025-10-29T09:15:49.403Z",
"id": "NFsjRzvK9b3zMBTF",
"name": "docs"
}
],
"activeVersion": null
}