Notion provides the power to manage tasks and different projects in a very effective way but adding tasks is a pain. I have been in many such situations while travelling, studying, etc where I just remember that I have to do something but to add that task in notion (especially on my phone), I have to open the specific project and add it there. On the otherhand, apps like Todoist are very easy to add a task instantly but doesn't provide the power of managing things like Notion.
For a while, I used to double write the tasks.
To solve this problem, I created these scripts that would allow the following workflows -
There are many other alternatives that allow you to handle this automation. Some of the most popular ones are Zapier and Make (Integromat) but both of them come with major restrictions for this use case i.e
Started with Thomas Frank's Ultimate Task template (https://thomasjfrank.com/templates/task-and-project-notion-template/) and customized it based on my needs, I use it for 3 type of tasks (Created 3 new projects in the template) -
I added a Today's property (checkbox) which specified if a task is due today. I use this Today property to sort the table to have a clean look of all the tasks which are due today.
I also added 2 views for each of the projects which displays tasks which are due today in that project and other view displays the remaining tasks
Separate views allows me to focus on tasks from a particular project more efficiently.
[Reach out to me on LinkedIn if you would like to get this simplied template]
When we add a new task in Todoist, it gets added to Notion automatically and a tag specifying "Added_to_Notion" gets added to the task in Todoist.
Task in Notion -
By default, the task gets added to Notion with Today marked as False (unless a Today tag is added to the task in Todoist). This flow makes sure that the tasks which are created today gets marked with Today in notion the very next day. This allows us to make sure tasks are not pending forever
Every morning we delete the tasks from Todoist which have been added to Notion to keep our Todoist list clean. This can be checked by looking at the label "Added_to_Notion" in the task.
Starting with the implementation, I created a new connection to get the notion api key and named it "python-bot". Once we had the key, we added the connection "python-bot" from all the projects and the main database page.
By sharing all the pages, we can get the database ID of the projects and by doing a simple GET on todoist tasks, we can get to know the project ids for Todoist projects. Using all these keys and IDs I created the secret.json file containing all the required keys and ids.
I also got the api key for my todoist account and saved it in secret.json.
We created three scripts -
Hosting these scripts to run forever was required so that we can write tasks in todoist whenever we want and be assured that it will be added to Notion within a minute. There are some easy paid options out there, but I used repl.it to host these scripts.
I created 1 repl for each of these scripts and ran those. There are 2 issues with repl.it which required some solution -