Sentiment Analysis Action
Overview
The Analyze Sentiment action uses AI to analyze the emotional tone and sentiment of text. This powerful tool helps you understand customer feedback, reviews, comments, and other text-based communications automatically.
What It Does
The Sentiment Analysis action:
Classifies sentiment as positive, neutral, or negative
Measures confidence in the classification (0-1 scale)
Calculates polarity from -1.0 (strongly negative) to +1.0 (strongly positive)
Provides probability scores for each sentiment category
Identifies key highlights - specific phrases that influenced the sentiment
Detects language of the input text
Key Benefits
Automate feedback analysis - Understand customer sentiment without manual review
Trigger actions based on sentiment (e.g., escalate negative feedback)
Track customer satisfaction over time
Prioritize responses to negative feedback
Analyze reviews and comments at scale
How to Use
Adding the Action
In your workflow builder, click Add Action
Navigate to the AI category
Select Analyze Sentiment
Configure the text input (see Configuration below)
Use the output in subsequent workflow steps
Configuration
Text Input (Required)
The text to analyze for sentiment. You can:
Enter text directly: Type or paste the text you want to analyze
Use variables: Reference data from your workflow context
{customer.feedback}- Customer feedback text{booking.notes}- Booking notes{review.comment}- Review commentsAny text field from previous workflow steps
Example:
{customer.feedback}Or combine variables with text:
Customer said: "{customer.feedback}" about booking {booking.id}Variable Picker
Click the Use variable button below the text input to:
Browse available variables from your workflow context
Insert variables with proper syntax
See variable descriptions and data types
Output Data
After execution, the action adds a sentiment_analysis object to your workflow context. You can access this data in subsequent steps.
Output Structure
{ "sentiment_analysis": { "sentiment": "positive", "confidence": 0.95, "polarity": 0.8, "scores": { "positive": 0.85, "neutral": 0.10, "negative": 0.05 }, "highlights": [ { "text": "excellent service", "sentiment": "positive" }, { "text": "highly recommend", "sentiment": "positive" } ], "language": "en" } }Output Fields Explained
sentiment
Type: String
Values:
"positive","neutral", or"negative"Description: The primary sentiment classification
Example:
"positive"
confidence
Type: Float
Range: 0.0 to 1.0
Description: How confident the model is in the sentiment classification
Example:
0.95(95% confident)
polarity
Type: Float
Range: -1.0 to +1.0
Description: Sentiment intensity
1.0= Strongly negative0.0= Neutral+1.0= Strongly positive
Example:
0.8(strongly positive)
scores
Type: Object
Description: Probability distribution across all sentiment categories
Properties:
positive: Probability the text is positive (0.0-1.0)neutral: Probability the text is neutral (0.0-1.0)negative: Probability the text is negative (0.0-1.0)
Note: Scores typically sum to approximately 1.0
Example:
{ "positive": 0.85, "neutral": 0.10, "negative": 0.05 }
highlights
Type: Array of objects
Description: Key phrases from the text that contributed to the sentiment decision
Structure: Each highlight contains:
text: The relevant phrasesentiment: The sentiment of that phrase
Count: Typically 2-5 highlights
Example:
[ { "text": "excellent service", "sentiment": "positive" }, { "text": "would not recommend", "sentiment": "negative" } ]
language
Type: String
Format: ISO 639-1 language code
Description: Detected or assumed language of the input text
Examples:
"en"(English),"es"(Spanish),"fr"(French)
Using the Output
Accessing Sentiment Data
Use the output in subsequent workflow steps:
In Conditions
Check sentiment to branch your workflow:
{sentiment_analysis.sentiment} equals "negative"Or use polarity for more nuanced checks:
{sentiment_analysis.polarity} less than -0.5In Notifications
Include sentiment in messages:
Customer feedback sentiment: {sentiment_analysis.sentiment} Confidence: {sentiment_analysis.confidence}In Webhooks
Send sentiment data to external systems:
{ "feedback": "{customer.feedback}", "sentiment": "{sentiment_analysis.sentiment}", "polarity": "{sentiment_analysis.polarity}", "confidence": "{sentiment_analysis.confidence}" }In Variables
Store sentiment for later use:
Variable name: feedback_sentiment Value: {sentiment_analysis.sentiment}Use Cases
These are fictive uses cases to help you understand how you could use this action.
1. Customer Feedback Escalation
Scenario: Automatically escalate negative feedback to management
Workflow:
Trigger: Customer Created or Booking Confirmed
Action: Analyze Sentiment (analyze
{customer.feedback})Condition: If
{sentiment_analysis.sentiment}equals "negative"Action (True branch): Send Notification to manager
Action (False branch): Send standard thank you email
2. Review Monitoring
Scenario: Track sentiment of customer reviews
Workflow:
Trigger: Webhook (when review is submitted)
Action: Analyze Sentiment (analyze review text)
Action: Update Customer (store sentiment in custom field)
Condition: If
{sentiment_analysis.polarity}less than -0.3Action (True branch): Create task for follow-up
3. Support Ticket Prioritization
Scenario: Prioritize support tickets based on sentiment
Workflow:
Trigger: Customer Created (with support ticket)
Action: Analyze Sentiment (analyze ticket description)
Condition: If
{sentiment_analysis.polarity}less than -0.5Action (True branch): Set ticket priority to "High"
Action (False branch): Set ticket priority to "Normal"
4. Automated Response Selection
Scenario: Choose response template based on sentiment
Workflow:
Trigger: Booking Confirmed
Action: Analyze Sentiment (analyze
{booking.notes})Condition: If
{sentiment_analysis.sentiment}equals "positive"Action (True branch): Send Notification (positive template)
Condition (False branch): If
{sentiment_analysis.sentiment}equals "negative"Action (True branch): Send Notification (apology template)
Action (False branch): Send Notification (neutral template)
5. Sentiment Tracking Dashboard
Scenario: Log sentiment data for analytics
Workflow:
Trigger: Scheduled Time (daily)
Action: Find Bookings (from last 24 hours)
Action: Loop (for each booking)
Action: Analyze Sentiment (analyze
{current_item.notes})Action: Send Webhook (send to analytics system)
Examples
Example 1: Basic Sentiment Check
Input Text:
"Amazing experience! The staff was friendly and the service was excellent. Highly recommend!"
Output:
{ "sentiment_analysis": { "sentiment": "positive", "confidence": 0.98, "polarity": 0.92, "scores": { "positive": 0.95, "neutral": 0.04, "negative": 0.01 }, "highlights": [ {"text": "Amazing experience", "sentiment": "positive"}, {"text": "excellent", "sentiment": "positive"}, {"text": "Highly recommend", "sentiment": "positive"} ], "language": "en" } }Example 2: Negative Feedback
Input Text:
"Very disappointed with the service. The booking was incorrect and staff was unhelpful. Will not return."
Output:
{ "sentiment_analysis": { "sentiment": "negative", "confidence": 0.96, "polarity": -0.85, "scores": { "positive": 0.02, "neutral": 0.12, "negative": 0.86 }, "highlights": [ {"text": "Very disappointed", "sentiment": "negative"}, {"text": "incorrect", "sentiment": "negative"}, {"text": "unhelpful", "sentiment": "negative"}, {"text": "Will not return", "sentiment": "negative"} ], "language": "en" } }Example 3: Neutral/Mixed Sentiment
Input Text:
"The booking process was straightforward. The experience was okay, nothing special but no major issues."
Output:
{ "sentiment_analysis": { "sentiment": "neutral", "confidence": 0.78, "polarity": 0.05, "scores": { "positive": 0.25, "neutral": 0.65, "negative": 0.10 }, "highlights": [ {"text": "straightforward", "sentiment": "positive"}, {"text": "okay", "sentiment": "neutral"}, {"text": "nothing special", "sentiment": "neutral"} ], "language": "en" } }Credits and Costs
Credit Usage
The Sentiment Analysis action uses AI credits based on actual token usage:
Prompt tokens: Text you send for analysis
Completion tokens: AI response tokens
Credits are charged after successful execution. The cost depends on:
Length of input text
Complexity of the analysis
Cost Optimization Tips
Analyze only necessary text - Don't include unnecessary context
Use filters - Only analyze feedback that meets certain criteria
Batch processing - Consider analyzing multiple items in a loop efficiently
Monitor usage - Check execution logs to see credit consumption
Best Practices
1. Input Text Quality
Provide complete context - Include enough text for accurate analysis
Avoid very short text - Single words may not provide reliable sentiment
Clean the text - Remove formatting that might interfere (if possible)
2. Interpreting Results
Use confidence scores - Low confidence (< 0.7) may indicate ambiguous text
Consider polarity - More nuanced than simple positive/negative
Review highlights - Understand what influenced the sentiment
Check language - Ensure detected language matches expectations
3. Workflow Design
Handle edge cases - What if sentiment is neutral?
Set thresholds - Use polarity for more nuanced decisions than just sentiment
Combine with other data - Don't rely solely on sentiment
Log results - Store sentiment for historical analysis
4. Error Handling
Validate input - Ensure text exists before analyzing
Handle failures - Set up notifications for analysis failures
Provide fallbacks - Default behavior if sentiment can't be determined
5. Privacy and Ethics
Respect privacy - Only analyze text you have permission to process
Use responsibly - Don't use sentiment to make unfair decisions
Be transparent - Inform customers if their feedback is analyzed
Troubleshooting
Common Issues
Empty or Invalid Text
Problem: Action fails with "Text is required" error
Causes:
Variable is empty or null
Variable doesn't exist in context
Text field is not properly configured
Solutions:
Check that the variable contains text before analyzing
Use a condition to verify text exists
Provide a fallback value:
{customer.feedback||No feedback provided}
Low Confidence Scores
Problem: Sentiment analysis returns low confidence (< 0.5)
Causes:
Text is too short or ambiguous
Mixed sentiment in the text
Unclear or contradictory language
Solutions:
Ensure sufficient text length (at least a sentence)
Review the highlights to understand ambiguity
Consider using polarity instead of sentiment for nuanced decisions
Unexpected Sentiment Classification
Problem: Sentiment doesn't match your expectations
Causes:
Sarcasm or irony in text
Context-dependent meaning
Cultural or language nuances
Solutions:
Review the highlights to see what influenced the decision
Check the polarity score for more nuance
Consider manual review for critical decisions
Use confidence scores to identify uncertain classifications
API Errors
Problem: "API error" or "Failed to analyze sentiment"
Causes:
API service temporarily unavailable
Invalid API configuration
Rate limiting
Solutions:
Retry the workflow execution
Contact support if issues persist
Enable failure notifications to catch errors quickly
Debugging Tips
Check execution logs - Review input and output data
Test with sample text - Verify the action works with known examples
Use test mode - Test workflows before activating
Verify variables - Ensure text variables contain expected data
Review highlights - Understand what influenced the sentiment
Technical Details
AI Model
The action uses GPT-4o-mini for sentiment analysis, optimized for:
Fast response times
Cost efficiency
Accurate sentiment classification
Response Format
The AI returns structured JSON with:
Sentiment classification
Confidence metrics
Detailed scores
Key highlights
Language detection
Language Support
The action can analyze text in multiple languages. The detected language is returned in the language field using ISO 639-1 codes.
Limitations
Text Length
Very short text (< 10 characters) may produce less reliable results
Very long text (> 10,000 characters) may be truncated or produce less focused analysis
Optimal length: A few sentences to a paragraph
Accuracy Considerations
Sarcasm and irony may be misclassified
Context-dependent meaning may not be fully captured
Mixed sentiment may result in neutral classification
Cultural nuances may affect interpretation
Processing Time
Analysis typically completes in 1-3 seconds
Longer text may take slightly more time
Network latency can affect response times
Related Actions
Send Notification - Use sentiment to personalize messages
Set Variable - Store sentiment for later use
Condition - Branch workflows based on sentiment
Send Webhook - Forward sentiment data to external systems
Conclusion
The Sentiment Analysis action is a powerful tool for understanding customer feedback and automating responses based on emotional tone. By integrating sentiment analysis into your workflows, you can:
Respond faster to negative feedback
Identify satisfied customers for testimonials
Track customer satisfaction trends
Automate personalized communications
Make data-driven decisions about customer service
Start with simple use cases and gradually build more complex workflows as you become comfortable with the sentiment data.
For more information about workflows in general, see the Workflows Documentation.
