Database automations
哎呀! 你的广告拦截器好像正在阻止视频播放。
Improve your efficiency by automating the most tedious parts of your work 🔁
跳转到常见问题Database automations are sequences of actions that happen any time a specific change to a database occurs. Automations consist of both triggers (the events that initiate the automation) and actions (the effect of the automation). Database automations are meant to help save you time and simplify your work, and can be very basic or more complex depending on your needs.
Database automations can be used for many things, including:
Assigning a task to a specific person when its status changes.
Sending a Slack notification to a channel when a page is added to a database.
Note:
Automations won’t take action on any pages whose access is restricted. You can check and change page access in the share menu.
Database automations can't be triggered by other automations. Button actions, however, can trigger database automations. For example:
A recurring template automation will not trigger a database automation.
A database automation creating a page in another database will not trigger a database automation.
A user clicking a button that creates a page will trigger a database automation.
Database automations are available on paid plans on all platforms.
Database automations can be created, edited, or deleted by paid plan users who have full access to the database.
However, Slack automations can only be edited by the automation creator.
Free Plan users can create Slack notification automations, but no other kinds of automations.
Free Plan users can use existing automations in templates, but they won't be able to edit them.
To create a database automation:
Click
⚡
at the top of a database →New automation
.Give your database automation a name if you’d like.
Select
New trigger
to create a trigger. Then selectAdd trigger
to create more triggers. Learn more about the types of triggers below →Select
New action
to create a trigger. Then selectAdd action
to create more triggers. Learn more about the types of actions below →Select
Create
.
Did you know you can also add a button property to your database? With the click of a button, actions can be taken on your database on your behalf. Learn more here →
Automations can have one trigger or multiple triggers. When you set up an automation, you can decide whether the automation will take place When any of these occur
or When all of these occur
.
Note: If you have multiple is edited
triggers that must all occur for your automation to take place, those triggers need to happen within a small window of about three seconds. If they don’t, your automation may not be triggered properly. To avoid this, you can:
Create separate automations for each trigger.
Use a more specific trigger than
is edited
, likeis set to
orcontains
.
You can choose from two types of triggers: Page added
or Property edited
.
If you choose a Property edited
trigger, you can indicate which properties from your database will trigger the automation.
For name, person, number, text, select, and relation properties, you can choose what kinds of edits made to that property will trigger an automation. For example, you might have a list of contacts in a Notion database and set up an automation where the trigger is a phone number starting with the numbers 732, and the action is that person’s state being set to New Jersey.
You can also have more than one condition for your trigger so that two or more things must be true for the automation to occur.
Note: If you’d like your automation to add or edit pages and databases, make sure that you have permission to edit those pages and databases. Otherwise, your automation won’t work.
Automations can take one action or multiple actions. You can choose from a variety of actions:
Edit property
will edit the properties of pages in the database you are currently in. For multi-select, people, and relation properties, you can add or remove individual values instead of adding or removing all values at once. For example, you might have a task database where if the task name contains the word “blog”, your name is added to the people property, even if there are other people already assigned to that task.Add page to
will add a page to a database of your choosing, and edit the properties of that page.Edit pages in
will edit pages and properties in a database of your choosing.Send notification to
will send a notification to specific people in your Notion workspace. Your recipient can be up to 20 people in your workspace, or people who are associated with a certain People property in your database. Add a message that you want to go along with the notification.Send mail to
will send an email from your Gmail account to one or more recipients. Learn more about this below.Send webhook
will send an HTTP POST requests to the specified URL. Learn more in this article →Send Slack notification to
will send a notification to the Slack channel you want. Learn more about Notion's Slack integration here →Define variables
will allow you to create a custom variable using mentions and formulas. You can then use this variable in other database automation actions. Learn more about this below.
Get more inspiration for using database workflows in this guide →
Send mail to
Note:
You need a Gmail account to use this automation.
Once someone has linked their Gmail account to an automation, only they will be able to edit the automation. Others will only be able to use the automation.
Emails sent using this automation may take up to two minutes to arrive in your recipient’s inbox.
Be mindful of Gmail’s limits for how many recipients a message can have, or how many emails you can send in a day.
The Send mail to
action for a database automation will send an email from your Gmail account to one or more email addresses when a trigger occurs. This is helpful if you want to send an email to someone to remind them to complete their past-due task, or to update your team on the status of all of your open projects.
To set up an automation to send an email:
Click
⚡
at the top of a database, then selectNew automation
or an existing automation.Select
New action
orAdd action
→Send mail to…
.If your Notion account is already tied to a Gmail account, you’ll see your email address next to
Send mail from
. If you want to use another Gmail account for this automation, click on your email address →Add Gmail Account
.You can set up various parts of your email:
To
: This could be a person property (likeWhoever triggered
orPage creator
), a person in your workspace, or a specific email address. This email address can be external — it doesn’t have to belong to someone in your workspace or your organization.Select
CC/BCC
next to theTo
field to optionally CC or BCC other people.
Subject
: Enter a subject for your email. Select@
in theSubject
field if you want your subject to contain a property from your trigger page, a time or date, a person or group in your workspace, or a link to a page in your workspace. Select∑
in theSubject
field if you want to create a formula for your subject.Message
: Enter a message for your email. Select@
in theMessage
field if you want your message to contain a property from your trigger page, a time or date, a person or group in your workspace, or a link to a page in your workspace. Select∑
in theMessage
field if you want to create a formula for your message.Send with display name
: This optional display name will appear next to your email when your recipient receives it. Select@
in the display name field if you want your display name to contain a property from your trigger page, a time or date, a person or group in your workspace, or a link to a page in your workspace. Select∑
in the display name field if you want to create a formula for your display name.Send replies to
: If you want replies to your email to be sent to someone other than the email address you used to send it, you can use this optional setting to send the reply to a person property, or a person in your workspace.
Define variables
You can define a custom variable with mentions and formulas. You can then use this variable in other database automation actions. To define a variable:
Click
⚡
at the top of a database, then selectNew automation
or an existing automation.Select
New action
orAdd action
→Define variables
.Click on
Variable 1
to give the variable a name, edit the formula, or duplicate it. You can also selectAdd variable
.Select
@
or∑
in the variable field to define your variables.You can use these variables in additional automation actions.
Let’s look at an example of when and how you’d create a custom variable. Let’s say you want to set an automation where when a parent task is marked as complete, all of its sub-tasks are automatically marked as complete.
Click
⚡
at the top of a database, then selectNew automation
or an existing automation.Select the trigger as
Status set to Complete
.Select
New action
orAdd action
→Define variables
.Select
∑
in the field belowVariable 1
.In the window that opens, select
Trigger page
in the list of properties to the left.Put a period right after
Trigger page
in your formula, so that your formula readsTrigger page.
. Once you do this, you’ll see the trigger page’s properties in the list of properties to the left.Select
Sub-item
. Your formula should now readTrigger page.Sub-item
.Save
your formula. Now, your custom variable is defined as the sub-items of the page that triggers your automation, or in other words, the page that is marked as complete.Now, in your database automation settings, select
Add action
.Select
Edit pages in...
.Open the
Select database
dropdown and selectVariable 1
. This means that the automation will edit pages associated with variable 1, or in other words, sub-items associated with the page that is marked as complete.Open the
Edit a property
dropdown and selectStatus
.Open the
Select
dropdown and selectComplete
.Select
Save
.
The next time you mark a parent item that has sub-items as complete, you should see all of the sub-items’ statuses change to complete too!
Note:
At this time, mentions and formulas can only be used in database automation actions, not triggers.
Formulas can’t be used when sending Slack notifications.
You can use mentions and formulas in your database automation actions to make your automations work better for you. For example:
You might want to mention the date in the name of a new page created in your database.
You might want to set up a database automation to send a notification to someone that mentions a specific page.
You might want to automatically send a message to someone when a ticket has been resolved, and use a formula in that message that calculates the time it took to complete the ticket.
To include a mention or formula in a database automation action:
Click
⚡
at the top of a database, then selectNew automation
or an existing automation.Select
New action
orAdd action
. Find the action you want and select it.As you set up the automation action, select
@
in the field if you want to mention a date, person, page, or a property from the trigger page in your database. Select∑
in the field if you want to create a formula.Select
Save
when you’re done.
To see and manage all of the existing automations for a database:
Click
⚡
at the top of a database.Hover over the automation and click
•••
.Select
Edit
,Pause
, orDelete
.
常见问题
How frequently is the database scanned for “changes” in properties?
How frequently is the database scanned for “changes” in properties?
Database automations work over a three second window. For example, within this three second window, a user can remove a trigger and delete any changes, resulting in no property change to the automation.
Do automations work on pages in the entire database, or pages in a single database view?
Do automations work on pages in the entire database, or pages in a single database view?
Either one. During the creation process, you can specify if the automation should run on pages in the entire database, or in a specific view. If any filters in that view change, the automation will then apply to the adjusted list of pages.
Can guests with full access to a database create automations?
Can guests with full access to a database create automations?
Unfortunately, guests can't create database automations.
Why isn’t my database automation triggering?
Why isn’t my database automation triggering?
If you have a database automation that isn’t triggering, it’s possible that you’ve set up that automation to be triggered by another automation. Note that currently, it’s not possible for automations to trigger other automations. Try setting up a different, non-automated trigger for your automation.