Give sourced Chatwork opinions with Claude Haiku when mentioned
Ready for 3.0What this workflow does
This AI workflow has 15 nodes and runs on a schedule (every minute) (plus 1 other trigger). Along the way it connects Anthropic Chat Model. It also calls api.chatwork.com over HTTP.
How it runs
Trigger: On a schedule (every minute) (plus 1 other trigger).
- Config (Edit Fields (Set)): sets 5 fields: room_id, context_size, max_age_minutes…
- Read the bot account (HTTP Request): calls api.chatwork.com
- Read room messages (HTTP Request): calls an HTTP API
- Read answered mentions (Data table): get (row)
- Find new mentions (Code): runs custom JavaScript code
- Topic written? (If): checks a condition and branches into true / false
- Ask Claude for an opinion (Basic LLM Chain): sends a prompt to an LLM, with model: Claude Haiku 5.
- Ask back (Code): runs custom JavaScript code
- Check sources and build the reply (Code): runs custom JavaScript code
- Reply in Chatwork (HTTP Request): calls an HTTP API (POST)
…plus 1 more step. See the full node list below.
Services it uses
HTTP calls to: api.chatwork.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Data table
n8n-nodes-base.dataTable - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick overview This workflow polls a Chatwork room every minute, detects new mentions of a bot account, and uses Anthropic Claude to generate an opinion based on recent context, citing linked source messages, then replies in Chatwork and logs handled mentions…