Run custom code with Workers (beta)
Learn what Workers are and what they’re used for.
Chuyển đến Câu hỏi thường gặpNotion Workers are part of our Developer Platform. They run custom code on Notion's infrastructure to power:
Database sync
Tools for Custom Agents
Webhook triggers
For technical setup, see the developer documentation.
For more info about pricing, see this article.
Workers are available on Business and Enterprise plans.
By default, Workers are switched on for the workspace (owners only).
Workspace owners can:
Keep Worker creation to owners only.
Allow specific members or groups to create Workers.
Turn Workers off for the workspace.
If you're trying to deploy or manage a Worker, you’ll typically follow our developer documentation and use the Notion CLI.
You can turn on Developer Mode to view Workers in Notion, read logs, and turn off or delete Workers. To deploy a Worker or change its code or setup, use the Notion CLI or your team’s coding tool. Learn more about developer mode →
To learn more about pricing for Workers, see this article.
Database sync (powered by Workers) brings information from outside tools into a Notion database and keeps it up to date automatically. Once it's set up, the synced database stays current on its own, so your team and your agents always see the latest data without anyone copying or pasting between tools.
A few common examples:
Sync Zendesk support tickets into a triage database.
Sync Salesforce accounts into a pipeline tracker.
Sync data from an internal tool or database.
Once it's live, the synced database behaves like any other database in Notion. Access is governed by your standard Notion sharing permissions.
Agent tools (powered by Workers) extend what your Custom Agents can do beyond Notion's built-in actions and MCP, with capabilities tailored to how your team works.
A few common examples:
Querying a data warehouse.
Generating assets from a Notion doc.
Taking action in another app that isn’t natively supported or available via MCP.
Webhook triggers (powered by Workers) let an event in another tool kick off a workflow in Notion or any other connected system.
A few common examples:
Closing a task when a pull request merges.
Updating a CRM record when a subscription changes.
Creating an onboarding doc when an offer is signed.
Once it's set up, the workflow runs automatically every time the event happens, so your team doesn't have to manually move information between tools.
With Developer Mode, you can open Workers from the developer section in your sidebar. Use this view for quick checks and basic actions. In Notion, you can:
See all Workers in one list.
Open a Worker and view Overview, Logs, Environment Variables, and Settings.
Read Worker logs.
Turn off or delete a Worker.
To deploy a Worker or change its code or setup, use the Notion CLI or your team’s coding tool.
By default, only the person who created a Worker can modify and add it as a new connection. Share a Worker with teammates so they can connect it to a Custom Agent or help manage it.
Try these steps in order:
Make sure your workspace is eligible, and that a workspace owner has turned Workers on. Workers are available on Business and Enterprise plans, and require enablement from a workspace admin.
Confirm you’re using the intended setup path. For most setups, you’ll use Notion CLI plus the developer docs.
If your Worker deploy fails, check permissions next. You may not have access to deploy to that workspace, even if you can view pages in it.
If your Worker runs but doesn’t change anything in Notion, test the action manually first. If you can’t make the same change in Notion, it’s usually a permission or workspace-setting issue.
If cost looks higher than expected, lower the run frequency. Workers that run more often will cost more. Start with a slower schedule, then increase once you’re confident it’s working.
Still stuck? Follow the developer documentation for the specific error message. They’ll have the most accurate fix.
Câu hỏi thường gặp
Sự khác biệt giữa Workers và trợ lý tùy chỉnh là gì?
Sự khác biệt giữa Workers và trợ lý tùy chỉnh là gì?
Workers và trợ lý tùy chỉnh giải quyết các vấn đề khác nhau, nhưng chúng có thể hoạt động cùng nhau.
Workers: Chạy mã tùy chỉnh trên cơ sở hạ tầng của Notion. Các nhà phát triển sử dụng Workers cho những việc như tự động hóa, đồng bộ hóa theo lịch trình và các tích hợp tùy chỉnh.
Trợ lý tùy chỉnh: Tự động xử lý công việc lặp đi lặp lại cho nhóm của bạn. Bạn thiết lập các kích hoạt, và chúng sẽ chạy trong nền với không gian làm việc của bạn làm ngữ cảnh.
Trong một số thiết lập, Worker có thể cung cấp năng lượng cho một công cụ độc đáo mà trợ lý tùy chỉnh có thể sử dụng. Ví dụ, một Worker có thể tìm nạp dữ liệu từ một hệ thống khác và trợ lý có thể sử dụng dữ liệu đó để phản hồi hoặc thực hiện Hành động.
Workers có giống với Tự động hóa không?
Workers có giống với Tự động hóa không?
Không hẳn. Tự động hóa được tích hợp sẵn trong Notion và được thiết kế để bất kỳ ai cũng có thể thiết lập. Worker dành cho các nhà phát triển muốn chạy mã tùy chỉnh. Nếu bạn không cần mã, hãy bắt đầu với Tự động hóa.
Workers có chạy trên máy chủ của tôi không?
Workers có chạy trên máy chủ của tôi không?
Không. Worker chạy trên máy chủ của Notion, vì vậy bạn không cần phải thiết lập hoặc quản lý bất kỳ cơ sở hạ tầng nào.
Tôi có cần CLI để sử dụng Workers không?
Tôi có cần CLI để sử dụng Workers không?
Không phải lúc nào cũng vậy. Bạn có thể xem Worker, đọc nhật ký, tắt Worker và xóa Worker trong Notion bằng Chế độ nhà phát triển. Bạn thường sẽ cần CLI hoặc công cụ lập trình của nhóm mình để thiết lập, triển khai hoặc thay đổi Worker.
