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

# Deploy the Heartbeat Virtual Agent

> Deploy the Heartbeat Virtual Agent on Amazon ECS Fargate so it can log in to Amazon Connect and answer synthetic Heartbeat calls.

Deploy the Heartbeat Virtual Agent — a containerized Amazon ECS Fargate
service — into your AWS account so it logs in to Amazon Connect under a
dedicated user and answers synthetic Heartbeat calls.

## Before you start

* [Cloud Orchestrator installed](/docs/orchestrator-installation) in
  the same AWS region as your Amazon Connect instance.
* [Heartbeat set up](/docs/heartbeat-setup) — routing profile, contact
  flow, and dedicated phone number all in place.
* An [Operata account](/docs/get-started-overview) with Admin role and
  your Operata Group ID.
* An Operata-supplied Virtual Agent CloudFormation template URL.
  Contact [Operata Support](mailto:support@operata.com) for the link.
* Amazon Connect administrator access — you create a dedicated user
  for the Virtual Agent in step 2.
* If your Amazon Connect instance uses Single Sign-On (SSO), confirm
  the IDP provider with Operata (Azure is common) and have a Virtual
  Agent login provisioned in that IDP. Including `operata-virtual-agent`
  in the username helps identify the user later.

<Warning>
  **The Virtual Agent does not support agent login with MFA.**

  Create the agent without MFA. Any configuration that later enforces
  MFA — for example, Azure Security Defaults — must exclude this user.
  Heartbeat calls fail as soon as MFA is enforced on the Virtual Agent
  login.
</Warning>

## Steps

### 1. Confirm SSO details with Operata (SSO only)

If your agents sign in via SSO, send Operata your IDP provider name
and the Virtual Agent username you provisioned. Skip this step for
non-SSO instances.

You can run more than one Virtual Agent — each one needs its own
unique login.

### 2. Create the Virtual Agent user in Amazon Connect

Sign in to the Amazon Connect console and open **User Management**,
then **Add new users → Create and set up a new user**.

Configure the user:

* **Non-SSO:** set the login name `operata-virtual-agent` and a
  password — you paste this password into the CloudFormation parameters
  in step 4.
* **SSO:** create an agent login that meets your IDP's requirements.

<Warning>
  **Do not assign the `Operata_Heartbeat_RP` routing profile to this
  user.**

  The Virtual Agent receives calls outside the routing profile system.
  Assigning `Operata_Heartbeat_RP` to the Virtual Agent prevents the
  agent from logging in and breaks Heartbeat.
</Warning>

Save the user. Verify the user details on the confirmation screen,
then **Create users**.

### 3. Open the Virtual Agent CloudFormation template

In the AWS console, open **CloudFormation** in the same region as your
Amazon Connect instance, then choose **Create stack → With new
resources (standard)**.

Select **Amazon S3 URL**, paste the template URL Operata supplied, and
click **Next**.

### 4. Enter the stack parameters

Provide:

| Parameter        | Value                                                                                           |
| ---------------- | ----------------------------------------------------------------------------------------------- |
| `APIKey`         | The Operata API token created when you deployed Cloud Orchestrator.                             |
| `AgentPassword`  | The password you set in step 2 (non-SSO), or the IDP password for the Virtual Agent user (SSO). |
| `AgentUsername`  | The username you created in step 2.                                                             |
| `CCPUrl`         | The Amazon Connect CCP URL for your instance. Do not use a custom CCP URL.                      |
| `LoginUrl`       | SSO only — the URL the agent client redirects to for SSO sign-in.                               |
| `OperataAPIUrl`  | Leave at the default `https://api.operata.io`.                                                  |
| `OperataGroupID` | Provided by Operata.                                                                            |
| `SubnetIDs`      | VPC subnets allowed for ECS task deployment.                                                    |
| `VPCID`          | The VPC ID to deploy the ECS cluster into.                                                      |

Click **Next**.

### 5. Review and create the stack

Click through **Next** on the stack-options screen. On the **Review
and create** screen, acknowledge IAM resource creation and click
**Create stack**. The stack reaches `CREATE_COMPLETE` in around 10
minutes.

### 6. (SSO only) Confirm the SSO provider on the Operata side

The SSO provider on your Operata account must match the IDP the
Virtual Agent signs in to. Operata configures this — contact
[Operata Support](mailto:support@operata.com) if you set up SSO for
the first time. You can confirm the current setting at **Settings →
Config → SSO** in the Operata console.

### 7. (Optional) Tag the new resources

Apply your cost-allocation and ownership tags. See [Tag your AWS
resources](/docs/aws-tagging) for the tag set Operata expects.

## Verify

In the Amazon Connect console, open **Real-time metrics → Agents**.
The Virtual Agent user appears as logged in within five minutes of the
ECS task starting.

Run a Heartbeat test from the Operata console — the test call dials
the Heartbeat phone number, the Virtual Agent answers, and the run
result appears on the [Operata console](https://app.operata.io) and
on your EventBridge bus.

If the Virtual Agent does not appear logged in, see
[Virtual Agent troubleshooting](/docs/virtual-agent-troubleshooting).

## Related

* [Virtual Agent troubleshooting](/docs/virtual-agent-troubleshooting) —
  diagnose stuck tasks, failed logins, and ECS task crashes.
* [Concept: Cloud Orchestrator](/docs/concepts-cloud-orchestrator) —
  the runtime the Virtual Agent answers calls inside of.
* [EventBridge](/docs/concepts-eventbridge) — receive each Heartbeat
  run's result on your event bus.
* [Request SSO](/docs/guides-request-sso) — the broader SSO setup if
  you configure SSO across Operata.
