Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Serverless Integrations
  • Comparison with other Yandex Cloud services
    • All guides
        • Sending events directly
        • Sending events using a connector
    • Viewing operations with service resources
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Public materials
  • Release notes

In this article:

  • Timer
  • Connector for the EventRouter API
  • Connector for Yandex Data Streams
  • Connector for Yandex Message Queue
  1. Step-by-step guides
  2. EventRouter
  3. Sending events to a bus
  4. Sending events using a connector

Sending events to a bus using a connector

Written by
Yandex Cloud
Updated at July 15, 2025
  • Timer
  • Connector for the EventRouter API
  • Connector for Yandex Data Streams
  • Connector for Yandex Message Queue

TimerTimer

To send events to a bus using a connector with a Timer source, specify in the connector settings the data to send to the bus when the timer triggers.

Connector for the EventRouter APIConnector for the EventRouter API

Note

You can send events to a bus using a connector for the EventRouter API only if there is at least one rule attached to that bus.

To send events to a bus using a connector with an EventRouter API source:

CLI
API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. View the description of the CLI command to send events to a bus using a connector for the EventRouter API:

    yc serverless eventrouter send-event --help
    
  2. Get a list of connectors:

    yc serverless eventrouter connector list
    

    Result:

    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    |          ID          |         NAME          |        BUS ID        |      FOLDER ID       | STATUS  | DELETION PROTECTION |
    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    | f66g4h59ih2g******** | connector-my-ydb-flow | f66qn4p7uk6p******** | b1g681qpemb4******** | STOPPED | true                |
    | f66g6jcnc5no******** | yds-via-cli           | f66qn4p7uk6p******** | b1g681qpemb4******** | RUNNING | false               |
    | f66jfhcg1u71******** | mq-via-terraform      | f66qn4p7uk6p******** | b1g681qpemb4******** | RUNNING | false               |
    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    
  3. Send an event to a bus using the connector you selected:

    yc serverless eventrouter send-event \
      --name <connector_name> \
      --event '<event>' \
      --file <file_path>
    

    Where:

    • --name: Name of the connector you are using to send the event to the bus.

      Instead of name, you can provide the connector's ID in the --id parameter.

    • --event: Event in JSON format, e.g., {"name": "value"}.

    • --file: Path to the file containing the event or batch of events in JSON format.

      You can use the --file parameter to send to the bus either one event or several events at the same time by specifying them in the command as a JSON array, e.g., [{"name1": "value1"},{"name2": "value2"}].

    The --event and --file parameters are mutually exclusive: you can use only one of them.

Use the EventService/Send gRPC API call to send an event to a bus using a connector for the EventRouter API:

  1. If you do not have the gRPCurl utility installed, install it.

  2. If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

  3. Get an IAM token used for authentication in the API.

    IAM_TOKEN=$(yc iam create-token)
    

    The command will save the IAM token to the IAM_TOKEN variable.

  4. Get a list of connectors:

    yc serverless eventrouter connector list
    

    Result:

    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    |          ID          |         NAME          |        BUS ID        |      FOLDER ID       | STATUS  | DELETION PROTECTION |
    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    | f66g4h59ih2g******** | connector-my-ydb-flow | f66qn4p7uk6p******** | b1g681qpemb4******** | STOPPED | true                |
    | f66g6jcnc5no******** | yds-via-cli           | f66qn4p7uk6p******** | b1g681qpemb4******** | RUNNING | false               |
    | f66jfhcg1u71******** | mq-via-terraform      | f66qn4p7uk6p******** | b1g681qpemb4******** | RUNNING | false               |
    +----------------------+-----------------------+----------------------+----------------------+---------+---------------------+
    
  5. Create a file with the request body, e.g., body.json:

    {
      "connector_id": "<connector_ID>",
      "message": <event_or_array_of_events>
    }
    

    Where:

    • connector_id: ID of the connector you are using to send the event to the bus.

    • message: Event in JSON format, e.g., "{\"name\": \"value\"}".

      You can send to the bus either one event or several or several events at the same time by specifying them in the message field as a JSON array, e.g., ["{\"name1\": \"value1\"}","{\"name2\": \"value2\"}"].

  6. Run a gRPC call by specifying the path to the body.json file you created earlier:

    grpcurl \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d @ < body.json \
      events.eventrouter.serverless.yandexcloud.net:443 yandex.cloud.serverless.eventrouter.v1.EventService/Send
    

Connector for Yandex Data StreamsConnector for Yandex Data Streams

Events get to the bus from a data stream through a connector with a Yandex Data Streams source.

Connector for Yandex Message QueueConnector for Yandex Message Queue

Events get to the bus from a message queue through a connector with a Yandex Message Queue source.

Was the article helpful?

Previous
Sending events directly
Next
Getting a list of connectors
© 2025 Direct Cursus Technology L.L.C.