n8n community node for sentiment analysis using Sentor AI API
npm install n8n-nodes-sentorThis is an n8n community node that lets you perform sentiment analysis using the Sentor ML API in your n8n workflows.
n8n is a fair-code licensed workflow automation platform.
Follow the installation guide in the n8n community nodes documentation.
1. Go to Settings > Community Nodes in your n8n instance
2. Select Install a community node
3. Enter n8n-nodes-sentor in the npm package name field
4. Click Install
To get started with local development or manual installation:
``bash`
npm install n8n-nodes-sentor
The Sentor ML node currently supports the following operation:
Analyzes the sentiment of text documents and returns:
- Predicted label (positive, negative, or neutral)
- Confidence probabilities for each sentiment
- Sentence-level sentiment details
You need a Sentor ML API key to use this node:
1. Get your API key from Sentor ML
2. In n8n, go to Credentials > New
3. Search for "Sentor API"
4. Enter your API key
5. Click Save
- Language: Choose between English (en) or Dutch (nl)
- Document Text: The text content to analyze (supports expressions for dynamic input)
- Entities (optional): Comma-separated list of entities to analyze within the text (e.g., "company, product, service")
- Simplify Output: When enabled (default), returns a simplified JSON structure with just label, probability, and details. When disabled, returns the full API response.
Input:
`json`
{
"documentText": "I love this product! It works great.",
"language": "en"
}
Output (simplified):
`json`
{
"label": "positive",
"probability": 0.95,
"details": [
{
"sentence": "I love this product!",
"sentiment": "positive",
"score": 0.97
},
{
"sentence": "It works great.",
"sentiment": "positive",
"score": 0.93
}
]
}
Input:
`json`
{
"documentText": "Apple's new iPhone is expensive but the camera quality is amazing.",
"language": "en",
"entities": "Apple, iPhone, camera"
}
The API will provide sentiment analysis with special attention to the specified entities.
This node supports batch processing. When you pass multiple items to the node, it will:
1. Collect all input items
2. Send them in a single batch request to the API
3. Return individual results mapped to each input item
This is more efficient than processing items one by one.
- Tested with n8n version 1.0.0+
- Requires an active Sentor ML API subscription
* n8n community nodes documentation
* Sentor ML Homepage
* Sentor ML API Documentation
* GitHub Repository
For issues, questions, or contributions:
- GitHub Issues: https://github.com/NIKX-Tech/n8n-nodes-sentor/issues
- Email: erfan@nikx.one
1. Clone the repository:
`bash`
git clone https://github.com/NIKX-Tech/n8n-nodes-sentor.git
cd n8n-nodes-sentor
2. Install dependencies:
`bash`
npm install
3. Build the node:
`bash`
npm run build
4. Test locally:
`bash`
npm run dev
This will start n8n with your local node loaded. You can then test it in your workflows.
bash
cp /path/to/your/sentor-light.svg nodes/Sentor/sentor.svg
cp /path/to/your/sentor-dark.svg nodes/Sentor/sentor.dark.svg
`
3. Rebuild: npm run build$3
In nodes/Sentor/Sentor.node.ts, add to the language options array:
`typescript
{ name: 'French', value: 'fr' },
`Advanced Installation (Self-Hosted)
If you are running a self-hosted n8n instance (e.g., Docker), you can verify the node before publishing:
$3
1. Build and Pack:
`bash
npm run build
npm pack
`
2. Mount to Container:
Update docker-compose.yml:
`yaml
volumes:
- ./n8n-nodes-sentor-0.1.0.tgz:/tmp/node-package.tgz
environment:
- N8N_CUSTOM_EXTENSIONS=/tmp
`
3. Install inside Container:
`bash
docker exec -it n8n_container npm install /tmp/node-package.tgz
`Testing
To test the node in a local n8n instance:
1. Link the package locally:
`bash
npm link
`
2. In your n8n installation directory:
`bash
npm link n8n-nodes-sentor
`
3. Restart n8n and the node will be available.
4. Verify:
- Check "Sentor ML" appears in nodes panel.
- Test connection in Credentials.Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/AmazingFeature)
3. Commit your changes (git commit -m 'Add some AmazingFeature')
4. Push to the branch (git push origin feature/AmazingFeature`)