DOCS/workflow/01_conversation/slack_basic_dialogue.md
happybell80 8b5f028327 docs: credential 설정 가이드를 README에 통합 (SSOT)
공통 Slack credential/App 설정을 README 1곳에 두고, 개별 MD에서 링크.
slack_basic_dialogue.md는 워크플로우 고유 설정만 유지.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 23:12:22 +09:00

2.3 KiB

slack_basic_dialogue 워크플로우

목적

Slack 멘션으로 들어온 사용자 질문을 rb8001(로빙)이 처리하고 Slack 스레드에 응답하는 기본 대화 흐름.

흐름

Slack Trigger → Normalize Event → Should Process? → Get User Mapping → Build Gateway Request → Call Robeing Gateway → Prepare Slack Reply → Reply to Slack

rb8001 내부 데이터 흐름 (260319 변경)

Gateway 호출
  → message_router.get_user_context()
      → recent_conversations 로드 (DB, 최근 24h)
  → message_service.route_message()
      → decision_engine.create_execution_plan()
  → llm_service.process_request()
      → 프롬프트 DB 조회 (캐시 TTL 60초)
      → DB 활성 프롬프트가 있으면 system prompt로 주입
      → recent_conversations → previous_messages 변환 (최근 5건)
      → neutral 감정이면 감정 constraints 생략
      → OpenAI/Gemini handler 호출
  → 응답 반환

변경 전 (~ 260318)

  • 시스템 프롬프트: 코드 하드코딩 고정
  • 대화 이력: OpenAI 경로에서 미전달 (문맥 유실)
  • 감정 constraints: 모든 감정에서 무조건 주입

변경 후 (260319 ~)

  • 시스템 프롬프트: DB prompt_versions 테이블에서 활성 버전 조회 (코드 배포 없이 교체 가능)
  • 대화 이력: recent_conversationsprevious_messages 변환으로 OpenAI handler에 전달
  • 감정 constraints: neutral/빈 감정에서 생략

n8n import 후 수동 설정 (필수)

공통 credential 설정은 워크플로우 README 참조.

이 워크플로우 고유 설정:

노드 항목
Slack Trigger Trigger On message 또는 app_mention
Reply to Slack Channel ={{ $json.channel }}
Reply to Slack Other Options → Thread TS ={{ $json.thread_ts }}

검증 기준

  • 로빙? → 1문장 인사
  • 난 지금 서울이야 → 1문장 확인, 과잉 제안 없음
  • 내가 지금 어디라고? → 직전 맥락(서울) 유지

관련 문서