For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Amazon Connect Integration for TestMu AI Agent Testing

The Amazon Connect integration connects an agentic self-service AI agent built on Amazon Connect (Amazon Q in Connect) to a Phone Caller agent in the TestMu AI Agent Testing Platform. When you save the connection, TestMu AI imports the agent's prompt and tools. After each test call ends, it reads the tool calls the agent made and checks them against the scenario.

On an IVR agent, the same Amazon Connect card imports a published contact flow as the agent's IVR System Map. No Amazon Q in Connect agent is needed, and after each test call TestMu AI reads back what Connect recorded for that contact. See Amazon Connect for IVR Agents.

Without the integration, TestMu AI still tests any Amazon Connect phone number, with transcripts, recordings, grading, and call quality metrics. Connect it on a Phone Caller agent when you also want the prompt imported and the tool calls checked, or on an IVR agent when you want the contact flow imported and the Connect contact read back.

Integration at a Glance​


ItemDetails
Agent typePhone Caller, inbound. TestMu AI calls the Amazon Connect number that routes to your AI agent. For IVR agents, see Amazon Connect for IVR Agents.
Supported AI agentsAgentic self-service AI agents (the ORCHESTRATION type) in Amazon Q in Connect.
Where you connectThe agent's Integrations tab, on the Amazon Connect card.
What you needThe AWS region, the Connect instance ID, the AI agent ID (optional on an IVR agent), and read-only AWS access keys.
What is importedThe AI agent's prompt and tools, when you save.
What is checkedWhether the agent called each tool a scenario expects, with the arguments and result of every call.
When tool calls appearUp to a minute after the call ends.

Prerequisites​


These prerequisites are for a Phone Caller agent. An IVR agent needs no Amazon Q in Connect agent: see IVR Prerequisites.

In AWS​

  • An Amazon Connect instance with an agentic self-service AI agent in Amazon Q in Connect, and a phone number whose contact flow routes callers to it. The AI agent must be the ORCHESTRATION type. Other AI agent types aren't supported.
  • An access key ID and secret access key for an IAM user or role with read-only access: the describe, list, and search permissions for Amazon Connect, Amazon Q in Connect, and Contact Lens. Use a dedicated identity for testing.

In TestMu AI​

  • A Phone Caller agent with the call type Inbound (Bot receives calls), with the Amazon Connect phone number added on its Phone Numbers tab. See Test an Inbound Phone Agent.
warning

AWS access keys are secrets. Enter them only in the integration form, never in a scenario, prompt, test data file, or source code.

Connect Amazon Connect​


  1. Open the Phone Caller agent and select Integrations.
  2. Select Connect on the Amazon Connect card.
Amazon Connect Integration Settings panel open over the Integrations tab, with the AWS Region, Connect Instance ID, AI Agent ID, and Access Key ID fields
  1. Fill in the fields, then select Save. TestMu AI imports the AI agent's prompt and tools.
FieldWhere to find it
AWS RegionThe region your Connect instance runs in, such as us-west-2. A region that doesn't match the instance is the most common reason the instance isn't found.
Connect Instance IDCopy the instance ARN from the instance's overview page in the AWS console, and keep only the UUID after instance/.
AI Agent IDIn the Connect console, under Amazon Q → AI agents. Pick the agentic self-service agent that answers your test number. On an IVR agent this field is optional. Leave it blank for a classic IVR.
Access Key ID and Secret Access KeyThe keys of the read-only IAM user or role from Prerequisites.
Session Token (optional)Only for temporary credentials from AWS STS, such as an assumed role. Leave it blank for long-lived IAM user keys. Temporary credentials expire, so a dedicated IAM user with long-lived keys needs less upkeep.

TestMu AI stores the credentials as HyperExecute secrets, scoped to this agent. One provider can be connected per agent, so use a separate TestMu AI agent to test another AI agent or provider.

Check the Prompt and Tools​


Open the Prompt tab to check the imported prompt, then generate your scenarios from it. The imported tools appear in the scenario editor.

After you change the AI agent in Amazon Connect, select Re-sync on the Amazon Connect card so the prompt and tools match what is deployed.

Select the Expected Tools for Each Scenario​


Open a scenario and, in the scenario editor, select each tool from the imported catalog that the scenario expects the agent to call.

