๐Ÿ”Œ n8n Integration

Updated today

โ€ข

5 min read

n8n is a workflow automation tool, available in the cloud or self-hosted. You can connect Perfect Wiki to n8n today in two ways. Neither needs a dedicated Perfect Wiki node:

  • HTTP Request node + Perfect Wiki Public API. Best for regular workflows that create, update or read pages on a trigger, for example "when a new employee is added in the HR system, create their onboarding page."
  • MCP Client Tool node + Perfect Wiki MCP server. Best for n8n AI Agent workflows, where the agent decides when to search, read or write pages.
 HTTP Request + Public APIMCP Client Tool + MCP server
Works withAny n8n workflown8n AI Agent node
AuthenticationAPI token (one per knowledgebase)Sign in with your Perfect Wiki account (OAuth)
KnowledgebasesOne per tokenOne or several, chosen on the consent screen
You controlEvery request (method, URL, body)Which tools the agent may use
Good forPredictable automations: create, update and sync pagesChat and assistant flows: answer questions, draft pages

Option 1: HTTP Request node and the Public API

Step 1. Get an API token

  1. Open the Perfect Wiki administration panel.
  2. Find the knowledgebase you want n8n to work with.
  3. Open the API Access section and click Generate API Key.
  4. Copy the token right away. It is shown only once.

Each token works with one knowledgebase. Full details are in ๐Ÿ”Œ Perfect Wiki Public API.

Step 2. Create the credential in n8n

  1. In n8n, go to Credentials โ†’ Create credential.
  2. Choose Bearer Auth and paste your Perfect Wiki token.
  3. Save it with a clear name, for example Perfect Wiki โ€“ HR knowledgebase.

You can also use Header Auth with the name Authorization and the value Bearer YOUR_API_TOKEN.

Step 3. Add an HTTP Request node

Set Authentication to Generic Credential Type and pick the credential from step 2. Then use one of these requests:

What you want to doMethodURL
List pagesGEThttps://api.perfectwiki.xyz/api/public-api/v1/knowledgebase
Read a pageGEThttps://api.perfectwiki.xyz/api/public-api/v1/page/PAGE_ID
Create a pagePOSThttps://api.perfectwiki.xyz/api/public-api/v1/page
Update a pagePOSThttps://api.perfectwiki.xyz/api/public-api/v1/page/PAGE_ID
Delete a pageDELETEhttps://api.perfectwiki.xyz/api/public-api/v1/page/PAGE_ID
Ask a question (AI answer)POSThttps://api.perfectwiki.xyz/api/public-api/v1/knowledgebase/query

For POST requests, turn on Send Body, set Body Content Type to JSON and choose Using JSON. Page content must be HTML, not Markdown.

Example: create an onboarding page for a new hire

Put the HTTP Request node after your trigger (for example a Webhook from your HR system) and use n8n expressions to fill in the fields:

{
  "title": "Welcome, {{ $json.firstName }} {{ $json.lastName }}",
  "content": "<p>Start date: {{ $json.startDate }}</p><p>Manager: {{ $json.manager }}</p>",
  "tags": ["onboarding"],
  "parentId": "ONBOARDING_PARENT_PAGE_ID"
}

The response contains the new page ID in page.id. Save it if you want to update the same page later in the workflow, or post its link to Jira, Teams or email.

Example: answer a question from your knowledgebase

POST https://api.perfectwiki.xyz/api/public-api/v1/knowledgebase/query

{ "q": "{{ $json.question }}" }

The answer is in aiBotResponse.response, and links to the source pages are in aiBotResponse.relatedPages. Each call counts as an AI request on your plan.

Ready-to-import workflow

Copy the JSON below and paste it into an empty n8n canvas (Ctrl/Cmd + V). Then open the HTTP Request node, pick your Bearer Auth credential and click Execute workflow. A test page appears at the root of your knowledgebase.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perfectwiki.xyz/api/public-api/v1/page",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"title\": \"Hello from n8n\",\n  \"content\": \"<p>This page was created by an n8n workflow.</p>\",\n  \"tags\": [\"n8n\"]\n}",
        "options": {}
      },
      "name": "Create Perfect Wiki page",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 0]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [[{ "node": "Create Perfect Wiki page", "type": "main", "index": 0 }]]
    }
  }
}

Option 2: MCP Client Tool node and the MCP server

Use this option when an n8n AI Agent should work with your wiki, for example a chat assistant that answers questions from Perfect Wiki or drafts a page from a conversation. You need n8n 1.119.0 or later for MCP OAuth2 sign-in.

  1. Add an AI Agent node to your workflow and connect a chat model to it.
  2. Under the agent's Tool connector, add an MCP Client Tool node.
  3. Set Endpoint to https://api.perfectwiki.xyz/mcp and Server Transport to HTTP Streamable.
  4. Set Authentication to MCP OAuth2 and create a new credential. Leave Use Dynamic Client Registration on.
  5. Click Connect my account, sign in to Perfect Wiki, choose the knowledgebases and the access level (Read only or Read & Write), and approve.
  6. In Tools to Include, choose All, or Selected to give the agent only some tools. For a read-only assistant, select ask, list_knowledgebases, list_pages and get_page.

The agent can then use the same tools as Claude or ChatGPT: ask, list_knowledgebases, get_knowledgebase, list_pages, get_page, create_page, update_page and delete_page. Read more in ๐Ÿ”Œ Perfect Wiki MCP Server.

Tip: try asking the agent "List the pages in my Perfect Wiki knowledgebase" to check that the connection works.


FAQ

Is there a dedicated Perfect Wiki node in n8n?

Not yet. The HTTP Request and MCP Client Tool nodes give you full access to Perfect Wiki today. If you'd like a dedicated node, let us know at docs.perfectwiki.com/feedback.

Can n8n start a workflow when a page is created or changed?

Perfect Wiki doesn't send webhooks yet. To react to changes, use a Schedule Trigger that lists pages on a regular interval and compares the results.

Can one workflow work with several knowledgebases?

Yes. With the Public API, create one credential per knowledgebase, since each token belongs to one knowledgebase. With MCP, select several knowledgebases on the consent screen, and the agent picks the right one.

Are there rate limits?

Yes: 10 requests per second and 60 per minute for each token. If a workflow processes many items at once, turn on Batching in the HTTP Request node options or add a Wait node. A 429 error means you hit the limit; wait and retry.

I'm getting a 402 error.

If the code is TRIAL_EXPIRED, your free trial has ended and API access is paused until your organization picks a paid plan. If you only get 402 from the AI query endpoint, you've used this month's AI query allowance; the other endpoints keep working.

Is n8n the only automation tool supported?

No. Perfect Wiki also works with Zapier, Power Automate, Make, Pipedream and Activepieces.

Need help?

If something doesn't work as expected, contact support.

Was this page helpful?