Websocket Server Trigger
Websocket Server trigger acts as a server to WebSocket clients. You can use the Websocket Server trigger to handle messages from WebSocket clients over a WebSocket connection. You can map this received data as a flow input for further processing.
Trigger Settings
Field | Required | Description |
---|---|---|
Trigger Settings | ||
Port | Yes |
The port on which the trigger listens for requests. Default: 9998 You can change this to use another port that is open. Note: If the app has multiple triggers that require a port to be specified, specify a unique port number for each trigger. Two triggers in the same app cannot run on the same port.
|
Enable TLS | Yes |
By default, it is set to False. If you set this field to True, you can create a secure endpoint by providing Server Key and CA or Server Certificate. CA or Server Certificate: A PEM encoded CA or self-signed server certificate file Server Key: A PEM encoded private key file You can use an application property for the Server Cert and Server Key fields. For more information, see the "App Properties" topic in the |
Handler Settings | ||
URI Path | Yes |
The resource path for the operation. By default, the path displayed here is the resource path you had entered when you created the flow. Use {} to configure path parameters. Example: This field can also be set by using an application property. |
Mode | Yes |
Selects one of the following modes from the drop-down list: Data: Use this mode to read data on the WebSocket connection. Data received from each reading, triggers a new flow. Trigger reads on the connection until the connection is closed by the client or there is any connection error. You can map the received data to flow input by using the content field on the Map to Flow Inputs tab. You can map the received connection to flow input by using the wsconnection field. Connection: Use this mode to provide the trigger output as the WebSocket connection. In this mode, each client request triggers a new flow and the connection is closed after the flow execution is completed. You can map the connection to a flow input by using the wsconnection field on the Map to Flow Inputs tab. In this mode, the content field is not available on the Map to Flow Inputs tab. |
Message Format | Yes |
Selects one of the following formats of the message body: String: String message. JSON: If JSON is selected, a text editor is provided to accept a JSON document. |
Schema for JSON value | No | Schema for the received WebSocket message. The Schema for JSON value field is only available when the Message Format field is JSON. This is a free form text editor that accepts any valid JSON document. You can also specify an app-level schema by using the Use app level schema option. |
Output Settings
The Output Settings tab has the following fields:
Field | Required | Description |
---|---|---|
Path Params | No | The path parameters for the trigger. |
Query Params | No |
Query parameters to be appended to the path. To add the query parameters, click the parameterName: Name of the query parameter type: The data type of the query parameter. Supported types are string, number, or boolean. repeating: Set to True if more than one value is expected for the query parameter. required: Set to True if query parameter is a required configuration. The trigger reports an error if no values are provided to the required query parameter. |
Headers | No |
HTTP request Header parameters for the trigger. To add the header parameter, click the parameterName: Name of the header parameter. type: The data type of the header parameter. Supported types are string, number, or boolean. repeating: Set to True if more than one value is expected for the HTTP header. required: Set to True if header parameter is a required configuration. The trigger reports an error if no values are provided to the required header parameter. |
Map to Flow Inputs
This tab allows you to map the trigger output to flow input.