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

# n8n

> Setup Guide for n8n Local using ZnapAI Gateway

# n8n Local Setup (Windows) with OpenAI-Compatible Gateway

## Prerequisites

* Node.js installed
* n8n installed globally

```powershell theme={null}
npm install -g n8n
```

Verify installation:

```powershell theme={null}
n8n --version
```

Start n8n:

```powershell theme={null}
n8n start
```

n8n will be available at:

```text theme={null}
http://localhost:5678
```

***

# Initial Account Setup

On first launch, n8n will prompt you to create an owner account.

Fill in:

```text theme={null}
Email
First Name
Last Name
Password
```

Password requirements:

* Minimum 8 characters
* At least 1 uppercase letter
* At least 1 number

The "I want to receive security and product updates" checkbox is optional.

After completing registration, you'll be redirected to the n8n dashboard.

***

# Connecting n8n to an OpenAI-Compatible Gateway

This method works with:

* ZnapAI
* Any OpenAI-compatible endpoint

## Step 1: Open Chat

From the left sidebar:

```text theme={null}
Chat
```

***

## Step 2: Select a Model

Click:

```text theme={null}
Select a model
```

Choose:

```text theme={null}
OpenAI
```

***

## Step 3: Create Credentials

When prompted, create a new credential.

Enter:

```text theme={null}
API Key:
<your-api-key>

Base URL: https://api.znapai.com/v1
```

<Frame>
  <img src="https://mintcdn.com/znapai/1L_GdOoq052j6SDb/images/integrations/n8n-configuration.png?fit=max&auto=format&n=1L_GdOoq052j6SDb&q=85&s=527a810eb8199b9067d382ee6fc5e829" alt="n8n Configuration" width="1919" height="973" data-path="images/integrations/n8n-configuration.png" />
</Frame>

***

## Step 4: Save Credential

Click:

```text theme={null}
Save
```

n8n will store the credential securely and make it available for future workflows and agents.

***

## Step 5: Test the Connection

Send a message in the Chat interface.

Example:

```text theme={null}
Explain event-driven architecture in one paragraph.
```

If configured correctly:

* n8n sends the request to your gateway
* The gateway routes the request to the selected model
* The response appears in the chat

***

# Verification

If using ZnapAI or any other Gateway Provider, monitor the gateway logs.

You should see incoming requests from n8n whenever a chat message is sent.

Example validation flow:

```text theme={null}
n8n Chat
    ↓
OpenAI Credential
    ↓
Gateway (ZnapAI)
    ↓
Model Provider
    ↓
Response
```

If requests appear in gateway logs, the integration is working correctly.

***

# Next Steps

Once chat is working, you can build workflows and AI agents.

Typical architecture:

```text theme={null}
Webhook / Trigger
        ↓
AI Agent
        ↓
OpenAI-Compatible Gateway
        ↓
Tools
        ↓
Actions
```

Examples:

* GitHub Issue Summarizer
* Slack AI Assistant
* CRM Lead Qualification Agent
* Customer Support Automation
* RAG Knowledge Assistant
* Email Classification and Routing

At this point, n8n is successfully configured to use your OpenAI-compatible gateway for both chat and workflow-based AI automation.
