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.
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.
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"}'.GET /v1/pages/{page_id} and GET /v1/blocks/{block_id}/children so the LLM can fetch and chunk page content.{"summary": "Sprint 12 recap...", "action_items": ["@alice: update API spec", "@bob: fix auth bug"]}.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.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>"}}.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.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.
ntn_ tokens for server-side agents.Detail field caps at 256 KB. Large AI outputs must be stored in S3, with only the object URI passed in the event.timestamp and sign parameters. Omitting them triggers 403 Forbidden./v1/blocks returns 429. Implement exponential backoff in the agent’s fetch loop.