CW Ticket Sentiment Analyzer
Function agent guide for Builder — retrieve and cache ConnectWise ticket sentiment for reuse across agent workflows.
Reusable Ticket Sentiment & Experience Analysis Function
Overview
Section titled “Overview”CW Ticket Sentiment Analyzer is a function-style agent that retrieves and analyzes sentiment from ConnectWise ticket notes.
It accepts a list of ticket IDs, generates sentiment analysis when needed, and caches results for reuse.
This allows other agents to obtain reliable ticket sentiment quickly without regenerating analysis.
Purpose
Section titled “Purpose”This function provides a reusable mechanism for:
- analyzing ticket sentiment
- summarizing technician–client interactions
- capturing customer feedback signals
- reducing repeated LLM processing through caching
It is designed to be called by other agents as part of larger workflows.
Role in the agent ecosystem
Section titled “Role in the agent ecosystem”Used by:
- reporting agents
- client health scoring agents
- service quality monitoring workflows
- operational insight pipelines
Problem it solves:
- eliminates repeated sentiment generation
- reduces compute cost and latency
- standardizes sentiment interpretation across workflows
Without this function, agents would need to individually retrieve and analyze ticket notes, increasing runtime and cost.
Invocation and execution
Section titled “Invocation and execution”This function is called by another agent using a Call Agent node.
Execution model: synchronous
Trigger: agent flow logic
Prerequisite: list of ConnectWise ticket IDs
Inputs
Section titled “Inputs”The function accepts an array of ticket objects.
Required
Section titled “Required”ticket_id(number)
Optional
Section titled “Optional”-
include_internal(boolean, default: false)
include internal notes in sentiment analysis -
force_refresh(boolean, default: false)
bypass cache and regenerate sentiment
Example input
Section titled “Example input”[ { "ticket_id": 123 }, { "ticket_id": 1234, "include_internal": true, "force_refresh": true }]Outputs
Section titled “Outputs”The function returns the input array with added sentiment data.
Existing properties are preserved.
Added properties
Section titled “Added properties”"sentiment": { "sentiment": "positive | negative | neutral | unknown", "sentiment_score": -1.0 to 1.0, "explanation": "reason sentiment was assigned", "synopsis": "summary of ticket notes", "feedback": "customer feedback to technician"},"cached": truecachedindicates whether the sentiment was retrieved from cache.
Consumed by: any calling agent.
Data source
Section titled “Data source”ConnectWise
Section titled “ConnectWise”The function retrieves:
- ticket notes
- last update timestamps
Cache keys are based on:
- ticket ID
- include_internal flag
Processing flow
Section titled “Processing flow”For each ticket:
-
Retrieve ticket metadata and last update time
-
Check cache for matching sentiment record
-
If cache is valid → return cached result
-
If cache miss or refresh requested:
- pull ticket notes
- generate sentiment using LLM analysis
- store result in cache
-
return sentiment data
This ensures sentiment reflects the most recent ticket state.
Smart analysis
Section titled “Smart analysis”Sentiment analysis is generated using LLM interpretation of ticket notes.
The function extracts:
- overall sentiment
- customer tone and experience
- feedback directed toward technicians
- a concise synopsis of interactions
Rules and safeguards
Section titled “Rules and safeguards”- input validation is enforced per ticket
- malformed entries return element-level errors
- failures prevent cache writes for affected tickets
- ConnectWise timeouts are respected
- agent runtime limit: 2 hours
Performance and efficiency
Section titled “Performance and efficiency”Efficiency features include:
- cache reuse to reduce regeneration
- cache invalidation when ticket updates change
- optional forced refresh
- external request timeouts
Batching and deduplication are handled by the calling agent.
Failure behavior
Section titled “Failure behavior”If an error occurs:
- missing data → element-level error
- external dependency failure → error returned
- malformed input → error returned
The function returns the input array with error messages attached to affected elements.
Boundaries and responsibilities
Section titled “Boundaries and responsibilities”This function does NOT
Section titled “This function does NOT”- return full ticket data
- validate ticket existence before processing
- batch large ticket lists
- manage workflow runtime limits
Calling agents are responsible for
Section titled “Calling agents are responsible for”- validating ticket IDs
- batching requests to stay within runtime limits
- handling downstream logic
Implementation context
Section titled “Implementation context”Runtime: Synthreo Builder
Services: Synthreo DCS
Deployment: Synthreo Builder environment
Summary
Section titled “Summary”CW Ticket Sentiment Analyzer provides:
- reusable ticket sentiment analysis
- consistent customer experience insight
- cache-backed performance efficiency
- structured outputs for downstream automation
It enables other agents to incorporate sentiment intelligence without repeated ticket processing.