{
  "id": "ao9ZV2CMJSI4HjOc",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Telegram tasker bot",
  "tags": [],
  "nodes": [
    {
      "id": "6e003a17-2caa-45d3-8ba6-6ff1fdb0c0fe",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        700,
        160
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "61bd5cc5-487f-48f2-8b39-2291ae7c5374",
      "name": "Create Trello Card",
      "type": "n8n-nodes-base.trello",
      "maxTries": 5,
      "position": [
        1980,
        160
      ],
      "parameters": {
        "name": "={{ $json.name }}",
        "listId": "64a39a922fd043526af50b36",
        "description": "={{ $json.description }}",
        "additionalFields": {}
      },
      "credentials": {
        "trelloApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "48d69373-c391-4be0-adb5-776088e500ba",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        1320,
        360
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1696acb6-0917-42d6-81d8-e8666a5973a0",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1380,
        160
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=\u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0434\u0430\u0442\u0430: {{$today}}   (\u0444\u043e\u0440\u043c\u0430\u0442 YYYY-MM-DD)\n\n\u0422\u044b \u2014 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442-\u043f\u0430\u0440\u0441\u0435\u0440. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0448\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0448\u044c\n\u041e\u0414\u041d\u0423 \u0441\u0442\u0440\u043e\u043a\u0443 JSON \u0440\u043e\u0432\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435:\n{\"name\":\"\u2026\",\"description\":\"\u2026\",\"date_start\":\"\u2026\",\"date_end\":\"\u2026\"}\n\n\u041f\u0440\u0430\u0432\u0438\u043b\u0430\n1. name \u2014 \u0434\u043e 8-10 \u0441\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u0430\u043b\u043e, \u043f\u0438\u0448\u0438 \"\u041e\u0431\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430\".\n2. description \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.\n3. \u0414\u0430\u0442\u044b:\n   \u25b8 \u041b\u044e\u0431\u044b\u0435 \u0434\u0430\u0442\u044b \u0432\u044b\u0432\u043e\u0434\u0438 \u0447\u0438\u0441\u043b\u043e\u043c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 YYYY-MM-DD.  \n   \u25b8 \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u0439 \u0442\u0430\u043a:\n       \u00ab\u0441\u0435\u0433\u043e\u0434\u043d\u044f\u00bb   \u2192 {{$today}}\n       \u00ab\u0437\u0430\u0432\u0442\u0440\u0430\u00bb    \u2192 {{$today+1}}\n       \u00ab\u043f\u043e\u0441\u043b\u0435\u0437\u0430\u0432\u0442\u0440\u0430\u00bb \u2192 {{$today+2}}\n       \u00ab\u0447\u0435\u0440\u0435\u0437 N \u0434\u043d\u0435\u0439\u00bb \u2192 {{$today+N}}\n   \u25b8 \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d (\u00ab\u0441 1 \u043f\u043e 5 \u0438\u044e\u043b\u044f\u00bb) \u2014 date_start = \u043f\u0435\u0440\u0432\u0430\u044f \u0434\u0430\u0442\u0430,\n     date_end = \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f.  \n   \u25b8 \u041e\u0434\u043d\u0430 \u0434\u0430\u0442\u0430? \u0417\u0430\u043f\u0438\u0448\u0438 \u0435\u0451 \u0432 date_start, \u0430 date_end \u043e\u0441\u0442\u0430\u0432\u044c \"\".\n   \u25b8 \u041d\u0435\u0442 \u0434\u0430\u0442 \u2014 \u043e\u0431\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0443\u0441\u0442\u044b\u0435.\n4. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043d\u0435 JSON, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\n\n\u041f\u0440\u0438\u043c\u0435\u0440\u044b  \n\u0412\u0445\u043e\u0434: \u00ab\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0432\u0442\u0440\u0430 \u0440\u0435\u043c\u043e\u043d\u0442 \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\u00bb  \n\u0412\u044b\u0445\u043e\u0434: {\"name\":\"\u0420\u0435\u043c\u043e\u043d\u0442 \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\",\"description\":\"\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0432\u0442\u0440\u0430 \u0440\u0435\u043c\u043e\u043d\u0442 \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\",\"date_start\":\"{{$today+1}}\",\"date_end\":\"\"}\n\n\u0412\u0445\u043e\u0434: \u00ab\u041e\u0442\u0447\u0451\u0442 \u0441 1 \u043f\u043e 5 \u0438\u044e\u043b\u044f\u00bb  \n\u0412\u044b\u0445\u043e\u0434: {\"name\":\"\u041e\u0442\u0447\u0451\u0442 \u0437\u0430 1-5 \u0438\u044e\u043b\u044f\",\"description\":\"\u041e\u0442\u0447\u0451\u0442 \u0441 1 \u043f\u043e 5 \u0438\u044e\u043b\u044f\",\"date_start\":\"2025-07-01\",\"date_end\":\"2025-07-05\"}\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "04dcbefa-57ac-4ad5-a826-db5092dbc227",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1480,
        360
      ],
      "parameters": {
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.from.username }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "85f2cf10-c37e-409f-acbc-86a3e0c6eadc",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2640,
        320
      ],
      "parameters": {
        "errorMessage": "Task creation failed"
      },
      "typeVersion": 1
    },
    {
      "id": "0e58a91d-779b-46a4-ae16-fc106c882c41",
      "name": "Send task message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2420,
        140
      ],
      "parameters": {
        "text": "=\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430:  {{ $json.name }}\n\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443: {{ $('Create Trello Card').item.json.url }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $('Telegram Trigger').item.json.message.message_id }}",
          "disable_notification": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3eecd42f-23e3-466e-9e1a-e34f5f48fd99",
      "name": "Send error message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2420,
        320
      ],
      "parameters": {
        "text": "=\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $('Telegram Trigger').item.json.message.message_id }}",
          "disable_notification": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "58a1cde2-b9a9-445a-ba7e-686b50b1646b",
      "name": "If trello card id exists",
      "type": "n8n-nodes-base.if",
      "position": [
        2180,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a5cef062-5441-4a6c-a3ce-f9852844701b",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "60f66d20-165c-4eb6-8314-e07a0a9d602c",
      "name": "Parse to json",
      "type": "n8n-nodes-base.code",
      "position": [
        1780,
        160
      ],
      "parameters": {
        "jsCode": "const data = JSON.parse($input.first().json.output);   // text \u2014 \u043e\u0442\u0432\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438\nreturn [{ json: data }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c18beb1f-308b-4be7-8e96-e00a5b30c314",
      "name": "Transcriber",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1120,
        160
      ],
      "parameters": {
        "options": {
          "language": "ru",
          "temperature": 0
        },
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "b4c68ea4-0317-4f54-ae1f-d3cb69e75100",
      "name": "Get audio",
      "type": "n8n-nodes-base.telegram",
      "position": [
        900,
        160
      ],
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ae72f36e-da67-4844-9723-e915e2869d9d",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Parse to json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get audio": {
      "main": [
        [
          {
            "node": "Transcriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcriber": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse to json": {
      "main": [
        [
          {
            "node": "Create Trello Card",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Get audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Trello Card": {
      "main": [
        [
          {
            "node": "If trello card id exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send error message": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If trello card id exists": {
      "main": [
        [
          {
            "node": "Send task message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}