messageAiResponse Documentation
Overview
The messageAiResponse logic is designed for generating AI draft responses to incoming messages across various communication platforms. The primary objective is to facilitate the auto-creation of replies which are output in a structured format that can be easily integrated into downstream send nodes for platforms like Outlook, WhatsApp, and Teams. The logic processes multiple messages at once, allowing for efficient handling of communications workflows.
Settings
Setting Details
-
messageColumn
- Input Type: String
- Description: Specifies the column name in the input data that contains the message body that requires a reply. By modifying this setting, you can direct the logic to parse a different column if the standard 'body' column is not used.
- Default Value:
"body"
-
senderColumn
- Input Type: String
- Description: Indicates the column name which contains the sender's information for the message. This allows the generated response to be tailored based on the sender's identity.
- Default Value:
"from"
-
subjectColumn
- Input Type: String
- Description: Defines the column name that holds the subject of the message. The logic uses this to construct contextually relevant replies, especially for email formats.
- Default Value:
"subject"
-
tone
- Input Type: Dropdown (string)
- Description: Determines the tonal approach of the responses generated by the AI. Different tones such as professional or friendly can significantly affect how the message is perceived.
- Options:
professional: Business-appropriate tone.friendly: Warm and approachable tone.empathetic: Understanding and compassion-based responses.formal: Courteous tone for official communications.
- Default Value:
"professional"
-
responseLength
- Input Type: Dropdown (string)
- Description: Controls the length of the AI-generated responses. This allows tailoring the responses based on requirements for brevity or detail.
- Options:
brief: 1-2 sentences maximum.standard: 2-4 sentences.detailed: Thorough responses that cover all points raised.
- Default Value:
"standard"
-
systemInstructions
- Input Type: String
- Description: Additional context that may guide the AI in framing its responses. This can enhance the quality and relevance of replies but is optional.
- Default Value:
""(empty)
-
contextColumn
- Input Type: String (optional)
- Description: If used, this setting specifies a column in the input data that contains additional context information specific to each message, enabling a more personalized response from the AI.
- Default Value:
""(empty)
-
includeOriginal
- Input Type: Boolean
- Description: Controls whether to include the original message in the output. Setting this to true can be helpful in reviewing replies in context.
- Default Value:
true
-
batchSize
- Input Type: Numeric
- Description: Specifies the number of messages to process at once, allowing for efficiency and performance adjustments. High values may cause timeouts; therefore, a cap is imposed on the maximum batch size that can be processed.
- Default Value:
10
How It Works
The messageAiResponse logic goes through the following workflow:
-
Input Handling: It first reads the input data and ensures it is structured correctly. If the data is valid, it extracts necessary columns using the configurations provided.
-
Configuration Defaults: It sets defaults for message handling based on the configuration options provided.
-
Batch Processing: The logic processes messages in manageable batches to improve performance and minimize potential issues with API limits or timeouts.
-
Prompt Generation: It constructs a prompt for the AI integration, specifying the tone, length, and any additional instructions provided.
-
AI Integration: The logic interfaces with the preferred AI integration service to generate the responses. It handles errors gracefully, assigning appropriate error messages.
-
Response Structuring: After retrieving responses, it formats them into a structure compatible with outgoing messaging systems (e.g., Outlook, WhatsApp, Teams).
-
Output Generation: It prepares the final output, combining all processed responses and handling any skipped rows appropriately.
Use Cases & Examples
Use Cases
-
Customer Support Automation:
- Businesses can use
messageAiResponseto automate replies to frequently asked questions or inquiries, reducing the workload on human agents.
- Businesses can use
-
Email Reply Generation:
- Organizations can employ this logic to assist staff in drafting quick email responses, improving response time and consistency.
-
Social Media Management:
- Marketing teams can leverage it for efficiently managing customer interactions on social media platforms, ensuring that replies are timed and relevant.
Example Configuration
Use Case: Automating replies for customer support inquiries.
Scenario: A company handles multiple customer support requests through email and wants AI assistance to generate responses efficiently.
Configuration Data:
{
"messageColumn": "body",
"senderColumn": "from",
"subjectColumn": "subject",
"tone": "empathetic",
"responseLength": "standard",
"systemInstructions": "Please acknowledge the customer's concerns and provide a friendly solution.",
"contextColumn": "additionalInfo",
"includeOriginal": true,
"batchSize": 5
}Explanation: In this example:
- Messages are pulled from the
"body"column. - The sender's details will be fetched from the
"from"column. - Responses will be tailored to be empathetic and include standard-length explanations.
- Additional information such as a
"contextColumn"is utilized to provide context for each customer query. - The original message is retained for clarity.
This configuration allows for efficiently generating high-quality responses to enhance the customer experience while reducing operational burdens.