# N8N

### What is N8N?

N8N is a workflow automation platform that allows you to connect different applications and automate processes. When integrated with BotPenguin, it enables you to trigger actions (like sending messages or updating contacts) or respond to events (like new messages or orders) automatically.

***

### Benefits of N8N Integration

* 🔗 Enables end-to-end workflow automation across multiple systems
* ⚡ Eliminates manual intervention for repetitive chatbot operations
* 🎯 Allows event-driven automation based on real-time chatbot activity
* 🔄 Supports scalable integrations without requiring backend development
* 📈 Improves operational efficiency and automation coverage

***

### When should you use this?

Use this integration when:

* You want to automate workflows between BotPenguin and external systems using N8N
* You need to trigger actions based on user activity (messages, contacts, orders)
* You are trying to build scalable automation pipelines without custom backend development

***

### Expected Outcome

After setting this up:

* Your N8N workflow will be successfully connected with BotPenguin
* Data will flow between BotPenguin ↔ N8N
* You will be able to trigger actions and automate responses based on chatbot events

{% hint style="info" %}
Tip: Always test your workflow using “Execute Step” before activating it.
{% endhint %}

***

### 🔐 Prerequisites

Before setting up this integration, ensure you have:

* An active N8N account → <https://n8n.io/>
* Access to BotPenguin account with API token enabled (only enabled for King Plan and Above)
* Bot ID of the chatbot you want to connect (can be copied for any bot via the platfrom)
* Required permissions (Admin / Owner access)

{% hint style="warning" %}
If API tokens are not available in your plan, this integration will not work.
{% endhint %}

***

### How to Use N8N Integration

#### Step 1: Create Workflow in N8N

1. Go to N8N and log in or sign up

<figure><img src="/files/MuTNokyaKk1sjx0D7Zc4" alt=""><figcaption></figcaption></figure>

2. Once you have logged in, click on “Create Workflow” (top right). If the same option does not appear, then choose the "Create from Scratch" template.

<figure><img src="/files/gSd7PbPSRhbAfvFU1d1a" alt=""><figcaption></figcaption></figure>

#### Step 2: Add BotPenguin Node

3. Click “Add Step”

<figure><img src="/files/4aFRlL0LEBz045j6Tjgi" alt=""><figcaption></figcaption></figure>

4. Search for “BotPenguin”

<figure><img src="/files/R0mEmljJ5igOYkMboNKI" alt=""><figcaption></figcaption></figure>

5. Select the node and click “Install Node”. Once the same has been installed, it will come as Installed.

<figure><img src="/files/OiuZM1aXkaNLagAixWGD" alt=""><figcaption></figcaption></figure>

***

#### Step 3: Configure Credentials

6. Click on the BotPenguin node.
7. If credentials are not added, then click on add new credentials. Else, add the credentials.

<figure><img src="/files/LQS8Jy5PSFFBwV3gmqRj" alt=""><figcaption></figcaption></figure>

8. A new modal will pop up. Enter all the details above into the sections, and then click on "**Save":**
   1. API Key (from BotPenguin → More → API Tokens)
   2. Bot ID (from Home -> Your Chatbots Table -> Actions - Three Dots -> Copy Bot ID )
   3. Platform (WhatsApp, Instagram, Facebook, Telegram, Website, SMS)
   4. Allowed Domains → Keep as “All”

<figure><img src="/files/TF7aT5tQ6Hjb0yAElfWm" alt=""><figcaption></figcaption></figure>

***

#### Step 4: Select Trigger or Action

9. Once the credentials have been added, choose one of the available triggers or actions
10. Configure required parameters
11. Click **“Execute Step”** to test

<figure><img src="/files/OzF9KACM1u7VvZfWAum1" alt=""><figcaption></figcaption></figure>

***

### 🔄 How Data Flows (Important)

* BotPenguin sends event data → N8N (via triggers like message/contact/order)
* N8N processes workflow logic
* N8N executes actions → BotPenguin (send message, update contact, etc.)
* Automation runs based on defined workflow conditions

***

### ⚙️ Configuration Options

#### Triggers

* **On Contact Created**: Runs when a new contact is added
* **On Incoming Message**: Runs when a user sends a message
* **On WhatsApp Order Created**: Runs when an order is placed via WhatsApp

#### Actions

* **Add Contact**: Create new contact in BotPenguin
* **Update Contact Attributes**: Modify custom fields
* **Send Instant Message**: Send message (requires active session)
* **Send Template Message**: Send WhatsApp template message

***

### 🚫 Limitations

* WhatsApp instant messages require an active session (24-hour rule applies)
* Only predefined triggers and actions are supported
* API token must be available in your plan
* Phone numbers must follow strict format (country code + number, no symbols. Eg: 917963XXXXXX)

***

### Best Practices

> 💡 Always validate workflows using “Execute Step” before deployment

> ⚠️ Ensure correct API credentials and bot selection

> 🚀 Use expressions dynamically for scalable automation

> 🎯 Keep workflows modular for easier debugging and scaling

***

### Troubleshooting

<details>

<summary><strong>Issue</strong>: BotPenguin node not appearing</summary>

**Solution:** Ensure the BotPenguin node is properly installed from the node panel before use.

</details>

<details>

<summary><strong>Issue</strong>: Authentication failed</summary>

**Solution:** Recheck the API key and Bot ID. Ensure both are valid and correctly entered.

</details>

<details>

<summary><strong>Issue</strong>: Trigger not working</summary>

**Solution:** Click on **“Execute Step”** to start the trigger listener before testing the workflow.

</details>

<details>

<summary><strong>Issue</strong>: Message not sending</summary>

**Solution:** Ensure the session is active for the user. If not, use a template message instead.

</details>

***

### FAQs

<details>

<summary>Do I need to configure anything inside BotPenguin?</summary>

No, no additional setup is required inside BotPenguin apart from API token and bot ID.

</details>

<details>

<summary>How do I get the API key?</summary>

Go to **More → API Tokens** in BotPenguin and copy/generate the key.

</details>

<details>

<summary>How do I find the Bot ID?</summary>

Go to chatbot dashboard and use the **Copy Bot ID** option.

</details>

<details>

<summary>What format should phone numbers follow?</summary>

Use country code + number (e.g., 919876543210), without symbols or spaces.

</details>

<details>

<summary>Can I use custom triggers or actions?</summary>

No, only predefined triggers and actions are supported in n8n.

</details>

***

### Related Articles

* API Token Setup Guide
* Chatbot Management Overview
* WhatsApp Template Messaging Guide

***

### Support

If you still have questions, contact us at **<support@botpenguin.com>**. We’ll respond within 48 hours.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.botpenguin.com/settings/integrations/n8n.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
