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

# Slack Chat Agent

> Test Slack workspace bots with realistic user scenarios

Test your Slack bot by connecting your Slack workspace to UserTrace. Our simulated users will interact with your bot directly through Slack messages.

## Getting Started

### 1. Connect Your Slack Bot

In the UserTrace dashboard, navigate to **Agent Setup** and select **Slack Integration**.

**Required Information:**

* Slack Bot Token or App credentials
* Workspace URL or ID

**Example:**

```
Bot Token: xoxb-your-bot-token
Workspace: yourcompany.slack.com
```

### 2. Set Evaluation Context

Define your pass and fail criteria for what constitutes successful interactions:

**Example Pass/Fail Criteria:**

```
Pass Criteria:
- Responds within 30 seconds
- Uses appropriate workplace tone
- Provides relevant information or solutions
- Follows company guidelines
- Handles requests efficiently

Fail Criteria:
- Response time exceeds 60 seconds
- Uses inappropriate or unprofessional tone
- Provides incorrect or unhelpful responses
- Violates company policies
- Fails to understand user intent
```

## Important Simulation Details

### Sequential Testing

<Warning>
  **One at a Time**: All simulations run sequentially (one after another) from the same test user to avoid message conflicts and ensure clean conversation threads.
</Warning>

**How it works:**

* Simulation 1 completes entirely before Simulation 2 starts
* Each simulation appears as a separate conversation thread or DM
* No message overlap or confusion between different test scenarios

### Test User Management

**Our Test User:**
All simulations will come from a designated UserTrace test user account. This user will:

* Send messages as different personas
* Complete full conversation scenarios
* Reset between simulations for clean testing

**Your Setup:**
Ensure your Slack bot can receive messages from new workspace members and respond appropriately.

## Best Practice: Use Test Workspace

<Info>
  **Recommended Approach**: Use a test Slack workspace instead of your production workspace to avoid any concerns about triggering real business actions during testing.
</Info>

If you must use your production Slack workspace, ensure you prevent the test user from triggering real business actions:

**Actions to Disable:**

* **Meeting bookings** - Don't schedule real meetings
* **Task assignments** - Don't create actual work items

## Testing Process

### Inbound Bot Testing

For bots that respond to incoming messages:

1. Our test user sends the first message to your Slack bot
2. Your bot responds based on the scenario
3. The conversation continues until completion
4. Results are analyzed and scored

### Outbound Bot Testing

For bots that initiate conversations (proactive messaging):

1. UserTrace sends a webhook request to your system
2. Your bot initiates the conversation by sending the first message
3. Our simulated user responds according to the scenario
4. The conversation continues until completion
5. Results are analyzed and scored

**Webhook Format for Outbound Bots:**

```json theme={null}
{
  "trigger": "start_simulation",
  "scenario_id": "daily_standup_reminder",
  "target_user": "@test-user",
  "metadata": {
    "persona": "busy_developer",
    "context": "sprint_deadline_pressure"
  }
}
```

### 2. Between Simulations

* 30-second delay between different scenarios
* New conversation thread starts fresh
* Previous context is cleared

### 3. View Results

Each simulation provides:

* Complete conversation transcript
* Response time analytics
* Success/failure against your criteria
* Persona-specific behavior analysis

## Best Practices

<CardGroup cols={2}>
  <Card title="Response Timing" icon="clock">
    **Natural Conversation Flow**

    • Respond within 30 seconds for best results
    • Handle message bursts gracefully
    • Use threading for complex discussions
  </Card>

  <Card title="Slack Features" icon="slack">
    **Platform Integration**

    • Use interactive buttons and menus
    • Support file sharing and attachments
    • Handle mentions and reactions appropriately
  </Card>
</CardGroup>

## Common Scenarios

**Workplace Productivity Examples:**

* "Schedule a meeting for tomorrow at 2 PM"
* "What's the status of the Q4 project?"
* "I need help with the expense report process"
* "Can you remind me about my upcoming deadlines?"

**HR and Support Examples:**

* "How do I request time off?"
* "Where can I find the employee handbook?"
* "I'm having trouble with my laptop"
* "Who should I contact about benefits?"

## Troubleshooting

**Common Issues:**

* **Messages not delivering**: Check Slack app permissions and OAuth scopes
* **Slow responses**: Optimize your webhook response time
* **Test actions triggering**: Verify you're using test workspace or proper safeguards
* **Thread mixing**: Ensure proper conversation threading

<Note>
  **Need help with Slack setup?** Our team can assist with bot configuration and testing best practices. Contact [support@getusertrace.com](mailto:support@getusertrace.com).

  **Next Steps**: [Create test scenarios](/scenarios-generation) for your Slack bot and [run simulations](/running-simulations) to validate performance.
</Note>
