Source: https://manu-tests-all-orgs.docs-staging.pageloop.ai/product/enterprise-workflows/actions-and-integrations/ai-actions-classifying-content

# AI actions: Classifying content

The **Classify Content with AI action** in workflows empowers you to automatically categorize incoming messages, including replies or private comments on existing conversations. This enables real-time processing and classification of common scenarios like escalations, cancellations, or sentiment detection, enhancing automation and decision-making within workflows.

For example, if a user sends a message like "_Don't proceed with the software access request, I've changed my mind"_, it can be categorized as **Cancellation**, triggering automated follow-ups or closures.

## Adding the classify content action

To use the Classify content with AI action in a workflow:

- Navigate to **Settings > Your workspace >** **Workflows** under **Deflection and Automation** in the left navbar.

- Select the workflow you want to configure or [create a new one](https://support.atomicwork.com/en/articles/12284182).

- Click on **Add Action** and select the **Classify content with AI** action.

- You can set up the classification criteria for the action and test sample inputs.

## Setting up the classification

In the **Set up classification** section:

![Classify content with AI action showing the Include conversation history option](assets/12-ai-actions-classifying-content-01.png)

- Enter the text to be classified. You can also select placeholders like Last reply, Last private comment, Last approver comment, etc.

- Choose whether to include conversation history in the classification context. When enabled, the action uses prior conversation context along with the selected text. When disabled, classification is based only on the selected input.

- To add a category, enter the following details:

  - **Category name** – Provide a name for the category like Escalation, Cancellation, Frustration, etc.

  - **Description** – Describe the category and add common phrases users might type. For example, the category **Escalation** could have a description saying _"The message describes widespread impact and calls for urgent resolution"_ with example phrases like _urgent resolution required_, or _critical failure_.

- Add as many categories as required. If no category matches, the content will be classified as **None of these**.

- Click **Continue** to proceed to testing.

## Testing the classification

In the **Test sample inputs** section:

- Enter sample messages that you expect your users to send. Click on **Add input** to add multiple messages.
  For example, you could test with messages like _"Urgent help needed", "Please cancel my request", "Thanks for the help" and "Can someone please help me?"_

- Click on **Test.**

The system will display the classification result for each message in real-time. For instance:

- _Urgent help needed_ → Classified under **Escalation** for immediate attention

- _Please cancel my request_ → Categorized as **Cancellation**, triggering automated responses to confirm or halt the process.

- _Thanks for the help_ → Detected as **Gratitude**, triggering an automatic closure with no further follow-ups.

- _Can someone please help me?_ → Classified as **None of these,** allowing it to be prioritized accordingly.

- Based on the results of the test, you can modify the descriptions and example phrases of the various categories in the classification.

## Using the AI classification outputs in subsequent actions

The output from the Classify Content action can be subsequently used in any following action, most effectively within **Conditional actions**. This enables you to dynamically adjust workflow behavior based on the AI's classification, driving tailored automation paths.

- In your workflow, add the next action and select **Condition** from the list of workflow actions.

- Under **Add condition,** select **Previous action outputs** and click through to the required category.

- Define the follow-up conditional path for each category, like:

  - If the category is _Escalation_, update the request status, reroute the request, trigger an immediate priority escalation, and notify key stakeholders.

  - If the category is _Cancellation_, send a confirmation to the requester and close the request.

  - If the category is _Gratitude_, update the status to Resolved and trigger the feedback survey.

This structured decision-making ensures that the right steps are triggered based on user sentiment or intent, optimizing response times and customer satisfaction.
