Create habit task when you complete a todo
When you finish a to-do in Todoist, a matching habit task is created in your habit tracker and scored, so your streaks and points update on their own.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-habit-task-when-you-complete-a-todo/
Paste into Claude, ChatGPT, Cursor or any agent.
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-habit-task-when-you-complete-a-todo
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-habit-task-when-you-complete-a-todo/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-habit-task-when-you-complete-a-todo - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy create-habit-task-when-you-complete-a-todo - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-habit-task-when-you-complete-a-todo
zaps/create-habit-task-when-you-complete-a-todo/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 3 to fill in
- connections/todoist.tsThe
todoistaccount it uses - triggers/any-completed.tsWhat starts it:
todoistany_completed - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a task is completed in Todoist, in any project (
todoist,any_completed). - Webhooks by Zapier sends a POST to your habit tracker's create-task endpoint with the task's title, note, completion time and Todoist task ID, plus your tracker's API token.
- Webhooks by Zapier sends a POST to your habit tracker's score endpoint for the new habit task's ID, so it counts toward your streak and points right away.
If the create call returns no task ID, the run stops after step 2 and nothing is scored.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
CREATE_TASK_URL |
The habit tracker's endpoint that creates a habit task (POST) |
SCORE_TASK_URL |
The habit tracker's endpoint that scores a habit task. The new task's ID is added to the end, so https://example.com/tasks becomes https://example.com/tasks/<id> |
HABIT_TRACKER_TOKEN |
The habit tracker's API token. Keep it private: anyone who has the workflow source can read it |
Also review the defaults with them: by default every completed Todoist task, in any project, creates a habit task. Ask whether only certain projects or labels should count.
Confirm that the create call returns the new task's ID as id. If it uses another field name, change the created.data[0] line in workflow.ts to read that field.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-habit-task-when-you-complete-a-todo, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-habit-task-when-you-complete-a-todo, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: the workflow's actions use no connection alias. Bind
todoist(the trigger's account) to the user's Todoist connection. Webhooks by Zapier needs no connection, so itsauthentication_idisnull. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/any-completed.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match. The request and response shapes of the habit tracker are the user's to confirm.
Test it
Run this sample as a draft test run (run_workflow_draft in Zapier MCP) before publishing, pointed at a habit tracker test account:
{
"id": "1234567890",
"content": "Morning walk",
"note": "20 minutes around the block",
"completed_at": "2026-10-29T08:30:00Z"
}
Check that one habit task named "Morning walk" appears in the habit tracker, that it is scored once, and that the run's output shows the same task ID for both requests. If run-status tools aren't available, check the result in your habit tracker directly. The user deletes the test data in the habit tracker and Todoist, not the agent.
Notes
- Todoist's New Completed Task trigger may fire for recurring tasks each time they are completed.
- The Zap creates one habit task per completed to-do and does not check for duplicates. To match an existing habit task by title and completion date first, add a lookup step before the create step.
- To limit it to certain projects or labels, add a check on the trigger's project or label fields before the create step.
- For lower-value scoring on recurring or low-impact tasks, change the score request's body, or skip scoring for tasks with a given label.
- Never commit a real API token or endpoint URL. Anyone with them can change your habit records.