> For the complete documentation index, see [llms.txt](https://atlas.anywhere.now/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atlas.anywhere.now/product-reference/dialogue-studio/dialogue-studio-example-flows/simple-voicebot-with-azure-openai.md).

# Simple voice bot (with Azure OpenAI)

Import a starter voicebot flow for Dialogue Studio that transcribes caller speech and answers it using Azure OpenAI.

This example builds a basic voicebot. It transcribes what the caller says, sends the transcript to Azure OpenAI, and speaks the response back. Use it as a starting point for a voice-driven question and answer flow.

## What it does

The caller is greeted, asked what they want to ask, and their spoken question is transcribed. The transcript is sent to Azure OpenAI as a chat completion request, and the response is read back to the caller before the call is disconnected.

## Prerequisites

* A UCC configured with Dialogue Studio and transcription enabled.
* An Azure OpenAI resource and deployed model, with the Azure OpenAI configuration flow already imported and populated. See [Connect to Azure OpenAI](/product-reference/dialogue-studio/dialogue-studio-example-flows/connect-azure-openai.md).

## Preview

![Simple voicebot flow](https://2627137428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FscZpnEdBjDgQmlVn1iLr%2Fuploads%2Fgit-blob-c8a621486399e71a382c1f68f2b2ec4c7a2be452%2Fsimple-voicebot.png?alt=media)

## Import the flow

1. Log in to your Dialogue Studio environment.
2. Open or create a tab for the flow.
3. From the menu in the top right, select **Import** and add the JSON from [`flows/simple-voicebot-azure-openai.json`](https://github.com/AnywhereNow/atlas-docs/tree/main/product-reference/dialogue-studio/dialogue-studio-example-flows/flows/simple-voicebot-azure-openai.json).
4. Deploy the flow.

## Configure after import

* Open the **Incoming Call** node (and the linked **disconnect** action node) and select or configure the UCC that should trigger this flow.
* This flow depends on the global `AzureOpenAI-Config` value (`url` and `apiKey`) set by the configuration flow described in [Connect to Azure OpenAI](/product-reference/dialogue-studio/dialogue-studio-example-flows/connect-azure-openai.md). Import and configure that flow first, or the Azure OpenAI request in this flow will not have valid credentials.
* Never store a real API key directly in this flow's nodes or in exported/debug output. Use the separate configuration flow and your organization's approved secret handling.

## How the flow works

* The **Incoming Call** node triggers two parallel paths: a **Say** node plays the greeting ("Hey there, I am the Anywhere365 voice bot, You are now talking to Azure OpenAI, what do you want to ask?"), and a **Transcriptor** node starts listening.
* When the transcriptor produces a final transcript, a **Say** node confirms what was heard ("Ok, asking Azure OpenAI: ...") and a **Change** node sets `payload.stop` to `true`, which is wired back into the transcriptor to stop it. This is required because the transcriptor otherwise keeps listening and restarting after every result.
* The **Simple Chat from Azure Open AI** group of nodes then runs:
  * **Prepare request for OpenAI** (function node) reads the `AzureOpenAI-Config` global values and builds the chat completion payload, using the transcript as the user message.
  * An **HTTP request** node posts the payload to the configured Azure OpenAI endpoint.
  * A **Change** node extracts `payload.choices[0].message.content` from the response.
* A final **Say** node reads the response back to the caller, followed by a disconnect message and a **disconnect** action.

## Safe fallback behavior

The transcriptor is explicitly stopped after the first result so it does not keep listening in the background, per the comment in the source flow. This example flow does not include an HTTP status check on the Azure OpenAI response; if you plan to run this in production, add a status check similar to the one used in the [Connect to ServiceNow](/product-reference/dialogue-studio/dialogue-studio-example-flows/connect-servicenow.md) or [Connect to Microsoft Graph as an application](/product-reference/dialogue-studio/dialogue-studio-example-flows/connect-microsoft-graph-application.md) examples so a failed request does not leave the caller waiting silently.

## Verification

1. Call the UCC and confirm the greeting plays.
2. Ask a question and confirm the transcript is echoed back before the request is sent.
3. Confirm Azure OpenAI's response is read back to the caller.
4. Confirm the call disconnects after the response is read.

## Related topics

* Go to [Connect to Azure OpenAI](/product-reference/dialogue-studio/dialogue-studio-example-flows/connect-azure-openai.md) to set up the required configuration flow before using this example.
* Go to [Dialogue Studio example flows](/product-reference/dialogue-studio/dialogue-studio-example-flows.md) for the full gallery of example flows.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://atlas.anywhere.now/product-reference/dialogue-studio/dialogue-studio-example-flows/simple-voicebot-with-azure-openai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
