SuperAPI AI Directory

notion-automation

Office & productivity

View repository

Updated 10-15 08:01

About this skill

Notion Automation Management

Feature Description

This skill is specifically used to automate various operations on the Notion platform, including:

  • Page creation, content editing, and management
  • Database creation, configuration, and querying
  • Block operations and content updates
  • Page search and content retrieval
  • Project and task tracking management
  • Team collaboration and comment management
  • Page movement and organizational structure management

Use Cases

  • "Create a new project page"
  • "Update records in a Notion database"
  • "Search for pages containing specific keywords"
  • "Batch manage page content"
  • "Set up a project tracking board"
  • "Manage team collaboration and comments"
  • "Organize and arrange the Notion workspace"

Core Functional Modules

1. Page Management

  • Create Page: Create a new page and add initial content
  • Update Page: Modify page properties, title, and cover
  • Get Page: Retrieve detailed page information
  • Move Page: Move between different databases or parent pages
  • Delete Page: Archive or delete a page
  • Page Search: Search pages and databases by keyword

2. Database Management

  • Create Database: Create a new database and configure fields
  • Query Database: Filter and retrieve database records
  • Update Database: Modify database structure and properties
  • Get Database Details: View database metadata
  • Database Templates: Apply preset templates to create databases

3. Block Operations

  • Get Block Content: Read all blocks under a page
  • Update Block Content: Modify block text and styles
  • Add Child Blocks: Add child elements to a block
  • Delete Block: Remove unwanted blocks
  • Batch Operations: Update multiple blocks at once

4. Content Search

  • Full-Text Search: Search page titles and content
  • Database Search: Search within a specific database
  • Filtered Search: Filter results by object type
  • Sort Results: Sort by edit time

5. Collaboration Management

  • Get Users: List workspace users
  • Create Comment: Add comments to pages or blocks
  • Get Comments: View page discussions
  • Page Permissions: Manage page access permissions

6. Project Management

  • Project Page: Create a project overview page
  • Task Board: Set up Kanban-style task management
  • Progress tracking: Update task status and progress
  • Milestone management: Set up project milestones
  • Dependencies: Manage dependencies between tasks

Workflow

Standard page creation workflow

  1. Create page: Create a new page and set the title
  2. Add cover: Set the page cover image
  3. Add icon: Set the page icon
  4. Fill in content: Use blocks to add initial content
  5. Link database: If needed, link to a database
  6. Add collaborators: Set page collaborators

Database setup workflow

  1. Create database: Create a new database
  2. Define fields: Configure property types (text, number, date, etc.)
  3. Set up views: Create different views (table, kanban, calendar)
  4. Add records: Add initial records in bulk
  5. Configure filters: Set up commonly used filter conditions
  6. Set up templates: Create page templates

Content update workflow

  1. Get current content: Read the page block structure
  2. Locate the target block: Find the block that needs to be updated
  3. Update block content: Modify the block text or properties
  4. Add new blocks: If needed, insert new content blocks
  5. Verify updates: Confirm that changes are applied correctly

Project tracking workflow

  1. Create project database: Set up a project kanban
  2. Define task statuses: Set up status fields (To Do, In Progress, Done)
  3. Add tasks: Create task records
  4. Assign owners: Set task owners
  5. Set due dates: Add date fields
  6. Update progress: Update status as progress changes

Best practices

Page organization

  • Use a hierarchical structure to organize pages
  • Use databases instead of regular pages where appropriate
  • Regularly clean up and archive unneeded pages
  • Use icons and covers to distinguish different pages
  • Establish a unified naming convention

Database design

  • Choose field types accurately
  • Use relation fields appropriately to connect databases
  • Set default views to improve efficiency
  • Use filter conditions to reduce noise
  • Regularly maintain the database structure

Content editing

  • Use blocks to organize content structure
  • Use heading levels appropriately
  • Keep content concise and clear
  • Save important changes promptly
  • Use comments for discussion

Collaboration guidelines

  • Clarify page owners
  • Use @mentions to notify collaborators
  • Reply to comments promptly
  • Regularly sync and update status
  • Respect page permission settings

Common Code Examples

1. Create a page and add content

// 创建新页面
const page = await createPage({
  parent: {
    type: "page_id",
    page_id: "parent_page_id"
  },
  properties: {
    title: {
      type: "title",
      title: [
        {
          type: "text",
          text: {
            content: "项目文档"
          }
        }
      ]
    }
  },
  children: [
    {
      object: "block",
      type: "paragraph",
      paragraph: {
        rich_text: [
          {
            type: "text",
            text: {
              content: "这是项目文档的概述内容。"
            }
          }
        ]
      }
    }
  ],
  icon: {
    type: "emoji",
    emoji: "📝"
  },
  cover: {
    type: "external",
    external: {
      url: "https://example.com/cover.jpg"
    }
  }
});

