Skip to content

antonylu0826/XafN8nChat

Repository files navigation

AI Chat Integration between XAF and n8n

XAF n8n Chat

This project demonstrates how to integrate XAF¡¦s AI chat functionality with n8n using a Blazor UI. The integration enables seamless communication between XAF's AI services and the n8n workflow automation platform.

Overview

This solution provides:

  • XAF AI Chat: An interactive dialogue system powered by AI.
  • n8n Integration: Automates processes by responding to chat events via n8n workflows.

Prerequisites

  • .NET 8 SDK
  • A Blazor Server hosting environment
  • A running instance of n8n (self-hosted or cloud)
  • XAF configuration with AI chat functionality enabled

Installation & Setup

1. Configure XAF AI Chat

  • Clone the XAF project:
    git clone https://github.com/antonylu0826/XafN8nChat.git

2. Set Up n8n

  • Install and start n8n following the official guide: n8n Installation Guide
  • Create a workflow that can receive application endpoints or events. You can upload the sample workflow from the repository (n8n sample). Sample Flow
  • Get the webhook URL from n8n. This will be used to communicate between Blazor Server and n8n. WebHook Url

3. Update Blazor Server Application

  • In Startup.cs, update the service configuration to include the XAF AI chat module:
    services.Addn8nChat(configureOptions => {
        configureOptions.ChatUrl = "<your_n8n_webhook_url>";
    });

For example, your controller might include an action that sends a chat message to the n8n webhook:

Run the Application

  1. Build and run the Blazor Server project

Troubleshooting

  • API Errors: Ensure the webhook URL is correct and n8n is running.
  • Configuration Issues: Verify that the XAF AI chat module and n8n setup (e.g., API key) are correctly configured.
  • Network Connectivity: Test the connection between the Blazor Server and the n8n instance.

Additional Resources

This README provides a brief guide for integrating XAF's AI chat functionality with n8n. Please adjust it according to your specific environment and needs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published