DaaS / Products / AI Notion Bot with Team Notifications

AI Notion Bot with Team Notifications

A developer authenticates a Notion integration, builds an AI-powered agent that reads and processes Notion workspace content, then wires EventBridge to push notifications (e.g., new AI-generated summaries or action items) to a DingTalk or Lark group chat for team visibility.

Products involved

Scenario

When engineering teams need to automate knowledge sharing and task tracking, they combine Notion’s structured workspace with AI summarization and real-time team alerts. This workflow lets an AI agent parse Notion pages, extract action items, and route them via EventBridge to DingTalk or Lark group chats for immediate visibility without manual polling.

Integration steps

  1. Authenticate Notion Integration: In the Notion Developer Console, create an internal integration and export the token: export NOTION_API_KEY="ntn_...". Verify access with curl -X POST https://api.notion.com/v1/search -H "Authorization: Bearer $NOTION_API_KEY" -H "Notion-Version: 2022-06-28" -d '{"query":"Project Docs"}'.
  2. Configure AI Agent Tooling: Use Cursor or deploy an MCP server to define a custom Notion tool. Map the tool to GET /v1/pages/{page_id} and GET /v1/blocks/{block_id}/children so the LLM can fetch and chunk page content.
  3. Process Content & Generate Output: Run the agent against a target database. Parse the LLM response into a structured JSON payload: {"summary": "Sprint 12 recap...", "action_items": ["@alice: update API spec", "@bob: fix auth bug"]}.
  4. Create EventBridge HTTP Connection & Destination: In AWS, create an AWS::Events::Connection with AuthorizationType: API_KEY pointing to your DingTalk/Lark webhook URL. Then create an API Destination referencing that connection and attach an IAM role granting events:InvokeApiDestination.
  5. Wire EventBridge Rule & Input Transformer: Create a rule with source ai.notion.bot. Set the target to the API Destination. Use an Input Transformer to map the AI payload to the chat format: {"msgtype": "markdown", "markdown": {"title": "AI Summary", "text": "<$.summary>\n<$.action_items>"}}.
  6. Test Delivery: Trigger via CLI: aws events put-events --entries '[{"Source":"ai.notion.bot","DetailType":"summary.ready","Detail":"{\"summary\":\"Ready\",\"action_items\":[\"Test\"]}"}]'. Verify the message appears in the group chat.

Architecture

Notion acts as the content source, exposing pages and blocks via authenticated REST endpoints. The AI agent (hosted locally or via MCP) fetches, chunks, and summarizes content, then emits a structured event. Amazon EventBridge serves as the routing layer: it receives the event, applies an input transformation to match DingTalk/Lark’s markdown schema, and forwards it via HTTP POST to the configured webhook, ensuring decoupled, low-latency delivery.

Prerequisites

Common pitfalls

Typical questions