# /task bot on Windows / n8n 2

This package is for an existing native n8n installation at C:\n8n. Do NOT run install.sh on Windows. Import `n8n/workflows/10-telegram-task-assignments.json` into n8n. Also import the updated `08-notion-agents-loop.json` if you want @ag01...@ag09 tasks to execute. There is no automatic installer for the Telegram/Notion secrets.

## Before publishing

1. In Notion, share the `Arena Tasks` database with the integration. Create **Name** (Title), **Status** (Select with New, Waiting, In Progress, Done). Optional Hops (Number). Do not use the Workspace ID as the database ID.
2. In node `Telegram /task → Notion + human reminders` set TELEGRAM_BOT_TOKEN and NOTION_TOKEN locally, or supply them to the running n8n process via environment variables and restart n8n. Never paste secrets in chat. Set GROUP_ID to the Telegram group's **numeric** chat ID to restrict use. H01/H02/H03 are preconfigured. Hiddify's HTTP/Mixed proxy must listen at 127.0.0.1:12334 whenever n8n runs. Change TELEGRAM_PROXY/NOTION_PROXY if its port changes. Telegram bot must be a group member; each human must /start the bot privately for DM reminders.
3. Disable workflow 07 and any other `getUpdates` poller for the **same Telegram bot token**, then enable workflow 10. Two pollers conflict. If the bot has a Telegram webhook, delete it using BotFather or the Telegram API (with `drop_pending_updates=false`). **Do not expose the token in terminal output or chat.** n8n static workflow data is persisted on active scheduled executions; manual executions are not a durability test.
4. In workflow 08 Config set TASKS_DB='Arena Tasks', NOTION_TOKEN, KEY; set NOTION_PROXY to the current Hiddify HTTP port. Ensure Arena bridge has a working selected session before using agent assignments. Disable any older copy of workflow 08 to prevent duplicate processing.

## Commands in the Telegram group

`/task @ag01 Analyse competitor messaging` creates a **New** page in Arena Tasks; workflow 08 processes it through its agent loop. Codes AG01..AG09 are accepted, one target per command. This does not invoke agents private to another Arena account.

`/task @h03 Review the copy` creates a **Waiting** page and mentions the human in the group. H01=76156046; H02=5868631014; H03=7848957609. If still not Done after two hours, sends **one** private reminder (only if they previously started the bot). `/done <Notion page UUID>` in the group marks it Done; only the assignee or requester can close it. The reminder is not repeated. The workflow only processes commands posted in groups/supergroups; set GROUP_ID to prevent use in other groups. This workflow does not interpret ordinary human replies as completion: use /done.

Test with a harmless task first. If direct Telegram or Notion requests report ENOTFOUND, test Hiddify's HTTP proxy; this workflow passes HTTP proxy explicitly in its requests. If database search reports no database, check the integration's connection to Arena Tasks and the name exactly. If a newer Notion database API rejects `2022-06-28` `/v1/databases/.../query`, update the Notion workflows before production.

The source workflow 10 was syntax-checked and exercised with mocked n8n HTTP helpers for task creation, reminder and agent dispatch; it cannot be end-to-end verified against your private Telegram/Notion/Bridge services from this workspace.
