Notion Trigger#
Notion is an all-in-one workspace for your notes, tasks, wikis, and databases.
Credentials
You can find authentication information for this node here.
Example Usage#
This workflow allows you to receive a message on Mattermost when new meeting notes get added to the Notion. You can also find the workflow on n8n.io. This example usage workflow would use the following nodes.
The final workflow should look like the following image.
1. Notion Trigger node#
The Notion Trigger node will trigger the workflow when new data gets added to Notion.
- First of all, you'll have to enter credentials for the Notion Trigger node. You can find out how to do that here.
- Click on Add Poll Time and select 'Every Hour' from the Mode dropdown list. This will check Notion every hour for new meeting notes.
- Select 'Page Added to Database' from the Event dropdown list.
- Select the database that contains the meeting notes from the Database dropdown list.
- Click on Execute Node to run the node.
In the screenshot below, you will notice that the node returns the new data from Notion. This output gets passed on to the next node in the workflow.
Note: Make sure to add a field with the Created Time
property type in your Notion database.
2. IF node#
This node will check if the notes belong to the Marketing
team. If the team is Marketing
the node will return true
, otherwise false
.
- Click on Add Condition and select 'String'.
- Click on the gears icon next to the Value 1 field and click on Add Expression.
- Select the following in the Variable Selector section: Current Node > Input Data > JSON > properties > Team. You can also add the following expression:
{{$json["properties"]["Team"]}}
. - Enter
Marketing
in the Value 2 field. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node checks the team that we received from the previous node and returns true
if the value equals Marketing
.
3. Mattermost node (post: message)#
This node will send a message about the new data in the channel 'Marketing' in Mattermost. If you have a different channel, use that instead.
-
First of all, you'll have to enter credentials for the Mattermost node. You can find out how to do that here.
-
Select a channel from the Channel ID dropdown list.
- Click on the gears icon next to the Message field and click on Add Expression.
- Enter the following message in the Expression field:
1 2 3
New meeting notes got added. Agenda: {{$json["properties"]["Agenda"]["content"]}} Date: {{$json["properties"]["created time"]}}
- Click on Execute Node to run the node.
In the screenshot below, you will notice that the node sends a message in Mattermost about the new data that got added to Notion.
5. NoOp node#
Adding this node here is optional, as the absence of this node won't make a difference to the functioning of the workflow.
- Create a NoOp node connected to the 'false' output of the IF node.
- Click on Execute Node to run the node.
Activate workflow for production
You'll need to save the workflow and then click on the Activate toggle on the top right of the screen to activate the workflow. Your workflow will then be triggered as specified by the settings in the Notion Trigger node.