Sentiment Agent
The Sentiment Agent analyzes text and returns a sentiment classification. It costs 2 credits per execution.
When to Use
Use the Sentiment Agent when you need to automatically classify the tone of text content such as social media posts, comments, or messages. It is ideal for filtering workflows based on positive or negative sentiment.
Inputs
Output Formats
Text
Returns one of: positive, negative, or neutral
Number
Returns 1 for positive, 0 for neutral, or -1 for negative
Boolean
Returns true for positive or neutral sentiment, false for negative
Output Variables
Syntax Example
Reference the output in subsequent nodes:
{{ !ref($.steps.sentiment1.result.sentiment) }}Example Workflow: Filter Social Posts by Sentiment
Example Workflow: Filter Social Posts by Sentiment
1. Fetch Search Results - get latest posts from a saved search
2. Loop - iterate through each post
3. Sentiment Agent - analyze the post body with outputFormat: text
4. If Condition - check if result equals "negative"
5. Configure Signal - create a signal for negative posts
Pro tip: Use the number output format when you need granular sentiment scoring, for example to rank posts from most positive to most negative.
Related articles
More in AI Agents
General AgentStill need help? Ask the team