Actions9
- Text Actions
- Image Actions
- Audio Actions
- Embedding Actions
Overview
This node integrates with Cloudflare Workers AI models to perform various AI-powered text processing tasks. Specifically, for the Text Classification operation, it classifies input text into categories using a pre-trained sentiment analysis model. This is useful in scenarios such as sentiment analysis of customer feedback, categorizing support tickets, or filtering content based on tone or subject.
Practical examples:
- Automatically classify product reviews as positive or negative.
- Categorize social media posts by sentiment or topic.
- Filter emails or messages based on their content classification.
Properties
| Name | Meaning |
|---|---|
| Text | The text string that you want to classify into categories. |
Output
The output JSON contains the classification result under the json field. It typically includes the classification labels and associated confidence scores returned by the AI model. The structure is derived from the API response's result property.
Example output structure (simplified):
{
"label": "positive",
"confidence": 0.95
}
No binary data is produced for this operation.
Dependencies
- Requires an active Cloudflare account with access to the Cloudflare Workers AI API.
- Needs an API authentication token credential configured in n8n to authorize requests.
- The node sends HTTP POST requests to Cloudflare’s AI endpoint specific to the text classification model (
distilbert-sst-2-int8).
Troubleshooting
Common issues:
- Invalid or missing API token: Ensure your Cloudflare API key/token is correctly set up in n8n credentials.
- Network or permission errors: Verify network connectivity and that your Cloudflare account has permissions to use the AI models.
- Input text too long or empty: Provide valid non-empty text within any length limits imposed by the API.
Error messages:
"Request failed": Generic failure; check API token validity and request payload.- Errors containing
"message"from the API response indicate specific issues like invalid parameters or quota exceeded.
To resolve errors, verify credentials, input data correctness, and consult Cloudflare API usage limits.
Links and References
- Cloudflare Workers AI Documentation
- DistilBERT Model Info
- n8n HTTP Request Node Documentation (for understanding HTTP calls)