# How RCS for Business works

RCS for Business agents communicate with users through messages, events, and
requests to achieve your business goals. Whether those goals are simple (such as
sending delivery notifications) or complex (such as booking a flight), agents
use rich cards, media, and suggestions to guide users through fluid
conversations that satisfy user and agent needs.

## How it works

The flow of conversation between your agent and a user is similar to a
conversation between two people, with each party taking turns speaking,
listening, and responding to the other.

Your RCS for Business agent initiates conversations with users. Users can't
start conversations with your agent, but once the agent starts a conversation,
the user can reply at any time.

Your agent sends the first message when it receives an external trigger that
you configure. A trigger can be anything and depends on your agent's use case:

- A package ships.
- It's time to send daily lunchtime sandwich deals.
- A user contacts customer support in chat.

[![An external trigger activates an RBM agent](https://developers.google.com/business-communications/rcs-business-messaging/guides/images/rbm-architecture-diagram.png)](https://developers.google.com/business-communications/rcs-business-messaging/guides/images/rbm-architecture-diagram.png "Click to open the sample banner in fullscreen in new tab")

When your agent receives the trigger, the agent [sends a message](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/send) to the user's
device with the RCS Business Messaging API. Your agent sends all messages,
events, and other requests to the user through the RBM API as HTTP requests with
JSON payloads. The user receives the message in the Messages app on their
device.

If the device doesn't support RCS, the RCS for Business platform returns
a `404` error, and the agent should fall back to another technology, such as
SMS.

When the user responds to the message or triggers an [event](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/events), Google's RCS for
Business service sends the response to your configured [webhook](https://developers.google.com/business-communications/rcs-business-messaging/guides/integrate/webhooks), which passes
the information back to your agent. The webhook sends all user messages, events,
and other requests to your agent as JSON.

After your agent [receives the message](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/receive), it decodes the JSON and parses
the response. Using internal logic, or relying on a natural language
understanding (NLU) module like [Dialogflow](https://dialogflow.com), your agent decides on a response
to the user's message and sends the response to the user's device through
the RBM API.

The conversation continues between your agent and the user until it reaches an
intended conclusion or the user stops responding.

### Example

The following example shows a simple scenario where a user asks for a weather
update.

1. Your agent receives a trigger from an external service indicating that a user requested a weather update.
2. Your agent sends a message to the user acknowledging the user's request and asking for the user's location.
3. In the Messages app, the user reads the message and responds with their address.
4. Your agent processes the response, fetches weather information, creates a conversational message, and sends the information to the user. Additionally, your agent asks if the user also wants weather information for another location.
5. The user reads the messages and thanks the agent.
6. Your agent acknowledges that the user didn't request additional information and ends the conversation.

## Encryption

RCS for Business messages sent between users and agents are encrypted between
RCS for Business agents and Google servers, and between Google servers
and users' devices. Partners can't use their own encryption keys because Google
needs to scan messages for malicious content to protect all users
and businesses.

For more information about data security for RCS for Business, refer to
[Data security for RCS for Business](https://developers.google.com/business-communications/rcs-business-messaging/terms-and-policies/data-security).

## What's next?

When you're comfortable with these concepts, consider what you want your
agent to do and [build your first agent](https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/first-agent).