Skip to main content

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.

ParameterDescriptionRequired/ Optional
inputParameters.methodThe gRPC method to invoke within the service.Required.
inputParameters.hostThe hostname or IP address of the gRPC server.Required.
inputParameters.portThe port on which the gRPC server is running.Required.
inputParameters.requestA JSON object representing the request payload.Required.
inputParameters.methodTypeThe gRPC method type. Supported values:
  • UNARY
  • CLIENT_STREAMING
  • SERVER_STREAMING
  • BIDI_STREAMING
Required.
inputParameters.useSSLDetermines the connection security. Set to true to secure the connection using SSL.Optional.
inputParameters.trustCertSpecifies 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.maxAttemptsThe 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.headersA map of additional headers to be sent along with the request. Supported types:
  • Accept-Language
  • Authorization
  • Cache Control
  • Content-MD5
  • From
  • If-Match
  • If-Modified-Since
  • If-None-Match
  • Max-Forwards
  • Pragma
  • If-Range
  • If-Unmodified-Since
  • Proxy-Authorization
  • Range
  • Warning
  • x-api-key
  • Accept-Charset
  • Accept-Encoding
  • Accept-Control-Request-Headers
  • Accept-Control-Request-Method
  • Content-Transfer-Encoding
  • Expect
  • Transfer-Encoding
  • Trailer
Optional.
inputParameters.inputTypeThe input schema for the request. Learn more about using schemas in Conductor.
  • If you’re using a registered service, this value is the schema name automatically registered when fetching the service definition.
  • If you’re configuring the task manually, enter the name of the input schema you want to associate with the task.
Optional.
inputParameters.outputTypeThe output schema for the response. Learn more about using schemas in Conductor.
  • If you’re using a registered service, this value is the schema name automatically registered when fetching the service definition.
  • If you’re configuring the task manually, enter the name of the output schema you want to associate with the task.
Optional.

Caching parameters

You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.

ParameterDescriptionRequired/ Optional
cacheConfig.ttlInSecondThe time to live in seconds, which is the duration for the output to be cached.Required if using cacheConfig.
cacheConfig.keyThe 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.

ParameterDescriptionRequired/ Optional
optionalWhether 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.

To add a gRPC task using registered services:

  1. In your workflow, select the (+) icon and add a gRPC task.
  2. Select Populate from remote services.
  3. In Service, select the registered service.
  4. In Service method, select the required endpoint.
  5. Select Populate.
  6. (Optional) In Hedging Config > Maximum attempts, enter a value for parallel hedged requests to reduce latency.
  7. (Optional) Enable Use SSL if the connection should be secured using TLS.
  8. (Optional) Enable Trust Certificate to allow trusting the server’s certificate.

Adding gRPC task

This method automatically populates gRPC task parameters based on the selected service.