tinko

n8n community node for Tinko, the omnichannel customer service platform (WhatsApp, Instagram and site chat in one inbox)

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.1
Author: Drizon Tecnologia

Documentation

n8n-nodes-tinko

This is an n8n community node. It lets you use Tinko in your n8n workflows.

Tinko is a Brazilian omnichannel customer service platform. It brings WhatsApp, Instagram, site chat and other channels into a single shared inbox, with contacts, tags, attendants and automation on top.

n8n is a fair-code licensed workflow automation platform.

Installation
Credentials
Operations
Trigger
Usage
Example workflows
Compatibility
Development
Resources
Version history

Installation

Follow the installation guide in the n8n community nodes documentation.

The package name is n8n-nodes-tinko. It adds two nodes (Tinko and Tinko Trigger) and one credential (Tinko API).

Credentials

You need a Tinko account whose plan includes API access.

  1. In Tinko, open Settings, then API.
  2. Create a token and copy it. The token belongs to your company, not to a single user.
  3. In n8n, create a new Tinko API credential and paste the token into API Token.
  4. Save. n8n tests the credential by listing one channel of your account.

The nodes always talk to https://api.tinko.com.br/v1 and send the token as a Bearer token.

Operations

The Tinko node groups its operations by resource. It can also be used as a tool by AI agents.

Message

Operation What it does
Send Sends a message through a channel. Supported types: text, image, video, audio, document, sticker, contact card and WhatsApp template.
Get Many Retrieves the message history of a contact, found by phone number or contact ID. Filters: direction, text, type, visibility.

Contact

Operation What it does
Create Creates a contact from a phone number, with optional name, tags, custom fields and blocked flag.
Get Retrieves a contact.
Get Many Retrieves a list of contacts. Filters: name, phone, tag, blocked.
Update Updates name, blocked flag, tags and custom fields. Tags and custom fields replace the values currently stored. The phone number cannot be changed.
Delete Deletes a contact together with its chats.
Add Note Adds an internal note to a contact.
Get Notes Retrieves the internal notes of a contact.
Check WhatsApp Number Checks whether a phone number can receive WhatsApp messages, using one of your connected WhatsApp channels.

Chat

Operation What it does
Get Many Retrieves a list of chats, most recently updated first. Filters: status, open or closed, contact, tag, channel, attendant.
Get Messages Retrieves the messages of a chat. Filters: attendant, direction, text, type, visibility.
Transfer Moves a chat to another channel and, optionally, to a specific attendant, with an optional internal message.
Close Finishes an open chat. Optionally asks Tinko to generate an AI summary.

Tag

Operation What it does
Create Creates a tag with a name and optional color and emoji.
Get Retrieves a tag.
Get Many Retrieves a list of tags. Filter: name.
Update Updates the name, color or emoji of a tag.
Delete Deletes a tag and removes it from all contacts.

Template

Operation What it does
Get Many Retrieves the WhatsApp message templates of your account. Filters: category, channel, name, status.

Channel

Operation What it does
Get Retrieves a channel.
Get Many Retrieves a list of channels. Filters: name, status, type.

User

Operation What it does
Get Retrieves a user (attendant).
Get Many Retrieves a list of users. Filters: name, role, status.

Every Get Many operation has Return All and Limit, and returns one n8n item per record. Delete operations return { "deleted": true }.

Trigger

The Tinko Trigger node starts a workflow when something happens in Tinko.

Event Fires when
Chat Created A new chat is opened.
Chat Ended A chat is closed.
Chat Transferred A chat is moved to another channel or attendant.
Message Received A contact sends a message.
Message Sent A message is sent to a contact.
Channel Connected A channel is connected.
Channel Disconnected A channel loses its connection.

You can select several events and, optionally, restrict the trigger to specific channels.

Each execution receives the event data (for example message, chat, contact, users or channel, depending on the event) together with three extra fields: event, timestamp and webhook_id. The webhook_id stays the same when Tinko retries a delivery, so you can use it to ignore duplicates.

Subscription modes

Automatic (default). When the workflow is activated, the node creates a webhook in Tinko through the API, with a random secret that it keeps in the workflow. When the workflow is deactivated, the node removes the webhook.

Automatic subscription uses the Tinko webhook API (/v1/webhooks), available to every Tinko account with API access. Each active workflow creates one subscription, which also shows up in Tinko under Settings, Webhooks with the "API" badge.

