> For the complete documentation index, see [llms.txt](https://uci.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uci.sunbird.org/use/developer/uci-basics/transformers/broadcast-transformer.md).

# Broadcast Transformer

## Overview

Broadcast transformer converts a single message to multiple messages. Orchestrator send a list of user with there messages to be sent in a single XMessage. This transformer will generate mutiple xMessages based on the list of users & messages.&#x20;

It then pushes these messages to process outbound topic. Orchestrator gets to decide if any other change is required for these messages or to send it to directly to user via outbound.&#x20;

## Configuration

A bot will work with a broadcast transformer when we mention the type of the transformer as **broadcast.** When a bot is added, certain configuration will be added with this bot. This configuration needs to be changed for broadcast transformer. A sample broadcast configuration is given below

```
{
    "id": "774cd134-6657-4688-85f6-6338e2323dde",
    "meta": {
        "body": "Hi Sanchita! ${name} has submitted an air travel request for ${phoneNo}.",
        "type": "JS_TEMPLATE_LITERALS",
        "params": ["name", "phoneNo"]
    },
    "type": "broadcast"
}
```

Below are the brief details of each parameters included.

1. **id**: id of broadcast transformer
2. **meta:** Data related to message that will be to users.
   1. **body**: Message template text with parameters in it. Parameters should be included in the template in as **"${name}"**.
   2. **type**: Type of message template. **Eg**. JS\_TEMPLATE\_LITERALS
   3. **params**: Array of parameters provided in user segment. These parameter's values from user segment will be replaced in the message template text.&#x20;
3. &#x20;**type**: Type of transformer. **Eg**. broadcast

This configuration will be used when create a conversation logic. [Click here](https://uci.sunbird.org/pages/iyh1Cgn2i7ue92G4ym2v#2.2-create-a-conversation-logic) to see the conversation logic api.

## User segment

User segment needs to be defined to broadcast a message to users. This user segment must have a **phoneNo** parameter in it. The user segment can have multiple parameters in it, these parameters will be used later to be replaced in the message template text before sending the message to users.

Below is a sample of user segment.

```
{
    "data": [
        {
            "id": "1",
            "phoneNo": "9877777777",
            "name": "John",
            "url": "http://google.com"
        },
        {
            "id": "2",
            "phoneNo": "9866666666",
            "name": "Mike",
            "url": "http://google.com"
        }
    ]
}
```

&#x20; &#x20;


---

# 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://uci.sunbird.org/use/developer/uci-basics/transformers/broadcast-transformer.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.
