Contact us

Leave your details below and our team members will get in touch with you.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
↖ All posts

How to Use NeurochainAI with N8N: AI Automation Made Simple

Imagine creating workflows that not only automate tasks but also analyze, create, and adapt using NeurochainAI's intelligence. With N8N - a no-code workflow platform, and our AI inference capabilities, you can build powerful, scalable workflows, even as a beginner, low-code developer. This guide walks you through setting up a workflow step-by-step, from configuring triggers to integrating NeurochainAI with HTTP Request nodes.

What is N8N?

N8N is a visual automation tool that connects apps and services to create workflows without writing code. It works by linking tools together for seamless communication.

Think of N8N as a virtual assistant that helps automate repetitive tasks. For example:

  • When a user sends a message to your Telegram bot, N8N can process it with NeurochainAI and automatically respond.
  • Or, when a new email arrives, N8N can forward it to NeurochainAI to summarize its content and send the summary to your Slack channel.

How Do N8N and NeurochainAI Communicate?

The integration between N8N and NeurochainAI is powered by HTTP requests, acting as a bridge for data exchange. This connection allows you to leverage NeurochainAI's inference to create smarter, more dynamic workflows.

Here’s how the process works:

  1. Trigger: An event in N8N starts the workflow - for example, a Telegram message, an incoming email, or a scheduled task.
  2. Request: N8N uses an HTTP Request Node to send event data to NeurochainAI’s API. This could include text to summarize, a description to generate an image, or a creative prompt.
  3. Inference Processing: NeurochainAI processes the AI request using advanced AI models. Our Distributed Inference Network ensures high performance and efficiency.
  4. Response: NeurochainAI sends the processed result - such as a summary, generated image, or other output - back to N8N.
  5. Action: N8N uses the result to complete the workflow, such as sending it via email, saving it to a database, or responding to a Telegram user.

Why Use NeurochainAI’s Inference?

Integrating NeurochainAI into your workflows offers several advantages:

  • Scalability: Distributed  Inference Network processes multiple tasks efficiently, ensuring fast responses even during high demand.
  • Cost Efficiency: Pay only for the resources you use, making AI automation accessible for businesses of all sizes.
  • Flexibility: Choose from a variety of AI models tailored for tasks like text processing, data analysis, and image generation.
  • Reliability: NeurochainAI handles AI tasks with precision and consistency, ensuring dependable results.

Whether you're processing text, analyzing data, or creating visuals, NeurochainAI’s inference seamlessly integrates with your automation needs.

Step-by-Step: Building Your First Workflow

Let’s create a workflow where we process a message from Telegram, summarize it using NeurochainAI, and send the summary back.

1. Set Up a Trigger

To start the workflow, you need a trigger. Here, we’ll use a Telegram Trigger.

  1. Add a Telegram Trigger Node to your workflow in N8N
  2. Configure the node to connect to your Telegram bot:some text
    • Enter your bot’s token (you can generate this token using BotFather on Telegram)
    • Set the trigger to listen for new messages

When a user sends a message to your bot, this node captures it and passes the data to the next step in the workflow.

2. Configure the HTTP Request Node

The HTTP Request Node sends the user’s message to NeurochainAI for processing.

Add an HTTP Request Node to your workflow and connect it to the Telegram Trigger Node.

Configure the HTTP Request Node:

  • Method: Select POST

URL: Enter NeurochainAI’s API endpoint:
https://ncmb.neurochain.io/tasks/message

Headers: Add the required headers to authenticate and format your request:

  • Name: Authorization.
  • Value: Bearer YOUR-API-KEY-HERE. Replace YOUR-API-KEY-HERE with your actual NeurochainAI API key.
  • Name: Content-Type.
  • Value: application/json.

Body: Enter the parameters for the API request in JSON format. For example:

{

  "model": "Meta-Llama-3.1-8B-Instruct-Q6_K.gguf",

  "prompt": "Summarize this message: {{ $json.message.text }}",

  "max_tokens": 1024,

  "temperature": 0.6,

  "top_p": 0.95,

  "frequency_penalty": 0,

  "presence_penalty": 1.1

}

Replace Model with the desired AI model from the NeurochainAI dashboard, and make sure you switch the Field mode from Fixed to Expression when referencing dynamic values like {{ $json.message.text }}.

3. Send the Result Back

Finally, let’s return the AI-generated summary to the Telegram user.

  1. Add a Telegram Send Message Node to your workflow and connect it to the HTTP Request Node.
  2. Configure the node:

Chat ID: Use {{ $('Telegram Trigger').item.json.message.chat.id }} to ensure the reply goes to the correct user. Again, ensure you change the Field mode to Expression to dynamically reference the data.

Message: Include the summary returned by NeurochainAI:
{{ $json.choices[0].text }}

Now, when someone sends a message to your bot, the workflow will trigger, send the message to NeurochainAI for summarization, and return the summary to the user on Telegram.

What Else Can You Automate with NeurochainAI and N8N?

Here are a few ideas to inspire your next workflow:

  • Customer Support: Automatically summarize and reply to customer inquiries.
  • Content Creation: Generate personalized email drafts or visuals for social media.
  • Data Analysis: Process raw data and automatically generate reports.
  • Marketing Campaigns: Automate tailored messages or visuals for your audience.

Why This Integration is a Game-Changer

Integrating N8N with NeurochainAI lets you build workflows that are not just automated but intelligent. AI-powered processes save time, improve accuracy, and unlock new possibilities for your business or projects.

And the best part? You don’t need to write a single line of code.

Start Building Smarter Workflows Today

Ready to create your first AI-powered workflow? Visit NeurochainAI Guides for pre-built templates and detailed instructions. With N8N and NeurochainAI, the future of automation is in your hands.

Continue reading
2024-11-28