Global service

Updated at:

Global services support external service invocations. You can add new services by configuring service interfaces. You can directly reference global services within the system. A referenced service must be unlinked before it can be deleted.

The mock testing feature lets you test services with mock data.

In addition to editing functions in function nodes and the service registry, you can also write functions at the tenant level using global service management.

Functions written in global service management can be reused across multiple conversation flows within the tenant. You can call these functions using service invocation nodes.

You can test registered services online.

Note: After you create a service, set its status to Published. Otherwise, the service will not appear in the service invocation node.

Create a new service

  • For Invocation Method, specify whether the function invocation is required to return a result from the service.

  • If you select a synchronous invocation, the service returns a response when the call is complete or times out. If you select an asynchronous invocation, the caller must access the interface to retrieve the result or timeout information.

  • Service Timeout sets the time limit for a service invocation. If the time limit is exceeded, the system returns a timeout message.

Service settings and feature configuration

You can configure the parameters based on your service requirements. The system supports the HTTP protocol and both GET and POST methods.

Use case:

Parameter descriptions:

  • Service Name: A custom name for the service that describes the feature it provides.

  • Service Request Parameters: The parameters that the service must accept. For example, a weather service requires a city parameter.

  • Service Response Parameters: The parameters that the service returns. In a service node, you can assign the value of a response parameter to a global variable.

  • Service Interface: The third-party interface that the service calls.

  • Request Type: GET

  • Request URL: http://1210.0.XX.XX/smsapi

  • Request Parameters: The input parameters required by the third-party interface. You can reference the service request parameters using the ${variable} format, such as ${city}.

  • Interface Response Parameters: The result returned by the service interface, such as ${serviceOutput}. Assign this result to one of the service response parameters defined previously.

  • Name: A custom name for the node.

  • Select Service: Select a service from the service registry.

  • Service Request Parameters: These parameters correspond to the request parameters of the selected service. Assign values to these parameters from the conversation.

  • Service Response Parameters: The parameters returned from the service invocation. Assign the values of these parameters to global variables.