> ## 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 Triggers

> Configure triggers to automatically start your workflows

## What are Triggers?

Triggers are events that automatically start your workflows. They can be based on customer actions, time schedules, external events, or API calls. When a trigger fires, it initiates the workflow and can pass relevant data to the first node.

## Message-Based Triggers

### Incoming Message Trigger

Start a workflow when a customer sends a message through any connected channel.

<AccordionGroup>
  <Accordion title="Configuration Options">
    * **Channel**: Select which communication channel to monitor
    * **Keywords**: Specific words or phrases that activate the trigger
    * **Sender Type**: New customers, existing customers, or both
    * **Message Type**: Text, media, or any message type
  </Accordion>

  <Accordion title="Advanced Filters">
    * **Time Range**: Only during specific hours or days
    * **Customer Segments**: Target specific customer groups
    * **Message Length**: Minimum or maximum message length
    * **Language**: Specific language detection
  </Accordion>
</AccordionGroup>

### Keyword Trigger

Activate workflows based on specific keywords in customer messages.

<AccordionGroup>
  <Accordion title="Keyword Matching">
    * **Exact Match**: Message must contain exact keyword
    * **Partial Match**: Message contains keyword anywhere
    * **Case Sensitive**: Distinguish between uppercase and lowercase
    * **Multiple Keywords**: Any of several keywords can trigger
  </Accordion>

  <Accordion title="Common Use Cases">
    * "help" → Customer support workflow
    * "order" → Order status workflow
    * "return" → Returns and refunds workflow
    * "cancel" → Cancellation workflow
  </Accordion>
</AccordionGroup>

### Intent Trigger

Start workflows based on detected customer intent using AI analysis.

<AccordionGroup>
  <Accordion title="Intent Detection">
    * **Predefined Intents**: Use built-in intent categories
    * **Custom Intents**: Define your own intent categories
    * **Confidence Threshold**: Minimum confidence level required
    * **Fallback Intent**: Default intent when detection fails
  </Accordion>

  <Accordion title="Intent Categories">
    * **Information Request**: Asking for product details
    * **Problem Report**: Reporting issues or bugs
    * **Purchase Intent**: Showing buying interest
    * **Support Request**: Need help with existing product
  </Accordion>
</AccordionGroup>

## Time-Based Triggers

### Schedule Trigger

Execute workflows at specific times or on recurring schedules.

<AccordionGroup>
  <Accordion title="Schedule Types">
    * **One-time**: Execute at a specific date and time
    * **Daily**: Repeat every day at the same time
    * **Weekly**: Repeat on specific days of the week
    * **Monthly**: Repeat on specific dates each month
  </Accordion>

  <Accordion title="Configuration">
    * **Cron Expression**: Advanced scheduling syntax
    * **Time Zone**: Specify timezone for scheduling
    * **Business Hours**: Only during business hours
    * **Holiday Calendar**: Skip on holidays
  </Accordion>
</AccordionGroup>

### Delay Trigger

Start workflows after a specified delay period.

<AccordionGroup>
  <Accordion title="Delay Types">
    * **Fixed Delay**: Wait for a specific duration
    * **Random Delay**: Wait for a random time within a range
    * **Conditional Delay**: Only delay if certain conditions are met
  </Accordion>

  <Accordion title="Use Cases">
    * Follow-up messages after initial contact
    * Reminder notifications
    * Escalation after no response
  </Accordion>
</AccordionGroup>

### Business Hours Trigger

Execute workflows only during business hours.

<AccordionGroup>
  <Accordion title="Configuration">
    * **Business Hours**: Define your business hours
    * **Time Zone**: Specify your timezone
    * **Holidays**: Define holiday calendar
    * **Weekend Handling**: How to handle weekends
  </Accordion>

  <Accordion title="Use Cases">
    * Customer support during business hours
    * Sales follow-up during work days
    * Appointment reminders
  </Accordion>
</AccordionGroup>

## External Event Triggers

### Webhook Trigger

Start workflows when external systems send data via webhooks.

<AccordionGroup>
  <Accordion title="Webhook Configuration">
    * **Webhook URL**: Unique URL for this trigger
    * **Authentication**: API key or token validation
    * **Payload Validation**: Verify incoming data format
    * **Rate Limiting**: Prevent abuse and overload
  </Accordion>

  <Accordion title="Common Sources">
    * **CRM Systems**: Customer data updates
    * **E-commerce Platforms**: Order status changes
    * **Payment Processors**: Transaction confirmations
    * **Third-party APIs**: External service notifications
  </Accordion>
</AccordionGroup>

### API Call Trigger

Activate workflows through direct API calls.

