Introduce n8n-nodes-chatwork

Hoang Dinh
5 min readOct 22, 2022

--

https://pixabay.com/photos/marketing-business-whiteboard-3582974/

About n8n and Chatwork

n8n

n8n is an extendable workflow automation tool. With a fair-code distribution model, n8n will always have visible source code, be available to self-host, and allow you to add your own custom functions, logic and apps. n8n’s node-based approach makes it highly versatile, enabling you to connect anything to everything. — https://n8n.io/

Chatwork

Chatwork is a group chat app for business. Secure messaging, video chat, task management and file sharing. Real-time communication and increase productivity for teams. — https://go.chatwork.com/

n8n-nodes-chatwork

I published n8n-nodes-chatwork as an n8n community node. The node already covers almost Chatwork API, and is still under development.

There is a list of supported APIs (features):

- `/me` - Used to access your account information
- [x] `GET /me` - Get your account information
- `/my` - Used to access your data on the account.
- [x] `GET /my/status` - Get the number of: unread messages, unread To messages, and unfinished tasks.
- [x] `GET /my/task` - Get the list of all unfinished tasks.
- `/contacts` - Used to access the list of your contacts
- [x] `GET /contacts` - Get the list of your contacts
- `/rooms` - Used to access information such as messages, members, files, and tasks associated to a specific conversation.
- [x] `GET /rooms` - Get the list of all chats on your account
- [ ] `POST /rooms` - Create a new group chat
- [x] `GET /rooms/{room_id}` - Get chat name, icon, and Type (my, direct, or group)
- [x] `PUT /rooms/{room_id}` - Change the title and icon type of the specified chat
- [ ] `DELETE /rooms/{room_id}` - Leave/Delete a group chat
- [x] `GET /rooms/{room_id}/members` - Get the list of all chat members associated with the specified chat
- [ ] `PUT /rooms/{room_id}/members` - Change associated members of group chat at once
- [x] `GET /rooms/{room_id}/messages` - Get all messages associated with the specified chat
- [x] `POST /rooms/{room_id}/messages` - Add new message to the chat
- [x] `GET /rooms/{room_id}/messages/{message_id}` - Get information about the specified message
- [ ] `PUT /rooms/{room_id}/messages/{message_id}` - Update the specified message
- [x] `DELETE /rooms/{room_id}/messages/{message_id}` - Delete the specified message
- [x] `GET /rooms/{room_id}/tasks` - Get the list of tasks associated with the specified chat
- [x] `POST /rooms/{room_id}/tasks` - Add a new task to the chat
- [x] `GET /rooms/{room_id}/tasks/{task_id}` - Get information about the specified task
- [ ] `GET /rooms/{room_id}/files` - Get the list of files associated with the specified chat
- [ ] `GET /rooms/{room_id}/files/{file_id}` - Get information about the specified file
- `/incoming_requests` - You can access contact approval requests you received
- [ ] `GET /incoming_requests` - You can get the list of contact approval request you received
- [ ] `PUT /incoming_requests/{request_id}` - You can approve a contact approval request you received
- [ ] `DELETE /incoming_requests/{request_id}` - You can decline a contact approval request you received

You can follow the list at https://github.com/hoangsetup/n8n-nodes-chatwork/blob/master/CONTRIBUTING.md#todo-list

How to try it?

In general, you can try the node as a shared community node, let’s take a look at this guide.

If you want to try it on your local side or your hosted n8n server, just install n8n-nodes-chatwork as an npm package, remember to install it where you install n8n package.

For example, if I just want to see the node as soon as possible on my local side, I will execute these commands:

$ npm install n8n n8n-nodes-chatwork
$ npx n8n start
Initializing n8n process
n8n ready on 0.0.0.0, port 5678
Version: 0.199.0
Editor is now accessible via:
http://localhost:5678/
Press "o" to open in Browser.
Chatwork node is available

You can find the Chatwork node in the all-nodes list.

Execute node action

First of all, you have to prepare Chatwork credentials to execute any action of the node.

After you add the node to your workflow, it will show `Credentials for Chatwork API are not set.` warning message. Let’s create a new one:

Create new Chatwork credentials

It requires Chatwork api token (Chatwork document — Japanese), and you can set the name for your credential.

Now your node is ready to use. This node provides some action to communicate with Chatwork. The actions are based on the resource — Chatwork resource

You have to select a resource and operation, then set operation parameters (if required).

Example: To send a message to a room, we need fill the room id and the message

And try it by clicking “Execute node”.

Another example, send a message to all rooms. You need setup 2 nodes: The first node get all rooms data, and the second node will send message to the rooms(output of the first node)

Send a message to all rooms
The first node — Get rooms
The second node — Send message

The Chatroom ID expression is created by drag and drop room_id table header.

Conclusion

I hope the node and my post are interesting to you. You can improve the node by creating an issue or a pull request to the GitHub repository.

Thank you for reading!

--

--

No responses yet