gRPC
The gRPC task invokes remote endpoints in gRPC services and allows communication with backend systems using the gRPC protocol.
The gRPC task constructs a request using the specified method, host, and request body, and sends it to the gRPC server. The task captures the response and makes it available for use in workflows.
Task configuration
Configure these parameters for the gRPC task.
Parameter | Description | Required/ Optional |
---|---|---|
inputParameters.method | The gRPC method to invoke within the service. | Required. |
inputParameters.host | The hostname or IP address of the gRPC server. | Required. |
inputParameters.port | The port on which the gRPC server is running. | Required. |
inputParameters.request | A JSON object representing the request payload. | Required. |
inputParameters.methodType | The gRPC method type. Supported values:
| Required. |
inputParameters.useSSL | Determines the connection security. Set to true to secure the connection using SSL. | Optional. |
inputParameters.trustCert | Specifies whether the client should trust the server’s certificate. Set to true to allow connections to servers with self-signed or unverified certificates. | Optional. |
inputParameters.hedgingConfig.maxAttempts | The maximum number of parallel requests to send. The system uses the response from the first successful attempt, helping reduce tail latencies in remote services. Note: Hedging makes parallel requests, so use it only for idempotent services. | Optional. |
inputParameters.headers | A map of additional headers to be sent along with the request. Supported types:
| Optional. |
inputParameters.inputType | The input schema for the request. Learn more about using schemas in Conductor.
| Optional. |
inputParameters.outputType | The output schema for the response. Learn more about using schemas in Conductor.
| Optional. |
Caching parameters
You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.
Parameter | Description | Required/ Optional |
---|---|---|
cacheConfig.ttlInSecond | The time to live in seconds, which is the duration for the output to be cached. | Required if using cacheConfig. |
cacheConfig.key | The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters. It can be a string concatenation that contains the task’s input keys, such as ${uri}-${method} or re_${uri}_${method} . | Required if using cacheConfig. |
Other generic parameters
Here are other parameters for configuring the task behavior.
Parameter | Description | Required/ Optional |
---|---|---|
optional | Whether the task is optional. The default is false. If set to true, the workflow continues to the next task even if this task is in progress or fails. | Optional. |
Task definition
This is the task configuration for a gRPC task.
{
"name": "gRPC",
"taskReferenceName": "gRPC_ref",
"type": "GRPC",
"inputParameters": {
"method": "hello.proto",
"host": "grpcb.in",
"port": 9000,
"methodType": "SERVER_STREAMING",
"useSSL": true,
"trustCert": true,
"hedgingConfig": {
"maxAttempts": 4
},
"inputType": "<INPUT-SCHEMA>",
"outputType": "<OUTPUT-SCHEMA>",
"request": {
"key": "value"
},
"headers": {
"x-api-key": "${workflow.secrets.api}"
}
}
}
Task output
The gRPC task returns the server’s response as task output, making it available for use in subsequent workflow steps. The structure of the output depends on the response of the gRPC method.
Adding a gRPC task in UI
gRPC task parameters can be automatically populated using registered services or configured manually through the UI.
- Using registered services
- Manually configuring a gRPC task
To add a gRPC task using registered services:
- In your workflow, select the (+) icon and add a gRPC task.
- Select Populate from remote services.
- In Service, select the registered service.
- In Service method, select the required endpoint.
- Select Populate.
- (Optional) In Hedging Config > Maximum attempts, enter a value for parallel hedged requests to reduce latency.
- (Optional) Enable Use SSL if the connection should be secured using TLS.
- (Optional) Enable Trust Certificate to allow trusting the server’s certificate.
This method automatically populates gRPC task parameters based on the selected service.
To add a gRPC task manually:
- In your workflow, select the (+) icon and add a gRPC task.
- In Method, enter the name of the method to invoke.
- In Host, enter the hostname or IP address of the gRPC server.
- In Port, enter the port where the gRPC server is running.
- In Request, provide a JSON object representing the request payload.
- In Method type, select one of the following: UNARY, SERVER_STREAMING, CLIENT_STREAMING, or BIDI_STREAMING.
- (Optional) Enable Use SSL if the connection should be secured using TLS.
- (Optional) Enable Trust Certificate to allow trusting the server’s certificate.
- (Optional) In Hedging Config > Maximum attempts, enter a value for parallel hedged requests to reduce latency.
- (Optional) In Header, add any additional headers to be sent along with the request.
- (Optional) In Input type, select the input schema for the request.
- (Optional) In Output type, select the output schema for the request.