<AccordionGroup>
  <Accordion title="API Configuration">
    * **Endpoint**: API endpoint for triggering
    * **Method**: HTTP method (GET, POST, PUT)
    * **Authentication**: API key or OAuth
    * **Rate Limiting**: Request frequency limits
  </Accordion>

  <Accordion title="Use Cases">
    * **System Integration**: Connect with existing systems
    * **Batch Processing**: Trigger multiple workflows
    * **Custom Applications**: Build custom trigger logic
  </Accordion>
</AccordionGroup>

### Database Trigger

Start workflows when database records are created, updated, or deleted.

<AccordionGroup>
  <Accordion title="Database Events">
    * **INSERT**: New record created
    * **UPDATE**: Existing record modified
    * **DELETE**: Record removed
    * **Custom Query**: Based on specific SQL conditions
  </Accordion>

  <Accordion title="Configuration">
    * **Database Connection**: Connect to your database
    * **Table/Collection**: Which table to monitor
    * **Filter Conditions**: Specific record criteria
    * **Polling Frequency**: How often to check for changes
  </Accordion>
</AccordionGroup>

## Customer Behavior Triggers

### Customer Journey Trigger

Activate workflows based on customer journey stages.

<AccordionGroup>
  <Accordion title="Journey Stages">
    * **New Customer**: First-time interactions
    * **Active Customer**: Regular engagement
    * **At-Risk Customer**: Declining engagement
    * **Churned Customer**: No recent activity
  </Accordion>

  <Accordion title="Configuration">
    * **Stage Definition**: How to identify each stage
    * **Time Windows**: How long to stay in each stage
    * **Transition Rules**: When to move between stages
    * **Custom Stages**: Define your own journey stages
  </Accordion>
</AccordionGroup>

### Engagement Trigger

Start workflows based on customer engagement levels.

<AccordionGroup>
  <Accordion title="Engagement Metrics">
    * **Message Frequency**: How often customer messages
    * **Response Rate**: How often customer responds
    * **Session Duration**: Length of conversation sessions
    * **Page Views**: Website or app activity
  </Accordion>

  <Accordion title="Use Cases">
    * **Re-engagement**: Reach out to inactive customers
    * **Retention**: Prevent customer churn
    * **Upselling**: Target engaged customers
  </Accordion>
</AccordionGroup>

### Purchase Trigger

Activate workflows based on customer purchase behavior.

<AccordionGroup>
  <Accordion title="Purchase Events">
    * **First Purchase**: Customer's first transaction
    * **Repeat Purchase**: Subsequent transactions
    * **High Value Purchase**: Above certain amount
    * **Abandoned Cart**: Items left in cart
  </Accordion>

  <Accordion title="Configuration">
    * **Purchase Amount**: Minimum/maximum thresholds
    * **Time Windows**: How recent the purchase
    * **Product Categories**: Specific product types
    * **Payment Methods**: How customer paid
  </Accordion>
</AccordionGroup>

## Trigger Configuration Best Practices

<AccordionGroup>
  <Accordion title="Performance Optimization">
    * Use specific triggers to avoid unnecessary executions
    * Implement proper filtering to reduce false positives
    * Monitor trigger performance and optimize as needed
    * Use rate limiting to prevent system overload
  </Accordion>

  <Accordion title="Error Handling">
    * Always include error handling for trigger failures
    * Implement retry logic for transient failures
    * Log trigger events for debugging
    * Provide fallback mechanisms when triggers fail
  </Accordion>

  <Accordion title="Security">
    * Validate all incoming trigger data
    * Use proper authentication for external triggers
    * Implement rate limiting to prevent abuse
    * Monitor for suspicious trigger activity
  </Accordion>
</AccordionGroup>

## Testing Triggers

### Test Mode

Use the built-in test mode to verify trigger behavior:

1. **Manual Testing**: Manually fire triggers with test data
2. **Simulation Mode**: Simulate trigger conditions
3. **Load Testing**: Test trigger performance under load
4. **Integration Testing**: Test with real external systems

### Debugging Tips

* Check trigger logs for execution details
* Verify trigger conditions are met
* Test with different data scenarios
* Monitor trigger performance metrics

## Next Steps

Now that you understand triggers, explore these related topics:

<CardGroup cols={2}>
  <Card title="Creating Workflows" icon="diagram-project" href="/workflow-builder/creating-workflows">
    Learn how to build workflows that respond to triggers
  </Card>

  <Card title="Node Reference" icon="puzzle-piece" href="/workflow-builder/nodes">
    Understand the nodes available in your workflows
  </Card>

  <Card title="Analytics" icon="chart-line" href="/analytics/overview">
    Monitor trigger performance and workflow execution
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Learn about programmatic trigger management
  </Card>
</CardGroup>
