Skip to main content

Configure an agent activity

To use an AI agent to discuss or advise on particular cases (such as a support ticket or complaint) , you need to create an instance of that agent for a specific context. Each instance of an agent is an AI conversation case. An AI conversation case associates an AI agent with a particular case (such as a support ticket case) and at least one user.

You can use an agent activity to create new AI conversations. Agent activities are similar to casetype activities: submitting the activity creates a new AI conversation case. The AI conversation case stores the case IDs of the AI agent, the user(s), and the related case(s), together with the prompts, user inputs, and the responses generated by the AI agent (the "chat messages"). You can provide inputs to the AI agent when the activity starts, such as an initial message or files.

As with casetype activities, you perform an agent activity from the related (parent) case. For example, if you wanted to use an AI agent to review support tickets and advise on troubleshooting steps, you would add the agent activity to the Support ticket casetype. You could add logic to trigger the agent activity automatically each time a new support ticket is created and add mappings to provide inputs for the AI agent, such as the description of the issue and any uploaded files. The user(s) can then view the recommendations generated by the agent and provide further information or ask questions as required.

Tip:

If you want to create a general chatbot (rather than a conversation related to a particular case, such as a support ticket or a customer order), you only need to add an AI conversation widget to the view of a page. A new AI conversation case is automatically created for each user that interacts with the chatbot. For more information, see Add an AI chatbot.

Create the agent activity

Before you can create an agent activity, you must select an LLM and configure an AI agent.

To create an AI agent activity:

  1. From your Studio, select the parent casetype for the activity (in the example above, this would be the Support ticket casetype) and open the Activities tab.
  2. Click Create activity and enter a name to identify the activity.
  3. From the Type picklist, select Agent. Note that if have not created an AI agent, this option is not available.
  4. From the Agent picklist, select the AI agent you want to use to perform the activity.
  5. Configure other options as required and then click Submit.

The agent activity is listed on the Activities tab. Typically an agent activity is triggered by another activity. For example, if you're using an AI agent to advise on a support ticket, you might want to initiate a conversation with an AI agent each time a new support ticket is raised. To do this, you would add an Execute and submit trigger for the agent activity to the When done stage of the Start support case activity.

Alternatively, you can grant users rights to perform an agent activity manually. However, note that it is not possible to edit the Start form for an AI conversation, so all the Task in fields listed below are displayed and editable. To hide the start form while allowing users to start an AI conversation case manually, add a dummy process block activity that triggers the agent activity, and then add mappings to the agent activity (or the trigger) as required.

Task in fields

When you create a new AI conversation case, you can provide an initial input to the AI agent and configure a number of details. If you are triggering the agent activity automatically, you can use mappings to define the values for these Task in fields. For example, when starting an AI conversation about a new support ticket, you might include the support ticket's description in the initial message to the agent, and share any files that the customer has uploaded. You can also specify the case(s) to which the AI agent has access (and on which it can perform activities).

You can either add the mappings to the agent activity itself (so that they are applied every time the agent activity is performed), or you can add them to the trigger for the agent activity. The latter option is useful if you want to set different values depending on how the activity is triggered. In either case, add Task in mappings to the On start stage of the agent activity:

  • Input: The text of the first message to the AI agent, which is used to initiate the conversation. Set the From attribute type to Casedata to select an attribute on the parent case, or select Inline template to combine one or more attribute values (using the case. template function) and plain text. Alternatively, select Value to just enter plain text.
  • Input files: Upload files to the conversation for the AI agent to review. You can share files stored in attributes on the parent case (using Casedata) or use an inline template to reference a static file.
  • Initial case: The initial case defines the context in which the AI agent is working. An AI agent can only perform activities (for which it has rights) on the initial case. By default, the initial case is the parent case from which the conversation is started (in the example above, the support ticket case). You can specify a different initial case (such as the customer that raised the support ticket) using an attribute on the parent case or an inline template.
  • Is shared chat: By default, only one user can be included in each AI conversation. To allow multiple users to participate in the same conversation, set the value of this boolean to true.
  • Global cases: Use this option to give the AI agent access to the activities on a case without first requiring the agent to switch to the context of that case. This could be the initial case or another case. For example, the workflow for a support ticket might require the agent to switch to a number of related product cases so it can perform activities on them. Making the initial support ticket case a global case would allow the AI agent to update the support ticket between each product activity without first switching back to the support ticket case.
tip

The AI agent can only perform activities from the current case (and any global cases) if it has been granted rights on those activities. For more information, see Use AI agents to perform activities.

AI conversation case ID

It is good practice to store the case ID of the AI conversation case created by the agent activity in an attribute on the parent case. You will need this information to display the AI conversation on the view of the parent case. This is also useful if you want to be able to access data from the AI conversation case for use in templates or other activities.

To store the AI conversation case ID on the parent case:

  1. Add an attribute for the AI conversation case ID to the parent casetype.
  2. Return to the agent activity, select the On submit stage, and add a mapping.
  3. From the To attribute type, select Casedata and then select the case ID attribute.
  4. From the From attribute type select New case metadata and select Case ID.

Each time a new AI conversation case is created, the case ID is added to the attribute on the parent casetype.

Display the AI conversation

To display the conversation with the AI agent and allow users to send the agent further questions and/or upload additional files, add an AI conversation widget to the view of the parent casetype (such as the support ticket casetype). The widget displays all the inputs that have been sent to the AI agent and the agent's responses. If the agent has suggested or performed activities, these are also listed in the conversation history.

When adding the AI conversation widget to the view of the parent casetypes, configure the widget properties as follows:

  • From the Agent picklist, ensure you select the same agent as that specified in the agent activity.
  • Use the Agent conversation field to identify the AI conversation case. This ensures the widget displays the conversation relating to a particular case (such as a support ticket case). Use the case. template function to select the attribute to which you mapped the AI conversation case ID, as described above.
  • Grant rights to view the widget as normal. Note that unless the Task in field Is shared chat has been set to true, only the user that performed the agent activity (for example, by performing the activity that triggered it) will be able to interact with the AI agent via the chat.

For more information about using the AI conversation widget, see the AI conversation widget reference.

Tip:

You can also view the details of each AI conversation case from Developer Tools: select Platform > AI conversation, and then select a particular case. Once you have opened an AI conversation case, use Case > Data to view additional details such as the initial case and any global cases.