> ## Documentation Index
> Fetch the complete documentation index at: https://timelines.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n

> Automate TimelinesAI WhatsApp and WABA from n8n workflows

# n8n

The TimelinesAI nodes for [n8n](https://n8n.io) let your workflows work with your TimelinesAI workspace. They can send WhatsApp and WABA messages, manage chats in the shared inbox, and start on TimelinesAI events, with no code.

The package has two nodes:

| Node | What it does |
| - | - |
| **TimelinesAI** | Chats, messages, files, labels, notes, reactions, accounts and teammates, plus WABA chats, messages, templates and analytics. It can also be used as a tool by n8n AI Agents. |
| **TimelinesAI Trigger** | Starts a workflow on TimelinesAI events, such as new messages, chat changes, account status and template approvals. |

## Install

**1. Open Community Nodes**

In a self-hosted n8n, go to **Settings → Community Nodes → Install**.

**2. Install the package**

Enter `@timelines-ai/n8n-nodes-timelinesai` and confirm.

**3. Find the nodes**

Search for **TimelinesAI** in the nodes panel.

## Connect your workspace

**1. Copy your API token**

In [app.timelines.ai](https://app.timelines.ai), go to **Integrations → Public API** and copy the token. See [Authentication](https://timelines.ai/docs/authentication.md).

**2. Create the credential**

In n8n, create a **TimelinesAI API** credential and paste the token. Keep the default Base URL.

**3. Test it**

Click **Test**. The node checks the token against your workspace.

> [!WARNING]
>
> The token belongs to the workspace. If it is regenerated in TimelinesAI, every n8n credential that uses it stops working until you paste the new token.

## Your first workflow

Reply to incoming WhatsApp messages automatically:

1. Add **TimelinesAI Trigger** and select the event **New Incoming Message**.
2. Add **TimelinesAI** with **Message → Send to Chat**.
   * Set **Chat** to *By ID* with the expression `{{ $json.chat.chat_id }}`.
   * Enter your reply text.
3. Activate the workflow. TimelinesAI starts sending events to it straight away, and the subscription is removed when you deactivate the workflow.

## Good to know

* **Webhook limit:** each event you select in the trigger uses one of the workspace's [webhooks](https://timelines.ai/docs/guides/webhooks.md). Workspaces have 10 by default.
* **Sending rate:** space WhatsApp messages out by about 2 seconds. For bulk sends, use **Loop Over Items** with a **Wait** node. See [Rate limits](https://timelines.ai/docs/rate-limits.md).
* **WABA service window:** free text only works within 24 hours of the contact's last message. Outside that window, send an approved template (Message Type: **Template**).
* **Inviting teammates:** by default, **Invite Teammate** refuses an email that already belongs to a teammate, because the API would change that teammate's role instead.

> [!NOTE]
>
> The node's GitHub repository has the full list of operations and ready-to-import example workflows: an AI Agent auto-reply, WABA templates for form leads, logging closed chats to Google Sheets, and Slack alerts for disconnected accounts.

## Links

* [npm package](https://www.npmjs.com/package/@timelines-ai/n8n-nodes-timelinesai)
* [GitHub repository](https://github.com/InitechSoftware/n8n-nodes-timelinesai)
* [Public API reference](https://timelines.ai/docs/public-api-reference/overview.md) and [Webhook reference](https://timelines.ai/docs/webhook-reference/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.