Skip to content

gRPC

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 parameters

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:
  • UNARY
  • CLIENT_STREAMING
  • SERVER_STREAMING
  • BIDI_STREAMING
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:
  • 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.inputType The 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.outputType The 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.

The following are generic configuration parameters that can be applied to the task and are not specific to the gRPC task.

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.

If set to true, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

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.