# End Session

> End a conversation session with a Salesforce Agentforce agent from a Maestro agentic process, using the session ID returned by Execute Salesforce Agent.

## Description

This activity ends a conversation session with a Salesforce Agentforce agent. Use it after the process no longer needs the agent, to close the session that the [Execute Salesforce Agent](uipath-salesforce-agent-execute-salesforce-agent.md) activity opened.

## Prerequisites

- A process step that runs the **Execute Salesforce Agent** activity, so that a session ID is available.
- A connection that uses **OAuth 2.0 Client credentials** authentication. For details, refer to [Salesforce Agentforce & Flows authentication](https://docs.uipath.com/integration-service/automation-cloud/latest/user-guide/uipath-salesforce-agent-authentication).

## Adding the activity to a Maestro process

1. Add a service task element to the canvas after the task that runs **Execute Salesforce Agent**, and open the task's **Properties** panel.
2. In the **Implementation** section, from the **Action** dropdown list, select **Execute connector activity**.
3. Select the **Salesforce Agentforce & Flows** connector.
4. Select the same connection that the **Execute Salesforce Agent** task uses.
5. From **Activity**, select **End Session**.
6. In **Session ID**, select the **Session ID** output of the **Execute Salesforce Agent** task.

## Configuration

| Field | Direction | Description |
| --- | --- | --- |
| **Connection** | Input | The connection established in Integration Service. Access the dropdown menu to choose, add, or manage connections. |
| **Session ID** | Input | Required. The ID of the session to end, as returned by the **Execute Salesforce Agent** activity. |
