Python 3.10+CrewAI 0.50+Notion API v2

CrewAI Γ— Notion

Give your CrewAI agents full read/write access to NotionΒ β€” databases, pages, and knowledge bases.

New β€” Be the first to try this
$29one-time purchase
lifetime updates
CΓ—N
Agent Blueprint
Integration Package
NotionPageReader
NotionDatabaseQuery
NotionPageCreator
NotionPageUpdater
4
Tools
100%
Typed
24
Tests

What's Included

Everything you need to connect CrewAI agents to Notion β€” no boilerplate, no guesswork.

πŸ“¦

Complete Python Package

Production-ready CrewAI tool definitions with clean project structure

πŸ”§

4 Ready-Made Tools

NotionPageReader, NotionDatabaseQuery, NotionPageCreator, NotionPageUpdater

βš™οΈ

Environment Setup

.env template with all required variables pre-configured

πŸ§ͺ

Full Test Suite

pytest tests for every tool β€” unit and integration coverage

πŸ”„

Retry & Rate Limiting

Exponential backoff, automatic retries, and Notion API rate-limit handling

🏷️

Type Hints Throughout

Full type annotations β€” works with mypy, Pyright, and your IDE

πŸ“–

README & Setup Guide

Step-by-step instructions from zero to running agent in under 10 minutes

πŸ€–

Example Agent

A complete agent script that demonstrates all 4 tools working together

Live Code Preview

Real, production-quality code. Not pseudo-code β€” this is what you ship.

crewai_notion/tools.py
"""CrewAI Γ— Notion Connector β€” Production Tools"""

import os
import time
from typing import Any
from notion_client import Client
from crewai.tools import tool

# Initialize Notion client
notion = Client(auth=os.environ["NOTION_API_KEY"])

MAX_RETRIES = 3
RETRY_DELAY = 1.0  # seconds


def _retry(fn, *args, **kwargs) -> Any:
    """Execute with exponential backoff for rate limiting."""
    for attempt in range(MAX_RETRIES):
        try:
            return fn(*args, **kwargs)
        except Exception as e:
            if "rate_limited" in str(e).lower() and attempt < MAX_RETRIES - 1:
                time.sleep(RETRY_DELAY * (2 ** attempt))
                continue
            raise
    raise RuntimeError("Max retries exceeded")


@tool("Read Notion Page")
def notion_page_reader(page_id: str) -> str:
    """Read the full content of a Notion page by its ID.
    Returns the page title and all text blocks as markdown."""
    page = _retry(notion.pages.retrieve, page_id=page_id)
    blocks = _retry(
        notion.blocks.children.list, block_id=page_id
    )

    title = _extract_title(page)
    content = _blocks_to_markdown(blocks["results"])
    return f"# {title}\n\n{content}"


@tool("Query Notion Database")
def notion_database_query(
    database_id: str,
    filter_json: str = "{}",
    sorts_json: str = "[]",
) -> str:
    """Query a Notion database with optional filters and sorts.
    Returns matching rows as structured text."""
    import json

    filter_obj = json.loads(filter_json) if filter_json != "{}" else None
    sorts_obj = json.loads(sorts_json) if sorts_json != "[]" else None

    query_args: dict[str, Any] = {"database_id": database_id}
    if filter_obj:
        query_args["filter"] = filter_obj
    if sorts_obj:
        query_args["sorts"] = sorts_obj

    results = _retry(notion.databases.query, **query_args)
    return _format_db_results(results["results"])


@tool("Create Notion Page")
def notion_page_creator(
    parent_page_id: str,
    title: str,
    content_markdown: str,
) -> str:
    """Create a new Notion page under a parent page.
    Accepts markdown content and converts to Notion blocks."""
    blocks = _markdown_to_blocks(content_markdown)

    new_page = _retry(
        notion.pages.create,
        parent={"page_id": parent_page_id},
        properties={"title": [{"text": {"content": title}}]},
        children=blocks,
    )
    return f"Created page: {new_page['id']} β€” {new_page['url']}"


@tool("Update Notion Page")
def notion_page_updater(
    page_id: str,
    updates_json: str,
) -> str:
    """Update properties on an existing Notion page.
    Pass a JSON string of property updates."""
    import json
    updates = json.loads(updates_json)

    _retry(
        notion.pages.update,
        page_id=page_id,
        properties=updates,
    )
    return f"Updated page {page_id} successfully"

This is a preview β€” the full package includes helper functions, error classes, and the complete test suite.

How It Works

Three steps. Ten minutes. Your agents talk to Notion.

Step 01

Install & Configure

pip install the package, add your Notion API key to .env, and you're set.

Step 02

Import the Tools

Add the tools to your CrewAI agent definition. One import, four capabilities.

Step 03

Run Your Agent

Your agent can now read, query, create, and update Notion pages autonomously.

Use Cases

Four ways teams are already using this connector in production.

πŸ”¬

Research Agent

Automatically saves findings, sources, and summaries to a structured Notion database.

πŸ“

Meeting Notes Agent

Creates beautifully formatted Notion pages from raw meeting transcripts.

πŸ“Š

Project Management Agent

Updates task statuses, adds new items, and queries project databases in real time.

πŸ“š

Knowledge Base Agent

Queries your existing docs and retrieves context your other agents can use.

What You'll Build

A clean pipeline from your agent's brain to your team's workspace.

Y
Your Agent
CrewAI Framework
C
Connector Tools
4 @tool Functions
N
Notion API
v2 REST API
Y
Your Workspace
Pages & Databases

Frequently Asked Questions

Does this work with CrewAI v0.50+?
Yes β€” built and tested against CrewAI 0.50 and above. We update the package within a week of every new CrewAI release.
Can I modify the tools?
Absolutely. You get the full source code. Extend, fork, or rewrite anything. No license restrictions on your modifications.
Do I need a paid Notion plan?
No. The Notion API works with free Notion accounts. You just need to create an internal integration in your Notion workspace.
Is there a refund policy?
Yes β€” 30-day money-back guarantee, no questions asked. If it doesn't work for your use case, we'll refund you.
How do I get updates?
You'll receive an email whenever we push a new version. Updates are free for life β€” buy once, update forever.

Ready to Connect Your Agents to Notion?

One purchase. Full source code. Lifetime updates. Start building in 10 minutes.

30-day money-back guarantee

More Blueprints

Explore other agent integration packages.

Coming Soon

CrewAI Γ— Slack

Send messages, read channels, and manage threads from your CrewAI agents.

$29
Coming Soon

CrewAI Γ— GitHub

Create issues, review PRs, and manage repos with agent-powered automation.

$39
Coming Soon

LangChain Γ— Notion

The same Notion power, built for LangChain agents and chains.

$29
Coming Soon

CrewAI Γ— Google Sheets

Read, write, and analyze spreadsheet data from your CrewAI workflows.

$24