integration-webhooks
하는 일
이 스킬은 서버리스 호스트에서 채팅 및 이메일 연동의 들어오는 메시지를 처리하는 방법을 설명합니다. 웹훅은 작업을 저장하고 즉시 응답하며, 별도의 실행이 느린 에이전트 작업을 처리합니다. 메시징 연동을 추가하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Slack이나 WhatsApp 같은 새 메시징 연동을 추가할 때.
- ✓웹훅의 메시지가 누락되거나 두 번 응답될 때.
- ✓에이전트 응답이 플랫폼의 응답 시간 제한보다 길어질 때.
스킬 링크
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/integration-webhooks/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“채널에서 던진 질문이 시간 초과 없이 답을 받도록, 우리 앱을 Slack에 연결해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
웹훅은 들어온 메시지를 데이터베이스에 저장하고 즉시 성공 응답을 반환합니다. 그다음 별도의 실행이 메시지를 처리하며, 데이터베이스가 기준이 되는 원본으로 남습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Integration Webhooks
Rule
Integration webhooks (Slack, Telegram, WhatsApp, email, Google Docs, etc.) must enqueue work to SQL and return 200 immediately, then process the work in a separate fresh function execution kicked off by a self-fired HTTP POST. SQL is always the source of truth. Long-lived hosts use an in-process retry loop as a best-effort safety net; serverless deployments must use an external durable sweep when recovery cannot depend on a process staying alive.
Do not run agent loops inside the webhook handler itself. Do not rely on
fire-and-forget Promises after returning from a serverless handler — they get
killed when the function freezes.
Why
Messaging platforms expect a 200 response within a tight window — Slack will retry after 3 seconds, and a retried event triggers duplicate agent runs. At the same time, an agent loop replying to the message can take 30–60+ seconds because it may make multiple LLM calls and tool calls.
Past attempts that don't work cross-host:
- Fire-and-forget
Promise.then(...)after returning — Lambda/Vercel/CF freeze the execution context the moment the response goes out. The promise is silently killed, the user gets no reply, and there's no error in the logs. - A platform background function as the queue — host-specific execution is useful as a delivery mechanism, but it cannot replace the SQL row or atomic claim shared by every host.
- Cloudflare
event.waitUntil()— CF Workers only, not portable. - Vercel Fluid /
after()— Vercel-only, gated behind specific runtimes. - A long-lived in-process queue — fine on a single Node box, but on serverless every cold start gets a fresh queue and any pending work is lost.
The only universal answer: persist the work, then trigger a brand new function execution to do it. SQL is the queue, a self-webhook is the trigger, and a recurring job is the safety net.
The Flow
┌──────────┐ 1. POST /integrations/:platform/webhook
│ Platform │────────────────────────────────────────────►┌──────────────────┐
└──────────┘ │ Webhook handler │
│ (function exec 1)│
└──────────────────┘
│
2. INSERT INTO integration_pending_tasks
(status='pending', payload=...)
│
3. dispatch POST /integrations/process-task
— portable self-fire by default
— acknowledged background handoff when enabled
│
4. return 200 to platform ◄───────────┘
┌──────────────────┐
5. POST arrives at processor │ Processor │
(separate fresh function) │ (function exec 2)│
└──────────────────┘
│
6. claimPendingTask(id) → status='processing'
7. runAgentLoop(...) — full timeout budget here
8. adapter.sendResponse(...) back to platform
9. markTaskCompleted(id)
┌──────────────────────────────────────────────┐
│ Recovery sweep (every 60s) — safety net │
│ Re-fires processor for tasks stuck in │
│ 'pending' or 'processing' beyond timeout. │
│ Caps retries at 3 then marks 'failed'. │
└──────────────────────────────────────────────┘
The webhook handler does as little as possible. The fresh function execution
that handles _process-task gets its own full timeout budget for the agent
loop.
Key Files
| File | Purpose |
|---|
자주 묻는 질문
웹훅 안에서 에이전트를 실행하면 안 되나요?
메시징 플랫폼은 빠른 응답을 기대하는데, 에이전트 실행은 훨씬 오래 걸릴 수 있다고 이 스킬은 말합니다.
중복 메시지는 어떻게 하나요?
각 이벤트를 먼저 저장하면, 재시도된 이벤트가 두 번째 실행을 시작하는 것을 막는 데 도움이 됩니다.
자가 호출 요청이란 무엇인가요?
앱이 자기 자신에게 보내는 후속 HTTP 요청입니다. 느린 작업을 새 실행에서 처리하게 합니다.
상세 정보
작성자의 원본 설명
Cross-platform pattern for handling messaging integration webhooks (Slack, Telegram, WhatsApp, email, etc.) on serverless hosts. Use when adding a new integration adapter, debugging dropped messages, or wiring long-running agent work into a webhook handler.
repo: BuilderIO/agent-native
인기도
- GitHub 스타
- 7.6k
- 순위
- #13164
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
design-exploration
7.6k에이전트가 여러 UI 디자인 방향을 나란히 보여 주고, 사용자가 하나를 고르면 그 디자인을 다듬도록 돕습니다.
visual-edit
7.6k에이전트가 실행 중인 로컬 앱을 시각 편집기에 열어, 실제 화면을 함께 검토하고 편집하도록 돕습니다.
turn-into-app
7.6k워크플로, 스프레드시트 또는 프로젝트를 데이터가 채워진 세련된 시각 앱으로 바꾸고, 컨트롤 뒤에서 에이전트가 작업하도록 합니다.
visual-plan
7.6k일반 텍스트 계획을 다이어그램, 파일 맵, 코드 조각, 열린 질문이 담긴 대화형 시각 계획으로 바꿔 줍니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.