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

# n8n

> Connect your Agencii agents to n8n workflows using the Agencii community node.

## Feature Overview

n8n is a flexible workflow automation platform that lets you connect dozens of services in visual flows. The Agencii **n8n community node** (`n8n-nodes-agencii`) connects your agents to these workflows so your agencies can receive tasks, run tools, and send back answers directly inside n8n.

## Prerequisites

* **Agencii Platform account** with at least one deployed agency and agent.
* **Platform API Key** – available under **Settings → API Keys** in the Agencii dashboard.
* **n8n instance** with permissions to install **Community Nodes**.

<Note>
  Existing users currently need to use a self-hosted n8n instance to install the Agencii community node, as the `n8n-nodes-agencii` npm package is in the process of verification. For more details on how this works in n8n, see the n8n community nodes installation guide at [https://docs.n8n.io/integrations/community-nodes/installation/](https://docs.n8n.io/integrations/community-nodes/installation/).
</Note>

## Step 1: Set up n8n Integration in Agencii

<Steps>
  <Step title="Create an n8n Platform integration">
    1. In the Agencii dashboard, open **Deploy → Platforms** from the sidebar and click **New Platform**.

           <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-platforms-tab.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=1cf6b593077b5fb92a70ef76649d8324" alt="Create a new platform modal with n8n option" width="3162" height="1876" data-path="images/integrations/n8n-integration/n8n-platforms-tab.png" />

    2. In the **Create a New Platform** dialog, select **n8n** and click **Create Platform**.

           <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-create-a-new-platform-modal.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=b892fbbc2a5f27dccc670702cccc38db" alt="Select n8n as the platform type" width="1372" height="998" data-path="images/integrations/n8n-integration/n8n-create-a-new-platform-modal.png" />

    3. On the **Configure n8n Integration** screen, choose:
       * **Agency** – the agency you want n8n to talk to.
       * **Default Agent** – the agent that will receive messages from this integration.
       * **Integration Name** – an internal name that will also help you identify the node inside n8n.
       * **Integration Description** – optional context for future reference.

    4. Click **Save and continue**.

           <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-configure-n8n-integration.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=e9b51ac11db0fc1fdb747a981e54c81c" alt="Configure n8n integration with agency and default agent" width="3154" height="1894" data-path="images/integrations/n8n-integration/n8n-configure-n8n-integration.png" />
  </Step>

  <Step title="Copy integration data for n8n">
    After saving, you’ll see the **Copy n8n Data** screen. It includes:

    * **NPM package name**: `n8n-nodes-agencii` – used to install the node in n8n Community Nodes.
    * **Integration ID** – a unique identifier that routes messages from n8n to this specific Agencii integration.
    * **API Key hint** – your first platform API key (you can manage keys under **Settings → API Keys**).

          <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-configure-n8n-copy-step.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=602c915fe8ea65dc4e46d93d4b2a5fdb" alt="Copy n8n data showing npm package name, integration ID and API key hint" width="3132" height="1880" data-path="images/integrations/n8n-integration/n8n-configure-n8n-copy-step.png" />

    Keep the **Integration ID** handy—you’ll paste it into the Agencii node inside n8n.

    <Note>
      To connect Agencii with n8n, copy the NPM package name above and install it in the **Community Nodes** section of your n8n profile settings. After installation, you can use the **Agencii** node in your workflows. To understand the available actions and properties, please refer to the Agencii n8n documentation page.
    </Note>
  </Step>
</Steps>

## Step 2: Install the Agencii Community Node in n8n

<Steps>
  <Step title="Install the node">
    <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-install-community-node-modal.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=a0bdef558eb3dee9fab895da0773f486" alt="Install community node modal with n8n-nodes-agencii package name" width="2652" height="1860" data-path="images/integrations/n8n-integration/n8n-install-community-node-modal.png" />

    1. In your n8n instance, go to **Settings → Community Nodes**. You can learn more about installing and managing community nodes in the official n8n docs at [https://docs.n8n.io/integrations/community-nodes/installation/](https://docs.n8n.io/integrations/community-nodes/installation/).

    2. Click **Install** and enter the package name:

       ```bash theme={null}
       n8n-nodes-agencii
       ```

    3. Confirm the installation. After it completes, an **Agencii** node will appear in your n8n node palette.

           <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-community-nodes-added-pkg.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=6399c0f3335af5f26b0e195f821746da" alt="Agencii node package listed in Community nodes" width="2210" height="670" data-path="images/integrations/n8n-integration/n8n-community-nodes-added-pkg.png" />

           <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-workflow-add-agencii-node.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=38502ad17ee98bf36acc2822e2f7f828" alt="Workflow canvas with Agencii node selected from the node list" width="2646" height="1884" data-path="images/integrations/n8n-integration/n8n-workflow-add-agencii-node.png" />
  </Step>
</Steps>

## Step 3: Use the Agencii Node in a Workflow

The Agencii node exposes a single operation designed to send messages to your agency and receive structured responses.

<Steps>
  <Step title="Configure the Agencii node">
    1. Add an **Agencii** node to your workflow.

    <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-send-message-node-params.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=e4664911a2f0d9cf5500da912eb9adf4" alt="Agencii Send message to agency node with parameters filled in" width="768" height="1740" data-path="images/integrations/n8n-integration/n8n-send-message-node-params.png" />

    <img src="https://mintcdn.com/vrsenai/ocuNEN25YR58T2cP/images/integrations/n8n-integration/n8n-node-details-panel.png?fit=max&auto=format&n=ocuNEN25YR58T2cP&q=85&s=4275af0e6e2bc530c414a655783ebeae" alt="Agencii node details with available actions" width="2906" height="1974" data-path="images/integrations/n8n-integration/n8n-node-details-panel.png" />

    2. Select your **Agencii API** credentials.
    3. Under **Resource**, choose **Chat**, and under **Operation**, select **Send Message**.
    4. Configure the main fields:
       * **Integration ID** *(required)* – paste the Integration ID from your Agencii n8n Platform integration.
       * **Message** *(required)* – the prompt or instruction you want your default agent to process.
       * **Session ID** *(optional)* – reuse the `sessionId` from a previous run to continue the same conversation; leave empty to start a new session.
       * **User Context** *(optional)* – a JSON object with structured data (user IDs, preferences, feature flags) passed to [Agency Context](/additional-features/agency-context). This data is accessible within your agent's tools but is **not** exposed to the LLM.
  </Step>

  <Step title="Understand the node output">
    The Agencii node returns a JSON payload with (among others):

    * `text` / `response` – the main answer from your agency.
    * `sessionId` – the session identifier to reuse for multi-turn conversations.
    * `n8nIntegrationId` – the platform integration that handled the request.

    You can pass these values into downstream nodes (e.g., email, CRM, webhooks) to build complete automations.
  </Step>
</Steps>

## Example Use Cases

* **Human-in-the-loop review** – send form or CRM data to your agency, then route the response into an approval step.
* **Content generation pipelines** – trigger the Agencii node from schedules or webhooks and store generated content in Google Sheets, Notion, or a database.
* **Multi-step analysis** – chain multiple Agencii nodes while reusing `sessionId` to keep context across data enrichment, analysis, and recommendation steps.