Example scenarioExpected tools
Order statuslookup_order
Address changeverify_customer, update_address
  • Select only the tools the scenario must check. The tool check passes only if the agent called all of them.
  • Scenarios with no tools selected still run, without a tool check.
  • If the agent's tools change, select Re-sync and review the tools selected on each scenario.

Run a Test and Read the Tool Calls​


Start with one short scenario and one expected tool in a small suite, to confirm that the call reaches the right AI agent and the tool check works. Then run your suites as for any inbound phone agent.

The transcript, recording, and grading are ready as soon as a call ends. The tool calls take up to a minute longer, because Amazon Connect makes a call searchable only once it ends, and TestMu AI reads the tool calls after that.

Open a call and select the Tool Calls tab.

SectionWhat it shows
Expected Tool ValidationEach tool selected on the scenario, marked Called or Not Called.
Selected AUT Tool CallsEach call the agent made to a selected tool, with its status, arguments, and result.
AUT Tool CallsEvery tool the agent called, including tools you didn't select, so unexpected calls are visible.
  • Read the transcript and the tool calls together. If the agent says it updated or transferred something while the tool shows Not Called, it claimed an action it didn't take.
  • A tool that ran but returned an error still shows Called, so check the result of each call.
  • Not Called can be the right outcome, for example when the caller never gave the agent the details it needed.

Amazon Connect for IVR Agents​


An IVR under test is a contact flow: a keypad menu tree that Amazon Connect runs on its own, with no Amazon Q in Connect agent behind it. So there is no AI agent prompt to import and no tool calls to read back. The flow definition holds every prompt, keypad digit, and route instead, and the integration turns it into the IVR agent's IVR System Map. After each test call, TestMu AI reads back what Connect recorded for that contact, which gives you evidence from the IVR's own side that a transcript can't.

If you only want to dial the number and grade transcripts, recordings, and call quality, you don't need the integration. Connect it when you want the system map read from the deployed flow, or evidence of what the IVR did.

How the IVR Integration Works​

ItemDetails
Agent typeIVR.
Supported IVRsAny published Amazon Connect contact flow of type CONTACT_FLOW. No Amazon Q in Connect agent is required.
Where you connectThe agent's Integrations tab, on the Amazon Connect card.
What you needThe AWS region, the Connect instance ID, and an access key pair for a read-only IAM identity.
What is importedThe contact flow as the IVR System Map, plus a written specification of the flow as the agent's prompt.
What is checkedThe scripted keypad walk, and the contact Amazon Connect recorded for the call.
When results appearThe graded walk comes with the call result. The Connect read-back follows within a few minutes, because Connect indexes a contact some time after the call ends.

IVR Prerequisites​

In AWS:

  • An Amazon Connect instance with a published contact flow of type CONTACT_FLOW, and a phone number routed to it.
  • An access key ID and secret access key for a read-only IAM identity. Use a dedicated identity for testing, so you can rotate its keys without touching anything else.

The integration never writes to your Connect instance. These are the only permissions it uses:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ConnectRead",
"Effect": "Allow",
"Action": [
"connect:ListPhoneNumbersV2",
"connect:ListContactFlows",
"connect:DescribeContactFlow",
"connect:DescribeContactFlowModule",
"connect:SearchContacts",
"connect:DescribeContact",
"connect:ListIntegrationAssociations"
],
"Resource": [
"arn:aws:connect:REGION:ACCOUNT_ID:instance/INSTANCE_ID",
"arn:aws:connect:REGION:ACCOUNT_ID:instance/INSTANCE_ID/*",
"arn:aws:connect:REGION:ACCOUNT_ID:phone-number/*"
]
}
]
}
  • Replace REGION, ACCOUNT_ID, and INSTANCE_ID with your own values.
  • connect:DescribeContactFlowModule is needed only if your flow hands off to flow modules.
  • connect:SearchContacts and connect:DescribeContact read back the contact after each call. Without them the import still works, but the Connect panel on the call result stays empty.

In TestMu AI:

  • An agent of type IVR. The import and the Connect panel appear only for this agent type. See IVR Agent Testing.
  • The Connect phone number added on the agent's Phone Numbers tab, so test calls have a number to dial.
warning

