Duck
Tutorials8 min read

How to Build Custom Notion AI Agents That Actually Work

Samet Turan— Editor··8 min read

Learn to build custom Notion AI agents using Make and OpenAI to automate research, drafting, and data entry directly within your workspace. A practical operator playbook.

The Core Stack: What You Actually Need

Notion‘s built-in AI is fine for summarizing meeting notes or fixing grammar. But if you’re trying to run a real business process inside Notion, it falls short. This guide shows you how to build your own task-specific notion ai agents that can execute multi-step workflows, fetch external data, and operate on your databases without manual intervention.

Forget the complex frameworks. You need three things: a Notion workspace, an automation platform, and an AI model API key. That’s it.

  • Notion: Your database and front-end.
  • Make (formerly Integromat): The glue. This is where the agent’s “brain” lives. It watches for triggers in Notion, sends data to the AI, and puts the results back. You could use Zapier automations, but I find Make’s visual builder and error handling better for multi-step tasks.
  • OpenAI API Key: To access models like GPT-4o. You pay for what you use.

A quick word on pricing. Honestly, Make‘s free tier is a joke for anything serious. It has a low operation limit and runs scenarios infrequently. The $9/mo “Core” plan is the real starting point, and it’s a fair price for the power it gives you. An OpenAI API key is pay-as-you-go. For most of the agents I describe here, you’ll spend less than $5 a month on API calls unless you’re processing hundreds of documents a day.

What Most Guides Get Wrong About Notion AI Agents

Most tutorials show you how to build a single, monolithic “do-everything” agent. They’ll have you create a complex prompt that tries to be a researcher, a Writer.com, a data analyst, and a scheduler all at once. This is a recipe for failure.

🤖
Recommended Reading

AI Side Hustles

12 Ways to Earn with AI

Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.


Get the Guide → $14

★★★★★ (89)

The output is inconsistent, debugging is a nightmare, and the prompt becomes an unmaintainable mess.

The correct approach is to build small, single-purpose agents. An agent that only summarizes articles. An agent that only extracts action items from meeting notes. An agent that only drafts cold emails based on a client profile. Each agent has one job, one clear prompt, and one trigger. This is the foundation of a real ai agent framework: specialized tools, not a Swiss Army knife.

This is where most people quit.

They try to build the all-seeing eye of Sauron in one Make scenario and wonder why it hallucinates half the time. Start small. Build a “First Draft Agent.” Then a “Data Cleaning Agent.” Chain them together later if you must, but build them as discrete, testable units first.

A Concrete Example: The ‘First Draft’ Research Agent

Let’s build something useful. This agent will watch a Notion database. When you add a new entry with a topic, it will research that topic, write a first draft, and update the Notion page with the content.

The Setup:

  1. Notion Database: Create a database called “Content Pipeline” with these properties:
    • Title (Title property)
    • Topic (Text property)
    • Status (Select property with options: “Idea,” “Researching,” “Drafting,” “Done”)
    • Content (This will be the page body itself)
  2. Make Scenario:
    • Trigger: Use the “Watch Database Items” module for Notion. Point it to your “Content Pipeline” database. Set it to trigger when an item is created.
    • Filter: Add a filter right after the trigger. Only proceed if the Status property is “Idea.” This prevents the agent from running on pages it has already processed.
    • Action 1: Update Notion Item: Immediately after the filter, use the “Update a Database Item” module. Change the Status to “Researching.” This is crucial—it prevents the agent from picking up the same job twice if the scenario runs again before the first one finishes.
    • Action 2: OpenAI “Create a Completion”: This is the core logic. Connect the OpenAI module.
      • Model: Select gpt-4o.
      • Messages: This is where you build the prompt. Use a “System” role and a “User” role.
      • System Prompt: You are a research assistant. Your job is to take a topic and write a well-structured, factual first draft of an article of about 800 words. Use clear headings and bullet points where appropriate. Do not invent facts. Do not use fluff or filler language. Your output must be in Markdown.
      • User Prompt: Please research and write a first draft for the following topic: [Map the 'Topic' property from the Notion trigger here].
    • Action 3: Notion “Append a Page Content”: Take the output from the OpenAI module (choices[0].message.content) and append it to the Notion page that triggered the workflow. You’ll need the Page ID from the original trigger.
    • Action 4: Update Notion Item: A final status update. Use another “Update a Database Item” module to change the Status to “Drafting.”

