8
n8n 한국어amn8n.com

버퍼링 기능이 있는 Telegram 채팅

고급

이것은Building Blocks, AI분야의자동화 워크플로우로, 22개의 노드를 포함합니다.주로 If, Sort, Wait, Supabase, Telegram 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. 사용자가 Telegram에서 AI 에이전트로 메시지 시퀀스 전송 허용

사전 요구사항
  • Supabase URL과 API Key
  • Telegram Bot Token
  • OpenAI API Key
  • PostgreSQL 데이터베이스 연결 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "DnHvQ3KL8v8r5L5Z",
  "meta": {
    "instanceId": "ac63467607103d9c95dd644384984672b90b1cb03e07edbaf18fe72b2a6c45bb",
    "templateCredsSetupCompleted": true
  },
  "name": "Telegram Chat with Buffering",
  "tags": [],
  "nodes": [
    {
      "id": "a3cc74e9-c696-48de-a04e-d48555641897",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1640,
        -800
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 280,
        "content": "## 1. Receive Message\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ff18667d-0a31-4768-acf8-ed0d53b2f382",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -840
      ],
      "parameters": {
        "color": 7,
        "width": 600,
        "height": 520,
        "content": "## 3. AI Assistant\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ce90f954-19b6-4224-ae88-b20c4da639e6",
      "name": "답장",
      "type": "n8n-nodes-base.telegram",
      "position": [
        920,
        -700
      ],
      "webhookId": "e3313c88-0d56-4d06-81cf-b48870dfe2fe",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Receive Message').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "lvrGkOs0ywXp5agp",
          "name": "Telegram bsde.ai"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6f46d89b-034c-47ea-a217-8d007bec1531",
      "name": "메시지 수신",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1580,
        -680
      ],
      "webhookId": "5047a673-ca1d-4e87-b51b-893108de0a59",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "lvrGkOs0ywXp5agp",
          "name": "Telegram bsde.ai"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "0f391daa-0e74-4058-8923-52f3c050c9ad",
      "name": "10초 대기",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1000,
        -580
      ],
      "webhookId": "87994c9a-fd20-48b6-8dbe-9af36dc40b2f",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "8e6495d8-db6e-4692-ade5-45239049de34",
      "name": "스티키 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1320,
        -760
      ],
      "parameters": {
        "color": 7,
        "width": 1400,
        "height": 440,
        "content": "## 2. Buffer Incoming Messages"
      },
      "typeVersion": 1
    },
    {
      "id": "d4876fd2-2e0b-4f82-9dc3-553f926310bd",
      "name": "대기 메시지 추가",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1240,
        -680
      ],
      "parameters": {
        "tableId": "message_queue",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "user_id",
              "fieldValue": "={{ $json.message.chat.id }}"
            },
            {
              "fieldId": "message",
              "fieldValue": "={{ $json.message.text }}"
            },
            {
              "fieldId": "message_id",
              "fieldValue": "={{ $json.message.message_id }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "1iEg1EzFrF29iqp2",
          "name": "Supabase (bsde.ai)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a2eeb77f-2d74-44ac-9812-c3659d2e2803",
      "name": "작업 없음, 아무 동작 안 함",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -340,
        -460
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "638fc82e-aba1-4deb-b506-33dcf4746896",
      "name": "집계",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        220,
        -700
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "message"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "772f60e5-e52f-4779-aa03-e4d532ee4b5c",
      "name": "대기 메시지 삭제",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -100,
        -700
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "user_id",
              "keyValue": "={{ $json.user_id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "message_queue",
        "operation": "delete"
      },
      "credentials": {
        "supabaseApi": {
          "id": "1iEg1EzFrF29iqp2",
          "name": "Supabase (bsde.ai)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "16b46a70-85a0-4c8c-94ba-172ebe9aafa4",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -780
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 260,
        "content": "## 4. Send Reply\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9162f110-465f-4cd6-9f03-17751d7e43a4",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        380,
        -460
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "1OMpAMAKR9l3eUDI",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b47ef0c9-725b-4837-b9e9-96a4ff2b3636",
      "name": "메시지 ID로 정렬",
      "type": "n8n-nodes-base.sort",
      "position": [
        -580,
        -680
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "message_id"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1aa80c99-eec8-4174-bcf3-c6873354ed0f",
      "name": "대기 메시지 가져오기",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -780,
        -680
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "user_id",
              "keyValue": "={{ $('Receive Message').item.json.message.from.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "message_queue",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "supabaseApi": {
          "id": "1iEg1EzFrF29iqp2",
          "name": "Supabase (bsde.ai)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "85050328-b5aa-47fe-802c-7d9f31f225cb",
      "name": "최신 메시지 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        -360,
        -680
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8852bab7-230e-442a-a4a2-994e979c8f9f",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $input.last().json.message_id }}\n",
              "rightValue": "={{ $('Receive Message').item.json.message.message_id }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "bed86d81-bb57-42ce-aaa7-4bdc21e1651c",
      "name": "AI 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        420,
        -700
      ],
      "parameters": {
        "text": "={{ $json.message.join(String.fromCharCode(10)) }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "4f468a14-fbea-44ec-a2b8-e4b3785c0362",
      "name": "Postgres 채팅 메모리",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        560,
        -460
      ],
      "parameters": {
        "sessionKey": "={{ $('Receive Message').item.json.message.chat.id }}",
        "sessionIdType": "customKey"
      },
      "credentials": {
        "postgres": {
          "id": "tzLXHvhykxvYghPC",
          "name": "bsde.ai Supabase (Session Pooler)"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "610516e8-d4ad-448e-ac97-17aad1a31862",
      "name": "스티키 노트4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        -820
      ],
      "parameters": {
        "width": 700,
        "height": 420,
        "content": "## Allow Users to Send a Sequence of Messages to an AI Agent in Telegram with Supabase\n### Use Case\nWhen creating chatbots that interface through applications such as **Telegram** and **WhatsApp**, users can often sends multiple shorter messages in quick succession, in place of a single, longer message. This workflow accounts for this behaviour.\n### What it Does\nThis workflow allows users to send several messages in quick succession, treating them as one coherent conversation instead of separate messages requiring individual responses. \n### How it Works\n1. When messages arrive, they are stored in a **Supabase PostgreSQL** table\n2. The system waits briefly to see if additional messages arrive\n3. If no new messages arrive within the waiting period, all queued messages are:\n   - Combined and processed as a single conversation\n   - Responded to with one unified reply\n   - Deleted from the queue"
      },
      "typeVersion": 1
    },
    {
      "id": "c8bd8777-fb0f-4941-8674-f5bb7c264506",
      "name": "스티키 노트5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1640,
        -1060
      ],
      "parameters": {
        "width": 520,
        "height": 220,
        "content": "### Setup\n1. Create a table in Supabase called **message_queue**. It needs to have the following columns: **user_id** (`uint8`), **message** (`text`), and **message_id** (`uint8`)\n2. Add your **Telegram**, **Supabase**, **OpenAI**, and **PostgreSQL** credentials\n3. Activate the workflow and test by sending multiple messages the Telegram bot in one go\n4. Wait ten seconds after which you will receive a single reply to all of your messages"
      },
      "typeVersion": 1
    },
    {
      "id": "24604fc7-7957-4e20-8303-b31f2ce1e257",
      "name": "스티키 노트6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        -700
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 280,
        "content": "### Modification\nChange the value of *Wait Amount* to vary the buffering window"
      },
      "typeVersion": 1
    },
    {
      "id": "24f388f3-5655-4bd4-9c30-978efb2dc400",
      "name": "스티키 노트8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 140,
        "content": "### Modification\nReplace this sub-node \nto use a different language\n model"
      },
      "typeVersion": 1
    },
    {
      "id": "3db12526-6b97-4e3a-b53d-987f5d20c46e",
      "name": "스티키 노트9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -800
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 240,
        "content": "### Modification\nAdd a **System Message** to tailor the chatbot to your use case"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "e415eb18-1bb9-426b-b759-0ba269db1f8f",
  "connections": {
    "bed86d81-bb57-42ce-aaa7-4bdc21e1651c": {
      "main": [
        [
          {
            "node": "ce90f954-19b6-4224-ae88-b20c4da639e6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "638fc82e-aba1-4deb-b506-33dcf4746896": {
      "main": [
        [
          {
            "node": "bed86d81-bb57-42ce-aaa7-4bdc21e1651c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6f46d89b-034c-47ea-a217-8d007bec1531": {
      "main": [
        [
          {
            "node": "d4876fd2-2e0b-4f82-9dc3-553f926310bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0f391daa-0e74-4058-8923-52f3c050c9ad": {
      "main": [
        [
          {
            "node": "1aa80c99-eec8-4174-bcf3-c6873354ed0f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9162f110-465f-4cd6-9f03-17751d7e43a4": {
      "ai_languageModel": [
        [
          {
            "node": "bed86d81-bb57-42ce-aaa7-4bdc21e1651c",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "b47ef0c9-725b-4837-b9e9-96a4ff2b3636": {
      "main": [
        [
          {
            "node": "85050328-b5aa-47fe-802c-7d9f31f225cb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1aa80c99-eec8-4174-bcf3-c6873354ed0f": {
      "main": [
        [
          {
            "node": "b47ef0c9-725b-4837-b9e9-96a4ff2b3636",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4f468a14-fbea-44ec-a2b8-e4b3785c0362": {
      "ai_memory": [
        [
          {
            "node": "bed86d81-bb57-42ce-aaa7-4bdc21e1651c",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "d4876fd2-2e0b-4f82-9dc3-553f926310bd": {
      "main": [
        [
          {
            "node": "0f391daa-0e74-4058-8923-52f3c050c9ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "772f60e5-e52f-4779-aa03-e4d532ee4b5c": {
      "main": [
        [
          {
            "node": "638fc82e-aba1-4deb-b506-33dcf4746896",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "85050328-b5aa-47fe-802c-7d9f31f225cb": {
      "main": [
        [
          {
            "node": "772f60e5-e52f-4779-aa03-e4d532ee4b5c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "a2eeb77f-2d74-44ac-9812-c3659d2e2803",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 빌딩 블록, 인공지능

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수22
카테고리2
노드 유형12
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

저자
Chris Carr

Chris Carr

@chriscarr

Founder of bsde.ai, a workflow and AI agency based in the UK.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34