n8n-integration.mdx 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ---
  2. title: "n8n"
  3. description: "Connect your Agencii agents to n8n workflows using the Agencii community node."
  4. icon: "plug"
  5. ---
  6. ## Feature Overview
  7. 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.
  8. ## Prerequisites
  9. - **Agencii Platform account** with at least one deployed agency and agent.
  10. - **Platform API Key** – available under **Settings → API Keys** in the Agencii dashboard.
  11. - **n8n instance** with permissions to install **Community Nodes**.
  12. <Note>
  13. 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/.
  14. </Note>
  15. ## Step 1: Set up n8n Integration in Agencii
  16. <Steps>
  17. <Step title="Create an n8n Platform integration">
  18. 1. In the Agencii dashboard, open **Deploy → Platforms** from the sidebar and click **New Platform**.
  19. ![Create a new platform modal with n8n option](/images/integrations/n8n-integration/n8n-platforms-tab.png)
  20. 2. In the **Create a New Platform** dialog, select **n8n** and click **Create Platform**.
  21. ![Select n8n as the platform type](/images/integrations/n8n-integration/n8n-create-a-new-platform-modal.png)
  22. 3. On the **Configure n8n Integration** screen, choose:
  23. - **Agency** – the agency you want n8n to talk to.
  24. - **Default Agent** – the agent that will receive messages from this integration.
  25. - **Integration Name** – an internal name that will also help you identify the node inside n8n.
  26. - **Integration Description** – optional context for future reference.
  27. 4. Click **Save and continue**.
  28. ![Configure n8n integration with agency and default agent](/images/integrations/n8n-integration/n8n-configure-n8n-integration.png)
  29. </Step>
  30. <Step title="Copy integration data for n8n">
  31. After saving, you’ll see the **Copy n8n Data** screen. It includes:
  32. - **NPM package name**: `n8n-nodes-agencii` – used to install the node in n8n Community Nodes.
  33. - **Integration ID** – a unique identifier that routes messages from n8n to this specific Agencii integration.
  34. - **API Key hint** – your first platform API key (you can manage keys under **Settings → API Keys**).
  35. ![Copy n8n data showing npm package name, integration ID and API key hint](/images/integrations/n8n-integration/n8n-configure-n8n-copy-step.png)
  36. Keep the **Integration ID** handy—you’ll paste it into the Agencii node inside n8n.
  37. <Note>
  38. 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.
  39. </Note>
  40. </Step>
  41. </Steps>
  42. ## Step 2: Install the Agencii Community Node in n8n
  43. <Steps>
  44. <Step title="Install the node">
  45. ![Install community node modal with n8n-nodes-agencii package name](/images/integrations/n8n-integration/n8n-install-community-node-modal.png)
  46. 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/.
  47. 2. Click **Install** and enter the package name:
  48. ```bash
  49. n8n-nodes-agencii
  50. ```
  51. 3. Confirm the installation. After it completes, an **Agencii** node will appear in your n8n node palette.
  52. ![Agencii node package listed in Community nodes](/images/integrations/n8n-integration/n8n-community-nodes-added-pkg.png)
  53. ![Workflow canvas with Agencii node selected from the node list](/images/integrations/n8n-integration/n8n-workflow-add-agencii-node.png)
  54. </Step>
  55. </Steps>
  56. ## Step 3: Use the Agencii Node in a Workflow
  57. The Agencii node exposes a single operation designed to send messages to your agency and receive structured responses.
  58. <Steps>
  59. <Step title="Configure the Agencii node">
  60. 1. Add an **Agencii** node to your workflow.
  61. ![Agencii Send message to agency node with parameters filled in](/images/integrations/n8n-integration/n8n-send-message-node-params.png)
  62. ![Agencii node details with available actions](/images/integrations/n8n-integration/n8n-node-details-panel.png)
  63. 2. Select your **Agencii API** credentials.
  64. 3. Under **Resource**, choose **Chat**, and under **Operation**, select **Send Message**.
  65. 4. Configure the main fields:
  66. - **Integration ID** *(required)* – paste the Integration ID from your Agencii n8n Platform integration.
  67. - **Message** *(required)* – the prompt or instruction you want your default agent to process.
  68. - **Session ID** *(optional)* – reuse the `sessionId` from a previous run to continue the same conversation; leave empty to start a new session.
  69. - **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.
  70. </Step>
  71. <Step title="Understand the node output">
  72. The Agencii node returns a JSON payload with (among others):
  73. - `text` / `response` – the main answer from your agency.
  74. - `sessionId` – the session identifier to reuse for multi-turn conversations.
  75. - `n8nIntegrationId` – the platform integration that handled the request.
  76. You can pass these values into downstream nodes (e.g., email, CRM, webhooks) to build complete automations.
  77. </Step>
  78. </Steps>
  79. ## Example Use Cases
  80. - **Human-in-the-loop review** – send form or CRM data to your agency, then route the response into an approval step.
  81. - **Content generation pipelines** – trigger the Agencii node from schedules or webhooks and store generated content in Google Sheets, Notion, or a database.
  82. - **Multi-step analysis** – chain multiple Agencii nodes while reusing `sessionId` to keep context across data enrichment, analysis, and recommendation steps.