Here is the system prompt I use for this exact task:

You are an expert research analyst and writer, tasked with creating a detailed first draft for a blog post.

Your audience consists of business operators and solopreneurs. Your tone should be direct, informative, and practical. Avoid corporate jargon and filler phrases.

The output must be in clean Markdown format.

Use the following structure:
- A brief introduction (2-3 sentences).
- 2-3 main sections with H2 headings (##).
- Use bullet points for lists.
- A short concluding paragraph.

The total word count should be between 700 and 900 words.

Your entire response will be placed directly into a Notion page, so only include the Markdown content itself. Do not include any preamble like "Here is the draft you requested:".

This level of specificity in the prompt is non-negotiable for getting consistent results.

How do you handle rate limits and timeouts?

This is the stuff that breaks production automations. Your agent will work perfectly for single tests, then fail silently when you run ten items through it at once. Why? APIs have rules.

OpenAI Rate Limits: The API has limits on how many requests you can make per minute. If you dump 20 new “Ideas” into your Notion database at once, your Make scenario will trigger 20 times, and the 11th one will probably fail with a 429 Too Many Requests error. The fix is to build a queue. Instead of triggering on new items, have your scenario run on a schedule (e.g., every 15 minutes). It can then fetch all items with “Idea” status, but you can set the module to only process, say, 5 items per run. This smooths out the API calls.

Make Timeouts: A bigger, more annoying problem. GPT-4o can sometimes take 30-60 seconds to generate a long piece of text. The default timeout on a Make HTTP request module (which the OpenAI module is built on) is 40 seconds. My biggest gripe with Make is how it handles these timeouts. You don’t get a clean “OpenAI took too long” error. You get a cryptic execution failure that sends you down a rabbit hole of checking your API keys and Notion permissions, when the real problem was just a slow model response. You have to manually find the scenario settings and increase the timeout to something like 120 seconds. It’s a hidden setting, and it causes so many unnecessary headaches for new users (if you’ve tried building complex Zaps, you know the pain of hidden limits).

Debugging 101: When Your Agent Goes Silent

Your agent will break. It’s not a matter of if, but when. Here’s the order of operations for figuring out why.

  1. Check the Make Scenario History: This is your first stop. Go into Make and look at the “History” tab for your scenario. It will show you every run, successful or failed. If it failed, you can click on the run and it will show you exactly which module failed and the error message.
  2. Inspect the Data Flow: The one thing I absolutely love about Make is its visual scenario debugger. You can literally watch the data flow from Notion to OpenAI and back, step-by-step. Click on the little speech bubbles above each module after a run to see the exact data bundle that came in and went out. This is how you find out you mapped the Page Title instead of the Topic to the OpenAI prompt.
  3. Look at the Raw OpenAI Response: In the execution history, you can see the full, raw response from the OpenAI API. Sometimes the model will return a valid response, but with a “content_filter” flag, meaning your prompt or the output triggered a safety system. The Make module might just register this as an error, but the raw data tells you the real story.
  4. Check Notion API Permissions: This is a common “gotcha.” Did you add your Make connection to the new database? When you create a new Notion database, you have to go into the page settings, click “Add connections,” and explicitly add your automation tool’s integration. If you forget, the API calls to that database will fail with a permission error.

Building a reliable ai automation blueprint requires more time spent on error handling and debugging than on the initial happy-path build.

Adjacent reading: deeper coverage of AI agent platforms.

You can build this entire system yourself using the steps above. It’ll take some trial and error, especially around the prompts and error handling. If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this entire workflow as a pre-built no code ai blueprint in our vault. You can find the AI Agent Builder Kit at deepusecase.com/vault/ai-agent-builder-kit.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.