See llms.txt for all machine-readable content.

Back to Templates

Turn Chatwork discussion to-dos into Chatwork tasks with Claude Haiku

Quick overview

This workflow monitors a Chatwork room for new mentions of a bot, uses Anthropic Claude to extract agreed to-dos from recent messages, and then creates corresponding Chatwork tasks with validated assignees and optional due dates, replying in the room with what was created or skipped.

How it works

  1. Runs every minute (or manually) and loads configuration such as the Chatwork room ID, context size, and task limits.
  2. Calls the Chatwork API to fetch the bot account details, recent room messages, and the list of room members.
  3. Checks an n8n Data Table log to find the oldest unprocessed mention of the bot within the allowed age and compiles a numbered conversation thread for context.
  4. Sends the conversation thread to Anthropic Claude to return a JSON list of agreed to-dos with exact quotes, a referenced message number, suggested assignee wording, and due-date wording.
  5. Validates each proposed to-do by confirming the quote exists in the referenced message, resolving the assignee to exactly one current room member, and converting any due wording into a deadline based on the message date while skipping duplicates that already produced tasks.
  6. Creates Chatwork tasks for the validated items (including a link back to the source message), records task results in the Data Table, and posts a Chatwork reply summarizing created tasks and explaining why any items were skipped.

Setup

  1. Create or choose a Chatwork bot account, add it to the target room, and configure an HTTP Header Auth credential that sends your Chatwork API token as the X-ChatWorkToken header.
  2. Add an Anthropic credential for the Claude (claude-haiku-5-5) model used to extract to-dos.
  3. Create an n8n Data Table with columns kind, message_id, room_id, task_id, and result, then select this same table in all Data Table nodes (read log, record task, record mention).
  4. Set the Chatwork room_id in the Config node and adjust optional settings like context_size, max_age_minutes, max_tasks, timezone, and names_map (nickname-to-account_id mappings) as needed.

Requirements

  • A Chatwork account for the bot (a separate account, added to the room) and its API token
  • Header Auth credential: name X-ChatWorkToken, value = the bot's API token
  • Anthropic API key (Claude Haiku 5.5 by default; any chat model works)
  • An n8n Data Table with the text columns kind, message_id, room_id, task_id, result

Customization

  • Config: room_id, context_size (how many earlier messages are read, default 30), max_age_minutes (older mentions are skipped, default 60), max_tasks, timezone
  • names_map: map nicknames to Chatwork account IDs, e.g. {"Sato": "1234567"}
  • Reply wording: the label object at the top of each code node
  • Swap the model node for another chat model

Additional info

The AI never decides who or when. It only quotes the words that name the assignee and the deadline; code checks that the quote is really in that message, picks the assignee (the speaker, the person addressed with [To], or a name that matches exactly one room member) and computes the due date from the day the message was written. Japanese and English deadline words are supported ("来週の水曜までに", "by next Wednesday").
Chatwork tasks need an assignee, so a to-do without a clear one is not created; the reply lists it with the reason.
A message that already produced a task is never used twice.
Tested on a real Chatwork room in Japanese and English, and the due-date rules with 15 cases (including "this week" written on a Saturday).