External Relay
  • 19 Jul 2024
  • 1 Minute to read
  • Contributors
  • PDF

External Relay

  • PDF

Article summary

Entry point of events that are sent by external sources.

In a typical use case, a client starts an operation with Data Flow and any event it sends enter the project through the Entry node.
In some use cases (eg. Voice Biometrics), you may want to send some extra information to an existing Data Flow session from an another service.

Data Flow provides a way to send events to existing sessions through its http API. These events enter the project through External Relay. Note that there can be at most one External node in a project.

Parameters:
none

Inputs

Audio:
None

Events:
All

Outputs

Audio:
None

Events:
All

Remarks:
Data Flow provides sessions http endpoint for sending events to existing sessions. The user must send a POST request to this endpoint. A header with name SessionId should contain the id of the session that the contents of this request will be delivered to.

Content-Type should be application/json and http message content should contain an event.
eg.

 {
    "Event":
    {
        "StartMsec": 0,
        "EndMsec": 0,
        "Channel": "0",
        "Name": "GreatEvent",
        "Data":
        {
            "ImportantInfo": "whatever",
            "SomeOtherInfo": 9
        },
        "GroupId": "rher456"
    }
}

Retrieving Session Id:

From Websocket Response

In order to send events to External Node one needs a SessionId.
Session Id is provided to the client in the StartResponse message, so the client may share Session Id with a useful external service.

From Custom nodes
Custom nodes can access Session Id by using SessionInfo.id().

Project Structure
External Relay can be used just like the Entry node. However, it can only be used for raising Event's. Which means it can be used as a substitute for almost any node. In the case below, it is used for raising Language Change events during runtime.

image.png

In the example below, External Relay is used to transmit VBStreamState event to VB Realtime. This is a prerequisite for VB Realtime to work.

image.png

Supported flow types: Stream, Batch


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.