Manual. Use this mode if you prefer to manage the webhook yourself in Tinko.

  1. Set Subscription to Manual in the node and choose a Secret Key (any long random text).
  2. Copy the webhook URL shown at the top of the node. Use the production URL for active workflows and the test URL while building.
  3. In Tinko, open Settings, then Webhooks, and create a webhook with that URL, the events you want, and the same secret key.
  4. Activate the workflow.

In manual mode the node still applies its own Events and Channels selection to what Tinko delivers.

Signature verification

Tinko signs every delivery. The node recomputes the HMAC-SHA256 signature of the raw request body with the secret and compares it with the X-Webhook-Signature header. Deliveries with a missing or wrong signature, or older than five minutes, are answered with HTTP 401 and do not start the workflow.

Usage

Picking records. Channels, contacts, tags, templates and users can be picked from a searchable list. Switch the field to By ID, or use an expression, when the ID comes from a previous node. Tinko IDs are 26 character strings.

Phone numbers. When sending a message or creating a contact, write the number with the country code, for example 5511999999999. Tinko stores and returns phone numbers formatted, for example +55 11 99999 9999. The phone filters match against that formatted value, so search for a group of digits such as 99999.

Recipients. The Recipient of a message can be a phone number, the ID of an existing contact, or a WhatsApp group ID. Sending to an unknown phone number creates the contact.

Templates. Templates can only be sent through official WhatsApp channels. On those channels, once 24 hours have passed since the last message from the contact, only template messages are accepted. To fill in the variables of a template, set Template Variables to Define Below and add the header, body and button values in order, or choose JSON to provide the components array yourself:

[
  { "type": "header", "parameters": [{ "type": "image", "path": "https://example.com/banner.png" }] },
  { "type": "body", "parameters": [{ "type": "text", "text": "Nathan" }, { "type": "text", "text": "1234" }] },
  { "type": "button", "sub_type": "url", "index": 0, "parameters": [{ "type": "text", "text": "1234" }] }
]

Media. Images, videos, audio, documents and stickers are sent by public URL. The node does not upload binary data.

Custom fields. Custom fields are created in Tinko. The node lists the active ones. Date fields use YYYY-MM-DD and select fields accept one of their configured options.

Rate limits. Tinko allows 60 read requests per minute, 20 message sends per minute, 10 number checks per minute and 30 other write requests per minute. Read requests that hit the limit are retried automatically after the delay announced by Tinko. For large sends, add a Loop Over Items node with a Wait node to stay under the limit.

Errors. When Tinko rejects a request, the node shows a short explanation in English and puts the details returned by Tinko (message, error code and field) in the error description. Enable Continue On Fail in the node settings to receive the error as an item instead of stopping the workflow.

Example workflows

Reply automatically outside business hours

  1. Tinko Trigger: event Message Received.
  2. If: check whether the current time is outside your business hours.
  3. Tinko (Message, Send): set Channel to {{ $json.chat.channel.id }} (By ID), Recipient to {{ $json.contact.phone }}, Message Type to Text, and write the reply.

Send an order confirmation template from your store

  1. Webhook (or the trigger of your e-commerce platform): receives the new order.
  2. Tinko (Contact, Check WhatsApp Number): confirm that the customer phone can receive WhatsApp messages.
  3. Tinko (Message, Send): Message Type Template, pick the approved template, set Template Variables to Define Below and add one Body Variable per placeholder, for example the customer name and the order number.

Route new chats to the right team

  1. Tinko Trigger: event Chat Created.
  2. Switch: branch on {{ $json.chat.channel.name }} or on any field of {{ $json.contact }}, for example a tag.
  3. Tinko (Chat, Transfer): use {{ $json.chat.id }} as Chat ID and choose the channel and attendant that should take over.

Compatibility

  • Built and checked with n8n-workflow 2.48 and @n8n/node-cli 0.57.
  • Developed against n8n 2.x. Older n8n versions have not been tested.
  • No runtime dependencies.
  • Built and tested against the Tinko public API (v1), including the webhook subscription API.

Development

npm install
npm run lint
npm run build
npm test
npm run dev

npm test builds the package and runs the unit tests with the Node.js built-in test runner. npm run dev starts a local n8n with the nodes loaded.

Releases are published to npm by the GitHub Actions workflow in .github/workflows/publish.yml, with npm provenance.

Resources

Version history

See CHANGELOG.md.

License

MIT

Discussion