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

# n8n

> Use Wiredesk in n8n workflows: start a workflow the moment a conversation ends or a lead is captured, talk to an agent, teach it, manage contacts, and read conversations and leads, with the n8n-nodes-wiredesk community nodes.

The Wiredesk nodes for [n8n](https://n8n.io) come in one community package, `n8n-nodes-wiredesk`: the **Wiredesk** node and the **Wiredesk Trigger**. Each of the Wiredesk node's operations is one endpoint of the [REST API](https://wiredesk.ai/docs/developers/api.md), so it can do what the API does, with an API key from your workspace. n8n's AI Agent can also use it as a tool.

## Install the node

**1. Install it in n8n**

In n8n, go to **Settings → Community nodes → Install** and enter `n8n-nodes-wiredesk`. Self-hosted n8n needs community nodes enabled. See n8n's [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).

**2. Make an API key**

In Wiredesk, go to **Developers → API keys** and make a key for n8n. Only owners and admins see the Developers section. Choose **Read only** if the workflows only read. The **Wiredesk Trigger** needs **Full access**, because it adds a webhook endpoint. See [Authentication](https://wiredesk.ai/docs/api-reference/authentication.md).

**3. Connect your workspace**

Add a **Wiredesk** node to a workflow. Under **Credential**, choose **Create new**, and paste the key. n8n checks it by listing your agents.

## What it does

| Resource | Operations |
| - | - |
| Agent | Create, Delete, Get, Get Many, **Send Message**, Update the name, greeting or instructions |
| Contact | Create, Delete, **Find** by email or phone, Get, Get Many, Update the name |
| Conversation | Export a date range with transcripts, Get, Get Inbox (what needs a person), Get Many, Get Messages, Search, Update (take over or hand back) |
| Knowledge Source | Create from text or a website, Delete, Get Many, Search |
| Lead | Get Many |
| Webhook Endpoint | Create an endpoint for chosen events, Delete, Get Many |
| Workspace | Get Analytics, Get Dashboard, Who Am I |

* **Agent** fields list your workspace's agents by name. You can also paste an ID or use an expression.
* **Get Many** returns 50 items by default. **Return All** follows the API's pages to the end.
* **Simplify**, on by default, trims conversations, inbox items and knowledge sources to their ten most used fields, with the contact flattened into `contact_name` and `contact_value`. Turn it off to get everything the API returns.
* Every **Delete** outputs one item, `{ "deleted": true }`. Nodes added before version 0.1.2 of the package keep their earlier output, with no Simplify.
* **Send Message** works as described in [Talk to an agent](https://wiredesk.ai/docs/developers/api.md#talk-to-an-agent). Pass back the `conversation_id` from the first reply to continue the conversation. Set **User ID** to your own ID for the person, so their conversations share one contact. It's billed as a chat reply.
* **Knowledge Source → Create** with a website returns the source `pending` while the site is crawled. **Get Many** shows when it's `ready`.
* **Conversation → Export** returns up to 25 conversations a page, each with its transcript. **Return All** follows the pages to the end.
* **Agent → Delete** can be undone: an owner can restore the agent from the dashboard for 30 days.

## Start a workflow from a Wiredesk event

The **Wiredesk Trigger** node starts a workflow the moment something happens in Wiredesk. It doesn't check on a schedule.

**1. Add the trigger**

Add **Wiredesk Trigger** to a workflow and choose a credential with a **Full access** key. Pick the events: **Conversation Ended**, **Handover Requested**, **Lead Captured** or **Message Created**.

**2. Activate the workflow**

Activating it adds a [webhook endpoint](https://wiredesk.ai/docs/developers/webhooks.md) in Wiredesk for the workflow's URL. You'll see it under **Developers → Webhooks**, described as `n8n: <node name>`. Deactivating the workflow, or deleting it, removes the endpoint. **Listen for test event** in the editor adds a second endpoint for the test URL while it listens, and leaves the production one alone. If the endpoint was switched off in Wiredesk, for example after days of failed deliveries, the next activation replaces it.

**3. Use the event**

Each run gets the event's `type`, its `timestamp`, its `data` with the same objects the API returns, and `delivery_id`. [Webhooks](https://wiredesk.ai/docs/developers/webhooks.md) lists what `data` holds for each event.

* Wiredesk sends events only to `https` URLs on a public host, so an n8n on `localhost` needs a tunnel or a public URL (`WEBHOOK_URL`).
* Every delivery is signed. The trigger checks the signature with the endpoint's secret, which it keeps in the workflow, and refuses one that doesn't match. A delivery more than five minutes old is refused too.
* A workspace can have up to 10 webhook endpoints, and each active Wiredesk Trigger uses one. If you've reached 10, deactivate a workflow you no longer need or remove an endpoint you don't use.
* A message from the dashboard's **Send test event** is answered but doesn't start the workflow.
* Phone and browser-voice transcripts aren't sent line by line. Use **Conversation Ended**, then **Conversation → Get Messages**, to read them.

## Errors

The node shows the API's message, what to do about it, and the API's error code, for example `(Wiredesk code: read_only_key)`. The ones you're most likely to see:

| Code | What to do |
| - | - |
| `unauthorized` | The key is wrong, revoked, or its maker is no longer an owner or admin. Make a new key and update the credential. |
| `read_only_key` | Use a **Full access** key for operations that change something, and for the Wiredesk Trigger. |
| `webhook_limit` | The workspace has 10 webhook endpoints already. Deactivate a workflow with a Wiredesk Trigger you no longer need, or remove an endpoint under **Developers → Webhooks**. |
| `channel_disabled` | **Send Message** uses the agent's chat channel. Switch chat on in the agent's **Channels**. |
| `spend_cap_reached` | Raise the spend cap under **Billing**. |
| `rate_limited` | Slow down. Wait for the number of seconds in the `Retry-After` header. |

Every request the node makes is in **Developers → Logs**, under the key's name. See [Request logs](https://wiredesk.ai/docs/developers/logs.md).

## Related

* [REST API](https://wiredesk.ai/docs/developers/api.md)
* [Webhooks](https://wiredesk.ai/docs/developers/webhooks.md)
* [Pipedream](https://wiredesk.ai/docs/integrations/pipedream.md)
* [MCP server](https://wiredesk.ai/docs/developers/mcp.md)


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