Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex API Gateway
  • Getting started
    • Resource relationships
    • Networking
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Yandex Cloud Logging
      • Trigger for Yandex IoT Core
      • Trigger for budgets
      • Trigger for Data Streams
      • Email trigger
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Batching
  • Roles required for the proper operation of a trigger for Yandex IoT Core
  • Yandex IoT Core trigger message format
  • Device
  • Broker
  • See also
  1. Concepts
  2. Trigger
  3. Trigger for Yandex IoT Core

Trigger for Yandex IoT Core that sends messages to WebSocket connections

Written by
Yandex Cloud
Updated at August 12, 2024
  • Batching
  • Roles required for the proper operation of a trigger for Yandex IoT Core
  • Yandex IoT Core trigger message format
    • Device
    • Broker
  • See also

A trigger for Yandex IoT Core manages messages exchanged between devices, registries, and brokers. It is created for topics: it receives copies of messages from the topics and sends the messages to WebSocket connections for processing.

The trigger must be in the same cloud as the device, registry, or broker whose topic it reads messages from.

You can create a trigger:

  • For a standard topic implemented by the service except for the $monitoring/<device_ID>/json topic.
  • For a topic with any subtopics and wildcards.
  • For an alias topic.

A trigger for Yandex IoT Core requires a service account to send messages to WebSocket connections.

For more information about creating a trigger for Yandex IoT Core, see Creating a trigger that sends messages to WebSocket connections from an Yandex IoT Core registry or device topic and Creating a trigger that sends messages to WebSocket connections from an Yandex IoT Core broker.

Batching

Batching settings allow you to send multiple messages to WebSocket connections in one go. They set a top limit on a message batch size and its accumulation time. For example, if the message batch size is 3, WebSocket connections can receive batches containing from 1 to 3 messages.

Roles required for the proper operation of a trigger for Yandex IoT Core

  • To create a trigger, you need a permission for the service account under which the trigger executes the operation. This permission comes with the iam.serviceAccounts.user and editor roles or higher.
  • To activate a trigger, the service account needs the api-gateway.websocketBroadcaster role for the folder containing the API gateway.

Read more about access management.

Yandex IoT Core trigger message format

Before sending a message copy to WebSocket connections, the trigger converts it to the format below.

Device

{
    "messages": [
        {
            "event_metadata": {
                 "event_id": "2153b5d2-c6af-4c69-a28d-74ce********",
                 "event_type": "yandex.cloud.events.iot.IoTMessage",
                 "created_at": "2019-09-25T15:51:17.872320525Z"
            },
            "details": {
                 "registry_id": "arenou2oj4ct********",
                 "device_id": "areqjd6un3af********",
                 "mqtt_topic": "$devices/areqjd6un3af********/events",
                 "payload": "VGVz****"
            }
        },
        {
            "event_metadata": {
                 "event_id": "2153b5d2-c6af-4c69-a28d-74ce********",
                 "event_type": "yandex.cloud.events.iot.IoTMessage",
                 "created_at": "2019-09-25T15:51:17.872320525Z"
            },
            "details": {
                 "registry_id": "arenou2oj4ct********",
                 "device_id": "areqjd6un3af********",
                 "mqtt_topic": "$devices/areqjd6un3af********/events",
                 "payload": "VGVz****"
            }
        }
    ]
}

Broker

{
   "messages":[
      {
         "event_metadata":{
            "event_id":"2153b5d2-c6af-4c69-a28d-74ce********",
            "event_type":"yandex.cloud.events.iot.IoTMessage",
            "created_at":"2019-09-25T15:51:17.872320525Z"
         },
         "details":{
            "broker_id":"arenou2oj4ct********",
            "mqtt_topic":"broker/topic",
            "payload":"VGVz****"
         }
      },
      {
         "event_metadata":{
            "event_id":"2153b5d2-c6af-4c69-a28d-74ce********",
            "event_type":"yandex.cloud.events.iot.IoTMessage",
            "created_at":"2019-09-25T15:51:17.872320525Z"
         },
         "details":{
            "broker_id":"arenou2oj4ct********",
            "mqtt_topic":"broker/topic",
            "payload":"VGVz****"
         }
      }
   ]
}

See also

  • Trigger for Yandex IoT Core that sends messages to a Serverless Containers container
  • Trigger for Yandex IoT Core that sends messages to a Cloud Functions function

Was the article helpful?

Previous
Trigger for Yandex Cloud Logging
Next
Trigger for budgets
Yandex project
© 2025 Yandex.Cloud LLC