25. Twilio와 Redis를 사용하여 고객 채팅 경험 강화
고급
이것은Support, Product, AI분야의자동화 워크플로우로, 18개의 노드를 포함합니다.주로 If, Set, Wait, Redis, Twilio 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. 사용Twilio및Redis缓冲메시지功能增强고객채팅体验
사전 요구사항
- •Redis 서버 연결 정보
- •OpenAI API Key
사용된 노드 (18)
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"meta": {
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
},
"nodes": [
{
"id": "d61d8ff3-532a-4b0d-a5a7-e02d2e79ddce",
"name": "OpenAI 채팅 모델",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2660,
480
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "b6d5c1cf-b4a1-4901-b001-0c375747ee63",
"name": "작업 없음, 아무 동작도 하지 않음",
"type": "n8n-nodes-base.noOp",
"position": [
1660,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f4e08e32-bb96-4b5d-852e-26ad6fec3c8c",
"name": "메시지 스택에 추가",
"type": "n8n-nodes-base.redis",
"position": [
1340,
200
],
"parameters": {
"list": "=chat-buffer:{{ $json.From }}",
"tail": true,
"operation": "push",
"messageData": "={{ $json.Body }}"
},
"credentials": {
"redis": {
"id": "zU4DA70qSDrZM1El",
"name": "Redis account"
}
},
"typeVersion": 1
},
{
"id": "181ae99e-ebe7-4e99-b5a5-999acc249621",
"name": "계속 진행해야 하나요?",
"type": "n8n-nodes-base.if",
"position": [
1660,
360
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ec39573f-f92a-4fe4-a832-0a137de8e7d0",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Get Latest Message Stack').item.json.messages.last() }}",
"rightValue": "={{ $('Twilio Trigger').item.json.Body }}"
}
]
}
},
"typeVersion": 2
},
{
"id": "640c63ca-2798-48a9-8484-b834c1a36301",
"name": "윈도우 버퍼 메모리",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2780,
480
],
"parameters": {
"sessionKey": "=chat-debouncer:{{ $('Twilio Trigger').item.json.From }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "123c35c5-f7b2-4b4d-b220-0e5273e25115",
"name": "Twilio 트리거",
"type": "n8n-nodes-base.twilioTrigger",
"position": [
940,
360
],
"webhookId": "0ca3da0e-e4e1-4e94-8380-06207bf9b429",
"parameters": {
"updates": [
"com.twilio.messaging.inbound-message.received"
]
},
"credentials": {
"twilioApi": {
"id": "TJv4H4lXxPCLZT50",
"name": "Twilio account"
}
},
"typeVersion": 1
},
{
"id": "f4e86455-7f4d-4401-8f61-a859be1433a9",
"name": "최신 메시지 스택 가져오기",
"type": "n8n-nodes-base.redis",
"position": [
1500,
360
],
"parameters": {
"key": "=chat-buffer:{{ $json.From }}",
"keyType": "list",
"options": {},
"operation": "get",
"propertyName": "messages"
},
"credentials": {
"redis": {
"id": "zU4DA70qSDrZM1El",
"name": "Redis account"
}
},
"typeVersion": 1,
"alwaysOutputData": false
},
{
"id": "02f8e7f5-12b4-4a5a-9ce9-5f0558e447aa",
"name": "스티커 메모",
"type": "n8n-nodes-base.stickyNote",
"position": [
1232.162872321277,
-50.203627749982275
],
"parameters": {
"color": 7,
"width": 632.8309394802918,
"height": 766.7069233634998,
"content": "## Step 2. Buffer Incoming Messages\n[Learn more about using Redis](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.redis)\n\n* New messages are captured into a list.\n* After X seconds, we get a fresh copy of this list\n* If the last message on the list is the same as the incoming message, then we know no new follow-on messages were sent within the last 5 seconds. Hence the user should be waiting and it is safe to reply.\n* But if the reverse is true, then we will abort the execution here."
},
"typeVersion": 1
},
{
"id": "311c0d69-a735-4435-91b6-e80bf7d4c012",
"name": "응답 전송",
"type": "n8n-nodes-base.twilio",
"position": [
3000,
320
],
"parameters": {
"to": "={{ $('Twilio Trigger').item.json.From }}",
"from": "={{ $('Twilio Trigger').item.json.To }}",
"message": "={{ $json.output }}",
"options": {}
},
"credentials": {
"twilioApi": {
"id": "TJv4H4lXxPCLZT50",
"name": "Twilio account"
}
},
"typeVersion": 1
},
{
"id": "c0e0cd08-66e3-4ca3-9441-8436c0d9e664",
"name": "5초 대기",
"type": "n8n-nodes-base.wait",
"position": [
1340,
360
],
"webhookId": "d486979c-8074-4ecb-958e-fcb24455086b",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "c7959fa2-69a5-46b4-8e67-1ef824860f4e",
"name": "채팅 기록 가져오기",
"type": "@n8n/n8n-nodes-langchain.memoryManager",
"position": [
2000,
280
],
"parameters": {
"options": {
"groupMessages": true
}
},
"typeVersion": 1.1
},
{
"id": "55933c54-5546-4770-8b36-a31496163528",
"name": "윈도우 버퍼 메모리1",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2000,
420
],
"parameters": {
"sessionKey": "=chat-debouncer:{{ $('Twilio Trigger').item.json.From }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "459c0181-d239-4eec-88b6-c9603868d518",
"name": "스티커 메모1",
"type": "n8n-nodes-base.stickyNote",
"position": [
774.3250485705519,
198.07493876489747
],
"parameters": {
"color": 7,
"width": 431.1629802181097,
"height": 357.49804533541777,
"content": "## Step 1. Listen for Twilio Messages\n[Read more about Twilio Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.twiliotrigger)\n\nIn this example, we'll use the sender's phone number as the session ID. This will be important in retrieving chat history."
},
"typeVersion": 1
},
{
"id": "e06313a9-066a-4387-a36c-a6c6ff57d6f9",
"name": "스티커 메모2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1900,
80
],
"parameters": {
"color": 7,
"width": 618.970917763344,
"height": 501.77420646931444,
"content": "## Step 3. Get Messages Since Last Reply\n[Read more about using Chat Memory](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorymanager)\n\nOnce conditions are met and we allow the agent to reply, we'll need to find the bot's last reply and work out the buffer of user messages since then. We can do this by looking using chat memory and comparing this to the latest message in our redis messages stack."
},
"typeVersion": 1
},
{
"id": "601a71f6-c6f8-4b73-98c7-cfa11b1facaa",
"name": "메시지 버퍼 가져오기",
"type": "n8n-nodes-base.set",
"position": [
2320,
280
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "01434acb-c224-46d2-99b0-7a81a2bb50c5",
"name": "messages",
"type": "string",
"value": "={{\n$('Get Latest Message Stack').item.json.messages\n .slice(\n $('Get Latest Message Stack').item.json.messages.lastIndexOf(\n $('Get Chat History').item.json.messages.last().human\n || $('Twilio Trigger').item.json.chatInput\n ),\n $('Get Latest Message Stack').item.json.messages.length\n )\n .join('\\n')\n}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9e49f2de-89e6-4152-8e9c-ed47c5fc4654",
"name": "스티커 메모3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2549,
120
],
"parameters": {
"color": 7,
"width": 670.2274698011594,
"height": 522.5993538768389,
"content": "## Step 4. Send Single Agent Reply For Many Messages\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)\n\nFinally, our buffered messages are sent to the AI Agent that can formulate a single response for all. This could potentially improve the conversation experience if the chat interaction is naturally more rapid and spontaneous. A drawback however is that responses could be feel much slower - tweak the wait threshold to suit your needs!"
},
"typeVersion": 1
},
{
"id": "be13c74a-467c-4ab1-acca-44878c68dba4",
"name": "스티커 메모4",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
80
],
"parameters": {
"width": 375.55385425077225,
"height": 486.69228315530853,
"content": "## Try It Out!\n### This workflow demonstrates a simple approach to stagger an AI Agent's reply if users often send in a sequence of partial messages and in short bursts.\n\n* Twilio webhook receives user's messages which are recorded in a message stack powered by Redis.\n* The execution is immediately paused for 5 seconds and then another check is done against the message stack for the latest message.\n* The purpose of this check lets use know if the user is sending more messages or if they are waiting for a reply.\n* The execution is aborted if the latest message on the stack differs from the incoming message and continues if they are the same.\n* For the latter, the agent receives buffered messages and is able to respond to all in a single reply."
},
"typeVersion": 1
},
{
"id": "334d38e1-ec16-46f2-a57d-bf531adb8d3d",
"name": "AI 에이전트",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2660,
320
],
"parameters": {
"text": "={{ $json.messages }}",
"agent": "conversationalAgent",
"options": {},
"promptType": "define"
},
"typeVersion": 1.6
}
],
"pinData": {},
"connections": {
"334d38e1-ec16-46f2-a57d-bf531adb8d3d": {
"main": [
[
{
"node": "311c0d69-a735-4435-91b6-e80bf7d4c012",
"type": "main",
"index": 0
}
]
]
},
"123c35c5-f7b2-4b4d-b220-0e5273e25115": {
"main": [
[
{
"node": "f4e08e32-bb96-4b5d-852e-26ad6fec3c8c",
"type": "main",
"index": 0
},
{
"node": "c0e0cd08-66e3-4ca3-9441-8436c0d9e664",
"type": "main",
"index": 0
}
]
]
},
"c0e0cd08-66e3-4ca3-9441-8436c0d9e664": {
"main": [
[
{
"node": "f4e86455-7f4d-4401-8f61-a859be1433a9",
"type": "main",
"index": 0
}
]
]
},
"c7959fa2-69a5-46b4-8e67-1ef824860f4e": {
"main": [
[
{
"node": "601a71f6-c6f8-4b73-98c7-cfa11b1facaa",
"type": "main",
"index": 0
}
]
]
},
"181ae99e-ebe7-4e99-b5a5-999acc249621": {
"main": [
[
{
"node": "c7959fa2-69a5-46b4-8e67-1ef824860f4e",
"type": "main",
"index": 0
}
],
[
{
"node": "b6d5c1cf-b4a1-4901-b001-0c375747ee63",
"type": "main",
"index": 0
}
]
]
},
"d61d8ff3-532a-4b0d-a5a7-e02d2e79ddce": {
"ai_languageModel": [
[
{
"node": "334d38e1-ec16-46f2-a57d-bf531adb8d3d",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"601a71f6-c6f8-4b73-98c7-cfa11b1facaa": {
"main": [
[
{
"node": "334d38e1-ec16-46f2-a57d-bf531adb8d3d",
"type": "main",
"index": 0
}
]
]
},
"640c63ca-2798-48a9-8484-b834c1a36301": {
"ai_memory": [
[
{
"node": "334d38e1-ec16-46f2-a57d-bf531adb8d3d",
"type": "ai_memory",
"index": 0
}
]
]
},
"55933c54-5546-4770-8b36-a31496163528": {
"ai_memory": [
[
{
"node": "c7959fa2-69a5-46b4-8e67-1ef824860f4e",
"type": "ai_memory",
"index": 0
}
]
]
},
"f4e86455-7f4d-4401-8f61-a859be1433a9": {
"main": [
[
{
"node": "181ae99e-ebe7-4e99-b5a5-999acc249621",
"type": "main",
"index": 0
}
]
]
}
}
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
고급 - 지원, 제품, 인공지능
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
AI 대리인과 n8n 양식 기반의 대화식 인터뷰
AI 대리인과 n8n 양식을 기반으로 한 대화식 인터뷰
If
Set
Form
+
If
Set
Form
40 노드Jimleuk
제품
Telegram, Google 스프레드시트, AI를 사용하여 제품 만족도 조사 생성
Telegram, Google 스프레드시트 및 AI를 사용하여 제품 만족도 조사 생성
If
Set
Redis
+
If
Set
Redis
40 노드Jimleuk
엔지니어링
OpenAI 및 Redis 세션 관리를 사용한 채팅 지원 고객 인증
OpenAI와 Redis 세션 관리를 사용한 채팅 지원 고객 인증
Set
Form
Redis
+
Set
Form
Redis
19 노드Jimleuk
지원
JIRA, Supabase 및 AI를 사용하여 지원 티켓 자동 할당
JIRA, Supabase 및 AI를 사용하여 지원 티켓 자동 할당
If
Set
Jira
+
If
Set
Jira
36 노드Jimleuk
지원
AI 기반 학생 어시스턴트(Twilio SMS를 통한 코스 정보 제공)
AI 기반 학생 어시스턴트(Twilio SMS 통해 강의 정보 제공)
Set
Twilio
Airtable
+
Set
Twilio
Airtable
12 노드Jimleuk
인공지능
네일 살롱 (미국)
WhatsApp, GPT 및 Google 캘린더를 사용한 살롱 예약 관리 자동화
If
Set
Code
+
If
Set
Code
164 노드Denis
지원
워크플로우 정보
난이도
고급
노드 수18
카테고리3
노드 유형12
저자
Jimleuk
@jimleukFreelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at hello@jimle.uk LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk
외부 링크
n8n.io에서 보기 →
이 워크플로우 공유