> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kaie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Nodes

> Complete reference guide to all available workflow nodes

## Node Overview

Nodes are the building blocks of your Kaie workflows. Each node performs a specific function and can be connected to other nodes to create complex automation flows.

## Message Nodes

### Text Message Node

Send text messages to customers through any connected channel.

<AccordionGroup>
  <Accordion title="Configuration Options">
    * **Message Content**: The text to send
    * **Channel**: Which communication channel to use
    * **Formatting**: Bold, italic, emoji support
    * **Variables**: Insert dynamic content using variables
  </Accordion>

  <Accordion title="Use Cases">
    * Welcome messages
    * Confirmation messages
    * Status updates
    * General communication
  </Accordion>
</AccordionGroup>

### Rich Media Node

Send images, videos, documents, and other media files.

<AccordionGroup>
  <Accordion title="Supported Media Types">
    * Images (JPG, PNG, GIF)
    * Videos (MP4, MOV)
    * Documents (PDF, DOC, XLS)
    * Audio files (MP3, WAV)
  </Accordion>

  <Accordion title="Configuration">
    * **File Source**: Upload or URL
    * **Caption**: Optional text description
    * **Thumbnail**: Custom thumbnail for videos
  </Accordion>
</AccordionGroup>

### Template Message Node

Send pre-approved message templates (required for some channels like WhatsApp Business).

<AccordionGroup>
  <Accordion title="Template Requirements">
    * Must be pre-approved by platform
    * Follow specific formatting rules
    * Include required parameters
  </Accordion>

  <Accordion title="Configuration">
    * **Template ID**: Select from approved templates
    * **Parameters**: Fill in dynamic values
    * **Language**: Choose appropriate language
  </Accordion>
</AccordionGroup>

## AI & Intelligence Nodes

### AI Response Node

Generate intelligent responses using the AI Brain system.

<AccordionGroup>
  <Accordion title="Configuration Options">
    * **Response Type**: Conversational, structured, or hybrid
    * **Knowledge Base**: Select which knowledge base to use
    * **Personality**: Set tone and style (professional, friendly, etc.)
    * **Context Length**: How much conversation history to consider
  </Accordion>

  <Accordion title="Advanced Settings">
    * **Confidence Threshold**: Minimum confidence for auto-responses
    * **Fallback Behavior**: What to do when AI is uncertain
    * **Learning Mode**: Enable continuous learning from interactions
  </Accordion>
</AccordionGroup>

### Sentiment Analysis Node

Analyze customer sentiment and emotions in their messages.

<AccordionGroup>
  <Accordion title="Analysis Types">
    * **Emotion Detection**: Happy, sad, angry, frustrated, etc.
    * **Sentiment Score**: Positive, negative, or neutral
    * **Urgency Level**: Low, medium, or high priority
  </Accordion>

  <Accordion title="Use Cases">
    * Route frustrated customers to human agents
    * Adjust response tone based on sentiment
    * Prioritize urgent issues
  </Accordion>
</AccordionGroup>

### Intent Recognition Node

Identify what the customer wants to accomplish.

<AccordionGroup>
  <Accordion title="Common Intents">
    * **Information Request**: Asking for product details
    * **Problem Report**: Reporting an issue or bug
    * **Purchase Intent**: Showing interest in buying
    * **Support Request**: Need help with existing product
  </Accordion>

  <Accordion title="Configuration">
    * **Intent Categories**: Define custom intent categories
    * **Confidence Threshold**: Minimum confidence for classification
    * **Fallback Intent**: Default when intent is unclear
  </Accordion>
</AccordionGroup>

## Logic & Control Nodes

### Condition Node

Make decisions based on customer input or workflow data.

<AccordionGroup>
  <Accordion title="Condition Types">
    * **Text Contains**: Check if message contains specific words
    * **Variable Comparison**: Compare stored variables
    * **Time-based**: Check current time or date
    * **External Data**: Query external APIs or databases
  </Accordion>

  <Accordion title="Logical Operators">
    * **AND**: All conditions must be true
    * **OR**: Any condition can be true
    * **NOT**: Condition must be false
    * **Complex**: Combine multiple conditions
  </Accordion>
</AccordionGroup>

### Switch Node

Route workflow to different paths based on multiple conditions.

<AccordionGroup>
  <Accordion title="Configuration">
    * **Input Variable**: What to evaluate
    * **Cases**: Different values and their corresponding paths
    * **Default Case**: What to do if no cases match
  </Accordion>

  <Accordion title="Use Cases">
    * Route different product inquiries
    * Handle multiple language preferences
    * Direct to different departments
  </Accordion>
</AccordionGroup>

### Loop Node

Repeat a section of the workflow multiple times.

