Skip to main content

Remote Services

Remote Services in Orkes Conductor provide a centralized interface for defining, testing, and managing HTTP and gRPC service endpoints. Without additional configuration, these services can be reused across multiple workflows using built-in system tasks like HTTP, HTTP Poll, and gRPC.

Here is an overview of how to use the service registry in Conductor workflows:

  1. Define a remote service
  2. Discover or add endpoints
  3. Configure circuit breaker pattern
  4. Test endpoints
  5. Add services to workflows

Define a service

A service can be registered for use in HTTP, HTTP Poll, and gRPC tasks. The configuration steps differ based on the task type.

To define a service:

  1. Go to Definitions > Remote Services from the left navigation menu on your Conductor cluster.
  2. Select + New service.
  3. In Service registry name, enter a unique name for the service.
  4. Set Service type to HTTP.
  5. Enter the Swagger specification URL (ending in .json) in the Swagger URL. For example: https://petstore.swagger.io/v2/swagger.json.
  6. Select Save.

Creating sample service registry definition for HTTP services

Discover or add endpoints

After defining a service, you can either automatically discover its endpoints or add them manually.

a. Discover endpoints

To automatically fetch the endpoints within the services:

  1. Open your service definition.
  2. Select Discover methods to fetch all endpoints automatically.

Fetching endpoints from the HTTP services

Once fetched, the corresponding schemas are automatically registered under Schemas in Conductor.

Schema registered from the fetched endpoints of HTTP service

b. Add endpoints

To add a new endpoint to the HTTP services:

  1. From your service definition, select + Add New Method.

Adding a new method to the service registry definition

  1. Enter the following endpoint parameters:
ParameterDescription
Resource NameThe action or purpose of the endpoint.
PathThe method name for the endpoint.
Method TypeThe method type for the service. Supported values:
  • GET
  • POST
  • PUT
  • DELETE
  • PATCH.
Input SchemaSelect from existing input schemas in Conductor.
Output SchemaSelect from existing output schemas in Conductor.
  1. Select Add.

This saves the endpoint within the service definition.

Configure circuit breaker pattern for individual services

Circuit breaker patterns help prevent cascading failures by halting calls to unhealthy services, thus protecting the workflows.

The Circuit Breaker pattern has two circuit states:

  • Closed - Normal operation state where all requests pass through normally.
  • Open - Failure state where the requests fail fast, thus protecting the service.

To configure the circuit breaker pattern for a service:

  1. Go to the Circuit Breaker Configuration tab in your remote service definition.
  2. Toggle on Circuit Breaker Configuration.
  3. Configure the following parameters:
ParameterDescriptionTypes
Failure rate thresholdThe failure rate threshold is a percentage between 0 and 100; when the failure rate equals or exceeds this value, the circuit breaker opens to block further calls. Default is 50.
For example, setting the threshold to 50% means the circuit will open when half of the calls fail. Set it to 0 to disable this behavior.
Float.
Sliding window sizeThe size of the sliding window, which is used to record the outcome of calls when the circuit breaker is closed. The value ranges between 1 and 1000. Default is 100.Integer.
Minimum number of callsThe minimum number of calls required within a sliding window before the circuit breaker evaluates the error rate or slow call rate. The minimum value is 1, and the maximum value should not exceed the Sliding window size. Default is 100.
For example, if this value is 10, then at least 10 calls must be recorded before the failure rate can be calculated. If only 9 calls have been recorded, the Circuit Breaker will not transition to open even if all 9 calls have failed.
Integer.
Wait duration in open stateThe time in ms that the circuit breaker must wait before transitioning from open to half-open. The value ranges between 1000-300000. Default is 1000.Integer.
Permitted number of calls in half open stateThe number of calls allowed while the Circuit Breaker is in the half-open state. The value ranges between 1 and 100. Default is 100.Integer.
Slow call rate thresholdThe percentage threshold for calls classified as slow. A call is considered slow if its duration exceeds the Slow call duration threshold.
If the percentage of slow calls within the sliding window equals or exceeds this threshold, the Circuit Breaker transitions to the open state and begins short-circuiting calls.
The value ranges between 0 and 100. Set to 0 to disable slow-call triggering. Default is 50.
Float/Decimal.
Slow call duration thresholdThe duration threshold (in ms) above which calls are considered slow. Calls exceeding this time increase the slow call rate. The value ranges between 1000-60000. Default is 100.Integer.
Max wait duration in half open stateThe maximum wait duration (in ms) the circuit breaker can remain in the half-open state before transitioning back to the open state. A value of 0 means the circuit breaker will remain half-open indefinitely until all permitted calls are completed.
The value can range between 1 and 300000. Default is 1.
Integer.
Automatic transition from open to half open enabledIf set to true, the circuit breaker automatically transitions from the open state to the half-open state, and no call is required to trigger the transition.
If set to false, the transition to half-open occurs only when a call is made.
N/A
  1. Select Save.

Test endpoints

Once the endpoints are fetched or added, you can test them before adding them to your workflows.

To test registered endpoints:

  1. From your service registry definition page, select the test () icon next to the endpoint.
  2. Make the required configuration changes, and select Execute.

Testing endpoints

The test returns the server response and generates a link to a sample workflow execution.

Interface for testing endpoints with sample workflow execution link

Add services to workflows

Once the services are registered, you can add them to HTTP, HTTP Poll, and gRPC tasks in your workflows.

To add a service to workflows:

  1. Go to Definitions > Workflows.
  2. Create a new workflow or select an existing one.
  3. Add an HTTP/HTTP Poll task.
  4. Select Populate from remote services.
  5. In Service, select the registered service.
  6. In Service method, select the required endpoint.
  7. Select Populate.

Adding the registered service to an HTTP task

This auto-populates the HTTP task parameters in the workflow.

  1. For HTTP Poll tasks, configure the additional parameters such as Termination condition, Polling interval, and Polling strategy.
  2. (For HTTP task) In the Hedging config, set the Maximum attempts, which specifies the number of parallel requests the system should make when executing the task. The system returns the response from the first successful attempt, which helps reduce tail latencies for remote services. Hedging sends multiple parallel requests; hence, use this feature only with idempotent services to prevent unintended side effects from duplicate executions.
  3. Select Save > Confirm.