AWS access keys are secrets. Enter them only in the Amazon Connect integration form, where they are stored as HyperExecute secrets scoped to this agent. Never put them in a scenario, prompt, test data file, or source code.

Connect Amazon Connect to an IVR Agent​

  1. Open the IVR agent and select Integrations.
  2. Select Connect on the Amazon Connect card.
  3. Fill in the fields, then select Save. TestMu AI checks the credentials by listing the instance's phone numbers before it stores them.
FieldWhere to find it
AWS RegionThe region your Connect instance runs in, such as us-west-2.
Connect Instance IDIn the Connect console under Account overview, or the UUID after instance/ in the instance ARN.
AI Agent ID (optional)Leave it blank for a classic IVR. A contact flow has no Amazon Q in Connect agent, so there is no ID to enter. Fill it in only if your flow hands off to an agentic self-service (ORCHESTRATION) agent and you also want that agent's tool calls observed.
Access Key ID and Secret Access KeyThe keys of the read-only IAM identity from IVR Prerequisites. The secret access key is shown only once, when the access key is created.
Session Token (optional)Only for temporary credentials from AWS STS.

One Amazon Connect connection is stored per agent, so saving again replaces it. Once linked, the card shows Connected. Select Re-sync to re-read the instance after you change anything in AWS.

Import the Contact Flow as the IVR System Map​

Without the integration, the platform builds the map by reconstructing the phone tree from your prompt and uploaded files. With Amazon Connect linked, you can read the real flow instead.

  1. Open the IVR System Map tab.
  2. Select Import from Amazon Connect. It sits beside the map heading, and it also appears in the empty state when no map has been built yet.
  3. Pick the contact flow that answers your test number. Only flows of type CONTACT_FLOW are listed, with archived flows last.
  4. Leave Follow hand-offs to other flows on unless the flow stands alone, then select Import flow. This option stitches the flows this one transfers to into a single map, so a caller's whole journey is covered.

The import does two things: it stores the map, and it writes a specification of the flow into the agent's prompt, which is what scenario generation reads. The result step says what happened to the prompt.

Prompt resultWhat it means
Scenario source writtenThe agent had no prompt. The flow's specification is now the prompt, so generated scenarios describe the real menus and keypresses.
Scenario source refreshedAn earlier imported specification was replaced with the flow as it stands now.
Your prompt was left aloneThe agent already has a prompt that an import didn't write, so it was kept. Scenario generation keeps using that text, not the flow. Clear the prompt first if you want the flow to drive it.

After the import, the map heading names the source and the time of the import, and the action becomes Re-import from Amazon Connect. Re-import whenever you change the flow in Connect.

Generate Scenarios From the Imported Flow​

Generate scenarios as usual from the Scenarios tab. Because the prompt now holds the flow's specification, each scenario names a route that exists in the contact flow, such as a billing menu that returns to the main menu.

  • Set Who Speaks First to IVR speaks first on each scenario. An IVR starts talking as soon as it answers, so this keeps the simulated caller from talking over the greeting.
  • Read the Digits to enter line in each scenario. That is exactly what the simulated caller presses.

Run an IVR Test and Read What Connect Recorded​

Start with a single call before you run a whole suite, and check the call count in the Confirm Run dialog before anything is dialed. IVR Testing Tips explains why IVR calls should run one at a time.

Open the call result and select Validation Results. It shows the graded walk: each hop the scenario scripted, whether it happened, and when.

Below the walk is what Amazon Connect recorded for the same call, read back from your instance. It's the IVR counterpart to tool call checking on a Phone Caller agent, and it doesn't come from the transcript.

FieldWhat it shows
Reached a queueWhether the contact actually entered a queue. A transfer step that announces "connecting you now" isn't proof that the call connected.
Captured by the IVRThe contact attributes the flow stored. This is the only evidence of what the IVR captured, as opposed to what it read back. An IVR can speak a plausible account number whatever it stored, so a transcript can't catch a capture bug.
How it endedConnect's own disconnect reason, which tells the flow hanging up apart from the caller hanging up.
Start skew and Connect durationHow closely the Connect contact matches the test call, so you can see that the two were matched correctly.

The read-back appears within a few minutes of the call, because Connect indexes a contact some time after the call ends.

An empty Captured by the IVR list is normal. Only values a flow writes with an Update contact attributes block appear there, and most flows don't store menu selections. To make menu choices verifiable this way, add that block to your flow.

