--- type: workflow tags: [workflow, skill-email, email, executor, intent] last_updated: 2026-04-06 --- # skill_email_send_request 워크플로우 ## 목적 이메일 스킬 요청 처리. 이메일 발송(send), 조회(read), 요약(process)을 SKILL.md 기반 executor 또는 `email_integration` 모듈을 통해 skill-email 서비스로 전달한다. ## 현행 아키텍처 - **v2 경로**: IntentClassifier -> executor -> `SKILL_EMAIL_URL` 환경변수에서 URL 해소 후 HTTP 호출 - **Slack 경로**: `slack/message_service.py`에서 "네이버웍스 메일" 키워드 감지 시 `email_integration.send_naverworks_to_slack()` 직접 호출 - **email_integration**: `app/services/skills/email_integration.py` -- Gmail/NaverWorks 멀티 프로바이더 지원 n8n webhook 브릿지는 사용하지 않는다. ## 흐름 (v2 메시지 경로) ``` 사용자 발화 ("메일 확인해줘") -> IntentClassifier.classify() -- IntentResult(skill="skill-email", action="email_read", endpoint="/messages", slots={...}) -> executor.execute() -- registry.resolve_url() -> SKILL_EMAIL_URL 환경변수 -- registry.resolve_method("email_read") -> GET (SKILL.md frontmatter) -- GET {SKILL_EMAIL_URL}/messages (httpx, X-User-Id 헤더) -> _format_as_robeing() -> 응답 ``` ## SKILL.md 엔드포인트 정의 | action | 메서드 | 경로 | |--------|--------|------| | `send` / `email_send` | POST | `/send` | | `read` / `email_read` | GET | `/messages` | | `process` / `email_summary` | POST | `/process` | ## email_integration 모듈 `app/services/skills/email_integration.py`의 `EmailIntegration` 클래스가 다음을 담당한다: | 기능 | 메서드 | |------|--------| | Gmail 장착 확인 | `check_gmail_equipped()` -- DB 직접 조회 | | 프로바이더 결정 | `get_email_provider()` -- 키워드 또는 DB 조회 | | 이메일 요청 처리 | `process_email_request()` -- skill-email HTTP 호출 | | NaverWorks->Slack | `send_naverworks_to_slack()` -- 메일 조회 후 Slack 블록 전송 | | UUID 매핑 | `get_uuid_from_slack()` -- AUTH_SERVER_URL 매핑 API | ## 환경변수 | 변수 | 용도 | |------|------| | `SKILL_EMAIL_URL` | skill-email 서비스 베이스 URL | | `SKILL_SLACK_URL` | Slack 전송 시 사용 | | `AUTH_SERVER_URL` | Slack ID -> UUID 매핑 API | | `INTERNAL_API_KEY` | skill-email 인증 | | `SERVICE_API_KEY` | skill-slack 인증 | | `POSTGRES_CONNECTION_STRING` | Gmail 토큰/프로바이더 DB 조회 | ## 관련 문서 - [skill-email SKILL.md](/home/admin/robeing/DOCS/skills/skill-email/SKILL.md) -- 스킬 계약 - [skill_calendar_request.md](./skill_calendar_request.md) - [message_flow_v2.md](../01_conversation/message_flow_v2.md) -- v2 메시지 흐름