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

# Google CES

> Run chat simulations against Google Customer Engagement Suite apps

<Badge color="purple">Chat simulations</Badge> <Badge color="gray" stroke>Live monitoring</Badge> <Badge color="gray" stroke>Voice simulations</Badge>

## Overview

The Google CES integration connects a [Google Customer Engagement Suite](https://docs.cloud.google.com/customer-engagement-ai/) app to Roark for [chat simulations](/documentation/simulation-testing/chat-simulations). Roark sends each persona turn to the CES [`runSession` endpoint](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/reference/rest/v1/projects.locations.apps.sessions/runSession) and records the agent's reply as part of the chat transcript.

Authentication uses [Workload Identity Federation (WIF)](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds) so **no long-lived service account keys ever leave your GCP tenant**. Roark mints a short-lived access token at simulation time using credentials your team controls and can revoke at any time.

***

## Prerequisites

Before getting started, you'll need:

* A Google Cloud project with a published Customer Engagement Suite app
* Permissions in that project to create a Workload Identity Pool and configure a service account with access to your CES app
* The CES app coordinates: **Location**, **App ID**, **Version ID**, **Deployment ID**

***

## Setting Up Workload Identity Federation

WIF setup requires a few values from Roark to authorize in your Workload Identity Pool. **Reach out to us and we'll walk you through it end-to-end** — typically a single back-and-forth to share the values you need, after which you generate the WIF credential JSON on your side and paste it into Roark.

<Card title="Get help setting up WIF" icon="mail" href="mailto:support@roark.ai?subject=Google%20CES%20integration%20setup&body=Hi%20Roark%20team%2C%0A%0AWe%27d%20like%20to%20set%20up%20a%20Google%20CES%20integration%20and%20would%20like%20your%20help%20configuring%20Workload%20Identity%20Federation.%0A%0AOur%20GCP%20project%20ID%3A%20%0ACES%20app%20ID%3A%20%0ACES%20location%3A%20%0A%0AThanks%21">
  Email **[support@roark.ai](mailto:support@roark.ai)** and we'll get you set up. Include your GCP project ID and CES app coordinates if you have them handy.
</Card>

Once WIF is configured on your side, you'll have a credential configuration JSON document (`type: "external_account"`) ready to paste into Roark.

***

## Creating the Integration in Roark

<Steps>
  <Step title="Open the integration form">
    Navigate to **Settings → Integrations**, click **Add Integration**, and select **Google CES**.
  </Step>

  <Step title="Fill in the configuration">
    | Field                 | Description                                                                                           |
    | :-------------------- | :---------------------------------------------------------------------------------------------------- |
    | **Integration Name**  | Friendly name for this integration                                                                    |
    | **WIF Config JSON**   | The full external-account credential JSON from your Workload Identity Pool. Stored encrypted at rest. |
    | **CES Location**      | GCP region for your CES app (e.g. `us`, `global`)                                                     |
    | **CES App ID**        | UUID of the CES app, from the CES console                                                             |
    | **CES Version ID**    | UUID of the app version to run                                                                        |
    | **CES Deployment ID** | UUID of the deployment to target                                                                      |
  </Step>

  <Step title="Save">
    On save, Roark validates the WIF document's shape, stores it encrypted, and auto-provisions:

    * One **Roark agent** named after the integration
    * One **`GOOGLE_CES` chat endpoint** linked to the integration

    The endpoint is immediately usable in run plans.
  </Step>
</Steps>

***

## How Authentication Works at Runtime

When a chat simulation runs against a Google CES endpoint, Roark mints a fresh access token for the request rather than storing one:

1. Roark uses your WIF configuration to obtain a federated token from Google STS.
2. The federated token is exchanged for a short-lived OAuth access token that impersonates your configured service account.
3. Roark sends `Authorization: Bearer <token>` on each call to `…/sessions/{sessionId}:runSession`.

Tokens are short-lived (≈1 hour) and live only in memory for the duration of the simulation. You can revoke access at any time by removing Roark from your Workload Identity Pool.

***

## How Conversations Are Driven

Each simulation generates a unique session ID per run. For every persona turn, Roark POSTs to:

```
POST https://<location>-ces.googleapis.com/v1beta/projects/<project>/locations/<location>/apps/<appId>/sessions/<sessionId>:runSession
```

with a body referencing your `app_version` and `deployment` plus the user input text. The agent's reply is read from `outputs[0].text` and added to the chat transcript.

CES creates the session on the first call with a new session ID and resumes it on subsequent calls with the same ID, so no separate bootstrap call is needed.

***

## What's Not Supported

* **Voice simulations** — Google CES integrations are chat-only.
* **Live monitoring / call import** — Roark does not pull historical or live conversations from CES. Use chat simulations to evaluate the agent.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Run Chat Simulations" icon="play" href="/documentation/simulation-testing/chat-simulations">
    Test your CES app with persona-driven chats
  </Card>

  <Card title="Build Scenarios" icon="book-open" href="/documentation/simulation-testing/scenarios">
    Define the conversations to test
  </Card>

  <Card title="Metric Policies" icon="shield" href="/documentation/metrics/metric-policies">
    Automate evaluation on every chat
  </Card>

  <Card title="Integration Overview" icon="plug" href="/documentation/integrations/overview">
    Explore other integrations
  </Card>
</CardGroup>
