Using n8n
n8n is an open-source workflow automation platform that allows you to connect different services and automate tasks. This guide shows how to integrate Azerion Intelligence with n8n workflows.
What is n8n?
n8n is a visual workflow automation tool that connects different services through a drag-and-drop interface.
Prerequisites
- n8n instance (cloud or self-hosted) - n8n.io
- Your Azerion Intelligence API key from https://app.azerion.ai/account#api-tokens
Integration Steps
1. Add HTTP Request Node
In your n8n workflow:
- Add an "HTTP Request" node
- Set the request method to
POST
2. Configure Authentication
Create new credentials:
- Type: Generic Credential Type
- Name: "Azerion Intelligence API"
- Credential data:
{
"api_key": "YOUR_AZERION_API_KEY"
}
3. Node Configuration
Configure the HTTP Request node:
{
"url": "https://api.azerion.ai/v1/chat/completions",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{$credentials.azerion_intelligence.api_key}}"
},
"body": {
"model": "meta.llama3-3-70b-instruct-v1:0",
"messages": [
{
"role": "user",
"content": "{{$json.user_message}}"
}
],
"temperature": 0.7,
"max_tokens": 1024
}
}
Basic Example
Simple text classification workflow:
Workflow: Webhook → AI Classification → Send Response
AI Node Configuration:
{
"url": "https://api.azerion.ai/v1/chat/completions",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{$credentials.azerion_intelligence.api_key}}"
},
"body": {
"model": "meta.llama3-3-70b-instruct-v1:0",
"messages": [
{
"role": "system",
"content": "Classify the text as positive, negative, or neutral. Respond with only the classification."
},
{
"role": "user",
"content": "{{$json.text_to_classify}}"
}
],
"temperature": 0.1,
"max_tokens": 10
}
}
Troubleshooting
Authentication Errors
Error: 401 Unauthorized
Solution: Verify API key is correct and active
Rate Limiting
Error: 429 Too Many Requests
Solution: Add retry logic with exponential backoff
Timeout Issues
Error: Request timeout
Solution: Increase timeout in HTTP Request node settings
Response Processing
Extract AI response in a Function node:
const aiResponse = $json.choices[0].message.content;
return { result: aiResponse };