# n8n

> Install the Zenhalab nodes in n8n to start workflows on events, verified, and act in the apps, also as an AI agent tool.

The **n8n-nodes-zenhalab** package adds two nodes to n8n: **Zenhalab Trigger**, which starts a workflow when an event happens, and **Zenhalab**, which acts in the apps (and works as a tool for n8n's AI agents).

## Install {#install}

In n8n, open **Settings → Community nodes → Install**, enter `n8n-nodes-zenhalab` and confirm.

## Connect your account {#connect}

1. [Create an API key](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/api-keys#create) with **Full access** (or just the scopes your workflows need).
2. In n8n, add a **Zenhalab API** credential and paste the key. Leave the base URL as it is.
3. n8n tests the credential with the API's connection test.

## Zenhalab Trigger {#trigger}

Pick an event. Activating the workflow subscribes its webhook to that event; deactivating removes it. The trigger **checks the signature** of every delivery with the secret it received when it subscribed, and refuses anything else, so a forged request never starts your workflow.

### Zenhalab Trigger: events {#n8n-triggers}

| Event in n8n | Event | App |
| --- | --- | --- |
| Ñomongeta: New Conversation | [`nomongeta.conversation.started`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-conversation-started) | Ñomongeta |
| Ñomongeta: Conversation Closed | [`nomongeta.conversation.closed`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-conversation-closed) | Ñomongeta |
| Ñomongeta: New Incoming Message | [`nomongeta.message.received`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-message-received) | Ñomongeta |
| Ñomongeta: New Outgoing Message | [`nomongeta.message.sent`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-message-sent) | Ñomongeta |
| Ñomongeta: Handoff Requested | [`nomongeta.handoff.requested`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-handoff-requested) | Ñomongeta |
| Ñomongeta: Handoff Assigned | [`nomongeta.handoff.assigned`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-handoff-assigned) | Ñomongeta |
| Ñomongeta: Flow Run Completed | [`nomongeta.flow.run.completed`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-flow-run-completed) | Ñomongeta |
| Ñomongeta: Flow Run Failed | [`nomongeta.flow.run.failed`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-flow-run-failed) | Ñomongeta |
| Ñomongeta: New Contact | [`nomongeta.contact.created`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-contact-created) | Ñomongeta |
| Ñomongeta: Contact Updated | [`nomongeta.contact.updated`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-contact-updated) | Ñomongeta |
| Ñomongeta: New Lead Captured | [`nomongeta.lead.captured`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#nomongeta-lead-captured) | Ñomongeta |
| Account: New Subscription | [`account.subscription.created`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#account-subscription-created) | Ñomongeta |
| Account: Subscription Updated | [`account.subscription.updated`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#account-subscription-updated) | Ñomongeta |
| Account: Subscription Canceled | [`account.subscription.canceled`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#account-subscription-canceled) | Ñomongeta |
| Account: New Payment | [`account.payment.succeeded`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#account-payment-succeeded) | Ñomongeta |
| Account: Payment Failed | [`account.payment.failed`](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/events#account-payment-failed) | Ñomongeta |

### Zenhalab node: operations {#n8n-actions}

| Resource › operation | What it does | Scope |
| --- | --- | --- |
| Ñomongeta › Create or Update Contact | Adds a contact, or updates the one with that address (fields are the workspace's contact variables). | `nomongeta:write` |
| Ñomongeta › Find Contact (search) | Finds a contact by address (phone number or e-mail). | `nomongeta:read` |
| Ñomongeta › Start WhatsApp Conversation | Starts a WhatsApp conversation with an approved template, to a contact who opted in. | `nomongeta:write` |
| Ñomongeta › Send Message | Sends a message in a conversation (free text inside WhatsApp's 24-hour window, a template any time). | `nomongeta:write` |
| Ñomongeta › Start Flow | Starts an active flow in a conversation. | `nomongeta:write` |
| Ñomongeta › Add Knowledge Document | Adds a document to an agent's knowledge. | `nomongeta:write` |

Each output item is the event: `id` (skip repeats with it), `type`, `timestamp`, `subject` and `data`.

## Good to know {#good-to-know}

- Each active trigger is one [REST hook](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/rest-hooks): it shows on the Integrations page and counts toward the endpoint limit.
- If the hook was turned off (deliveries kept failing, or its secret was rotated on the Integrations page), deactivate and activate the workflow: it replaces the hook with a fresh one. A hook you paused on the page stays paused.
- Your n8n must be reachable from the internet over HTTPS for triggers to receive events.

## Without the package {#webhook-node}

The built-in **Webhook** node works too: [add its production URL as a webhook](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/webhooks#add), and [verify the signature](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/verify-signatures) in a **Code** node. For actions, use the **HTTP Request** node against the [API](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/integrations/api) with your key.