IVR Troubleshooting​

ProblemWhat to do
Import from Amazon Connect is missingThe agent isn't an IVR agent. The import appears only on IVR agents.
"Amazon Connect is not set up for this agent yet"The integration is missing or incomplete. Add the region, instance ID, and keys on the Integrations tab.
"Amazon Connect refused the request"AWS rejected the call. Check the keys, the region, and that the IAM identity can list and describe contact flows on this instance.
The flow list is empty or missing a flowOnly published flows of type CONTACT_FLOW are listed. Check that the flow is published and that the IAM identity can list it.
The map doesn't match the flow you importedScenario generation rebuilt it. Check the heading for the map's source, then re-import.
The prompt didn't change after an importThe agent already had a prompt that an import didn't write, so it was kept. Clear it and import again.
The Connect panel is missing on a call resultEither the agent has no Amazon Connect integration, or Connect hadn't indexed the contact yet. TestMu AI retries for several minutes after the call.
"No Connect contact could be matched"The call never reached Connect. If it also ended with no audio, see the first tip in IVR Testing Tips.
Calls end immediately as busyTwo calls from the same caller number to the same Connect number at once are rejected. Run IVR suites one call at a time.

IVR Testing Tips​

  • Run IVR suites one call at a time. Concurrent calls from the same caller number to the same Connect number are rejected by the carrier, and those calls never reach Connect: they show as busy, with no contact and no transcript.
  • Re-import after changing the flow. The map and the prompt are a snapshot, and the heading on the IVR System Map tab shows when it was taken.
  • Store what you want to verify. Add an Update contact attributes block wherever you want a captured value checkable from outside the transcript, such as stored digits, a chosen branch, or a retry counter.
  • Read the walk and the Connect panel together. The walk shows what the caller experienced, and the panel shows what the IVR did about it.

Troubleshooting​


ProblemWhat to do
Saving fails with an authentication errorCheck both access keys, and that the IAM user is active. With temporary credentials, enter the session token too.
The integration stops working after it worked beforeTemporary credentials have expired. Save new keys and a new session token, or switch to long-lived keys for a dedicated IAM user.
The instance or AI agent isn't foundCheck that the region is the instance's region, and that both IDs were copied in full.
The AI agent is rejected, or no tools importCheck that the AI agent is an agentic self-service (ORCHESTRATION) agent. Other AI agent types aren't supported.
The call connects, but the AI agent never answersThe contact flow doesn't route this number to the AI agent. Call the number yourself to check the routing in Amazon Connect.
No tool calls a minute after the call endedRefresh the call. If they still don't appear, check that the call reached the AI agent and that the IAM identity has the read permissions for Contact Lens and Amazon Q in Connect.
No tools appear in the scenario editorConfirm the AI agent has tools, then select Re-sync.
A call ends as dispatch-failedThe number on the Phone Numbers tab is wrong or not in international format. Fix it and run the call again.
A key may have been exposedDeactivate it in IAM, create a new one, and save it in TestMu AI.

Security and Credentials​


  • Saved credentials are stored as HyperExecute secrets, scoped to the agent where you save them.
  • Give the IAM user or role only the read-only describe, list, and search permissions for Amazon Connect, Amazon Q in Connect, and Contact Lens.
  • Use separate access keys for testing, rotate them on your usual schedule, and disconnect the integration when you no longer need it.
  • On an IVR agent with a classic IVR (no AI Agent ID), grant only the Amazon Connect read permissions listed in IVR Prerequisites. The integration never writes to your Connect instance.

Testing Tips for Amazon Connect​


  • The contact flow is part of the call. Queue routing, hold, and transfer to a representative are part of what callers experience, so build scenarios that reach them.
  • Contact attributes. Contact attributes carry state between the contact flow and the agent, so a value set in one place and read in another is a real failure point.
  • Amazon Lex bots. If your contact flow uses an Amazon Lex bot instead of an AI agent, there is no AI agent to connect on a Phone Caller agent. Test the number as a phone caller agent, and see how to test Amazon Lex bots for the bot itself. To test the contact flow's keypad menus, create an IVR agent and import the flow, as described in Amazon Connect for IVR Agents.

Other Integrations​


Help and Support

Related Articles