For the complete documentation index, see llms.txt. This page is also available as Markdown.

n8n

Build powerful AI workflows with TensorX and n8n, the open-source automation platform.


Overview

n8n is a popular workflow automation tool that supports custom AI integrations. With TensorX's OpenAI-compatible API, you can use any of our models in your n8n workflows.

What You Can Build

  • 🤖 AI Agents - Autonomous agents with tool calling

  • 📧 Email Assistants - Auto-respond, classify, summarize emails

  • 📊 Data Processing - Analyze and transform data with AI

  • 💬 Chatbots - Deploy conversational AI on any channel

  • 📝 Content Pipelines - Generate, edit, translate content

  • 🔍 RAG Systems - Build knowledge-based Q&A workflows


Prerequisites

  • n8n instance (Cloud or self-hosted)

  • TensorX API key from app.tensorx.ai


The easiest way to use TensorX with n8n's AI features like AI Agents and LangChain nodes.

Step 1: Create OpenAI Credentials

  1. In n8n, go to CredentialsAdd Credential

  2. Search for OpenAI API

  3. Configure the credential:

Field
Value

API Key

Your TensorX API key

Base URL

https://api.tensorx.ai/v1

Organization ID

Leave empty

  1. Click Save

Step 2: Use in AI Agent Node

  1. Add an AI Agent node to your workflow

  2. Connect an OpenAI Chat Model sub-node

  3. Select your TensorX credential

  4. Configure the model:

Setting
Recommended Value

Model

deepseek/deepseek-chat-v3.1

Temperature

0.7 (or as needed)

Max Tokens

4096

Step 3: Test Your Setup

Create a simple test workflow:

Example prompt: "Explain quantum computing in simple terms"


Method 2: HTTP Request Node (Advanced)

For full control over API calls or using features not exposed in the OpenAI node.

Chat Completion Request

Add an HTTP Request node with these settings:

Request Configuration:

Field
Value

Method

POST

URL

https://api.tensorx.ai/v1/chat/completions

Authentication

Header Auth

Headers:

Header
Value

Authorization

Bearer YOUR_API_KEY

Content-Type

application/json

Body (JSON):

Extract the Response

Add a Code node after the HTTP Request:


Method 3: Custom n8n Credential (Pro Tip)

Create a reusable HTTP credential for TensorX:

  1. Go to CredentialsAdd Credential

  2. Select Header Auth

  3. Configure:

Field
Value

Name

tensorx-api

Name

Authorization

Value

Bearer YOUR_API_KEY

Now use this credential in any HTTP Request node targeting https://api.tensorx.ai.


Example Workflows

1. Email Classifier Agent

Automatically classify incoming emails and route them:

System Prompt:

2. Content Generator Pipeline

Generate blog posts from topics:

3. RAG-Powered Support Bot

Build a knowledge-based chatbot:

System Prompt:

4. Slack AI Assistant


Use Case
Model
Notes

General AI Agent

deepseek/deepseek-chat-v3.1

Best balance of capability and cost

Complex Reasoning

deepseek/deepseek-r1-0528

For multi-step analysis

Code Generation

z-ai/glm-5.1

Optimized for coding tasks

Long Documents

meta-llama/llama-4-maverick

Long document processing

Tool Calling

deepseek/deepseek-chat-v3.1

Strong function calling support


Troubleshooting

"Invalid API Key" Error

  • Verify your API key is correct

  • Ensure you're using the full key (starts with tn_ or similar)

  • Check that Base URL is exactly https://api.tensorx.ai/v1

Model Not Found

  • Use the full model identifier (e.g., deepseek/deepseek-chat-v3.1)

  • Check available models for exact names

Timeout Errors

  • Increase timeout in HTTP Request node options

  • Consider using streaming for long responses

  • For reasoning models, set timeout to 120+ seconds

Rate Limits

If you hit rate limits:

  1. Add a Wait node between API calls

  2. Use the Split in Batches node for bulk processing

  3. Implement retry logic with the Error Trigger


Best Practices

  1. Use System Prompts - Always include clear instructions

  2. Set Temperature Appropriately - Lower (0.3) for factual, higher (0.8) for creative

  3. Limit Max Tokens - Prevent unexpectedly long responses

  4. Cache Responses - Store results to avoid redundant API calls

  5. Handle Errors Gracefully - Use Error Trigger for fallbacks

  6. Secure Credentials - Never expose API keys in workflow data


See Also

Last updated

Was this helpful?