<AccordionGroup>
  <Accordion title="Loop Types">
    * **Count Loop**: Repeat a specific number of times
    * **While Loop**: Continue while condition is true
    * **For Each**: Loop through a list of items
  </Accordion>

  <Accordion title="Configuration">
    * **Loop Condition**: When to stop looping
    * **Maximum Iterations**: Prevent infinite loops
    * **Loop Variables**: Variables available in each iteration
  </Accordion>
</AccordionGroup>

## Data & Integration Nodes

### Variable Node

Store, retrieve, or modify workflow variables.

<AccordionGroup>
  <Accordion title="Variable Types">
    * **Text**: String values
    * **Number**: Numeric values
    * **Boolean**: True/false values
    * **Object**: Complex data structures
  </Accordion>

  <Accordion title="Operations">
    * **Set**: Assign a value to a variable
    * **Get**: Retrieve a variable's value
    * **Update**: Modify an existing variable
    * **Delete**: Remove a variable
  </Accordion>
</AccordionGroup>

### API Call Node

Make HTTP requests to external APIs.

<AccordionGroup>
  <Accordion title="Request Configuration">
    * **Method**: GET, POST, PUT, DELETE
    * **URL**: Endpoint to call
    * **Headers**: Custom headers
    * **Body**: Request payload
  </Accordion>

  <Accordion title="Response Handling">
    * **Success Path**: What to do on successful response
    * **Error Path**: What to do on error
    * **Response Parsing**: Extract data from response
  </Accordion>
</AccordionGroup>

### Database Node

Query or update database records.

<AccordionGroup>
  <Accordion title="Database Operations">
    * **SELECT**: Retrieve data
    * **INSERT**: Add new records
    * **UPDATE**: Modify existing records
    * **DELETE**: Remove records
  </Accordion>

  <Accordion title="Configuration">
    * **Connection**: Database connection settings
    * **Query**: SQL query to execute
    * **Parameters**: Dynamic query parameters
  </Accordion>
</AccordionGroup>

## Time & Delay Nodes

### Delay Node

Pause workflow execution for a specified time.

<AccordionGroup>
  <Accordion title="Delay Types">
    * **Fixed Delay**: Wait for a specific duration
    * **Random Delay**: Wait for a random time within a range
    * **Business Hours**: Only wait during business hours
  </Accordion>

  <Accordion title="Configuration">
    * **Duration**: How long to wait
    * **Unit**: Seconds, minutes, hours, days
    * **Conditional**: Only delay if certain conditions are met
  </Accordion>
</AccordionGroup>

### Schedule Node

Execute workflow at specific times or intervals.

<AccordionGroup>
  <Accordion title="Schedule Types">
    * **One-time**: Execute at a specific date/time
    * **Recurring**: Execute on a regular schedule
    * **Business Hours**: Only during business hours
  </Accordion>

  <Accordion title="Configuration">
    * **Cron Expression**: Advanced scheduling syntax
    * **Time Zone**: Specify timezone for scheduling
    * **Conditions**: Additional conditions for execution
  </Accordion>
</AccordionGroup>

## Utility Nodes

### Log Node

Record information for debugging and monitoring.

<AccordionGroup>
  <Accordion title="Log Levels">
    * **Info**: General information
    * **Warning**: Potential issues
    * **Error**: Error conditions
    * **Debug**: Detailed debugging information
  </Accordion>

  <Accordion title="Configuration">
    * **Message**: What to log
    * **Variables**: Include variable values
    * **Timestamp**: Add timestamp to logs
  </Accordion>
</AccordionGroup>

### Notification Node

Send notifications to team members or external systems.

<AccordionGroup>
  <Accordion title="Notification Types">
    * **Email**: Send email notifications
    * **Slack**: Send Slack messages
    * **SMS**: Send text messages
    * **Webhook**: Call external webhooks
  </Accordion>

  <Accordion title="Configuration">
    * **Recipients**: Who to notify
    * **Message**: Notification content
    * **Priority**: High, medium, low priority
  </Accordion>
</AccordionGroup>

## Best Practices for Using Nodes

<AccordionGroup>
  <Accordion title="Node Organization">
    * Group related nodes together
    * Use clear, descriptive names
    * Add comments for complex logic
    * Keep workflows readable and maintainable
  </Accordion>

  <Accordion title="Error Handling">
    * Always include error handling paths
    * Use fallback nodes for critical operations
    * Log errors for debugging
    * Provide meaningful error messages to customers
  </Accordion>

  <Accordion title="Performance">
    * Minimize unnecessary delays
    * Use efficient data structures
    * Cache frequently accessed data
    * Monitor node execution times
  </Accordion>
</AccordionGroup>