2. Database operations

// 创建数据库
const database = await createDatabase({
  parent: {
    type: "page_id",
    page_id: "parent_page_id"
  },
  title: [
    {
      type: "text",
      text: {
        content: "项目管理数据库"
      }
    }
  ],
  properties: {
    "任务名称": {
      title: {}
    },
    "状态": {
      select: {
        options: [
          { name: "待办", color: "gray" },
          { name: "进行中", color: "blue" },
          { name: "已完成", color: "green" }
        ]
      }
    },
    "负责人": {
      people: {}
    },
    "截止日期": {
      date: {}
    }
  }
});

// 查询数据库记录
const records = await queryDatabase({
  database_id: "database_id",
  filter: {
    property: "状态",
    select: {
      equals: "进行中"
    }
  },
  sorts: [
    {
      property: "截止日期",
      direction: "ascending"
    }
  ]
});

3. Page search

// 搜索页面
const searchResults = await search({
  query: "项目计划",
  filter: {
    property: "object",
    value: "page"
  },
  sort: {
    direction: "descending",
    timestamp: "last_edited_time"
  }
});

// 搜索数据库
const dbResults = await search({
  query: "任务",
  filter: {
    property: "object",
    value: "database"
  }
});

4. Block content update

// 获取页面块
const blocks = await getBlockChildren({
  block_id: "page_id"
});

// 更新块内容
await updateBlock({
  block_id: "block_id",
  paragraph: {
    rich_text: [
      {
        type: "text",
        text: {
          content: "更新后的内容"
        }
      }
    ]
  }
});

// 添加新块
await appendBlockChildren({
  block_id: "parent_block_id",
  children: [
    {
      object: "block",
      type: "heading_2",
      heading_2: {
        rich_text: [
          {
            type: "text",
            text: {
              content: "新的章节标题"
            }
          }
        ]
      }
    }
  ]
});

5. Comment management

// 创建评论
await createComment({
  parent: {
    page_id: "page_id"
  },
  rich_text: [
    {
      type: "text",
      text: {
        content: "建议在这里添加更多细节描述。"
      }
    }
  ]
});

// 获取评论
const comments = await retrieveComments({
  block_id: "page_id"
});

6. Page movement

// 移动页面到其他父页面
await movePage({
  page_id: "page_id",
  parent: {
    type: "page_id",
    page_id: "new_parent_id"
  }
});

// 或移动到数据库
await movePage({
  page_id: "page_id",
  parent: {
    type: "database_id",
    database_id: "database_id"
  }
});

7. Batch operations

// 批量创建页面记录
const batchCreate = async (databaseId, records) => {
  for (const record of records) {
    await createPage({
      parent: {
        type: "database_id",
        database_id: databaseId
      },
      properties: {
        "任务名称": {
          title: [{ text: { content: record.title } }]
        },
        "状态": {
          select: { name: record.status }
        }
      }
    });
  }
};

// 批量更新块
const batchUpdate = async (updates) => {
  for (const update of updates) {
    await updateBlock({
      block_id: update.blockId,
      ...update.content
    });
  }
};

8. Users and permissions

// 获取用户信息
const users = await listUsers();

// 获取特定用户
const user = await getUser({
  user_id: "user_id"
});

// 获取当前用户
const me = await getSelf();

Integration Scenarios

1. Project Management System

  • Create a project overview page
  • Set up a task tracking database
  • Manage milestones and timelines
  • Generate project reports
  • Track team progress

2. Knowledge Base Management

  • Organize document structure
  • Create knowledge base pages
  • Maintain document indexes
  • Set document permissions
  • Regularly update content

3. Content Creation Workflow

  • Create a content calendar
  • Manage drafts and publishing
  • Collaboratively edit documents
  • Track comment feedback
  • Automate content publishing

4. Team Collaboration Platform

  • Establish a team homepage
  • Manage team members
  • Set up meeting notes
  • Share resources and links
  • Track team tasks

5. Automated Report Generation

  • Collect data updates
  • Generate regular reports
  • Export report content
  • Distribute reports to the team
  • Archive historical records

Notes

  • Comply with Notion API rate limits
  • Correctly handle authentication and permissions
  • Validate block types and content formats
  • Protect sensitive information from being leaked
  • Regularly back up important data
  • Pay attention to the hierarchical relationship between pages and databases
  • Use the correct ID types (page_id, database_id, block_id)
  • Handle API errors and exceptions
  • Comply with Notion's terms of use
  • Respect data privacy and security standards