# MQTT Data Flow

The following image shows the data flow between external systems and your In-Sight vision system when communicating over an MQTT Message Queue Telemetry Transport (MQTT) is a lightweight messaging protocol used to send and receive data between devices. connection:

Step | Description
--- | ---
1 | The vision system subscribes to the configured command topic In MQTT, a topic is a channel name where devices can publish messages, or can subscribe to for receiving messages. on the MQTT broker A broker is a server that receives messages from publishers and forwards them to subscribers. In MQTT, the broker acts as a central hub, managing topics and message delivery between devices and systems..
2 | An external system publishes a command to the command topic on the MQTT broker.
3 | The broker delivers the command to the vision system, triggering the MQTT script on the vision system.
4 | The script executes the handler for incoming messages.
5 | The handler executes the action in the command message on the vision system.
6 | The vision system issues a command result message.
7 | The script sends a command response to the MQTT broker.
8 | The vision system completes the inspection.
9 | The vision system delivers the inspection result.
10 | The script constructs the MQTT payload containing the inspection result.
11 | The script publishes the inspection result to the result topic on the MQTT broker.
12 | If your MQTT connection has QoS 1 or 2, the MQTT broker acknowledges the inspection result message.
13 | The MQTT broker delivers the inspection result to the external system.