Lemline documentation Help

How to call gRPC functions

Open Workflow defines call: grpc. Lemline registers such a definition, but it has no gRPC executor yet: an instance faults at the gRPC task with Unknown task type: CallGRPC. The examples below describe a stock service of the tutorial shop that exists only as an illustration: the shop has no gRPC server. Until Lemline supports gRPC, call an HTTP equivalent of the service, as shown at the end of this page. See Supported Features.

To check the registration, complete the SQLite setup, keep its worker running and use a second terminal in the setup directory. With the JAR, substitute java -jar lemline.jar for bin/lemline.

Define a unary call

Identify the protobuf resource, service and method. Set arguments to the request message fields.

document: dsl: '1.0.3' namespace: examples name: grpc-get-stock version: '0.1.0' do: - getStock: call: grpc with: proto: endpoint: file:///opt/shop/inventory.proto service: name: shop.InventoryService host: localhost port: 50051 method: GetStock arguments: sku: ${ .sku }

Save it as basic-grpc-call.yaml:

bin/lemline definition post -f basic-grpc-call.yaml bin/lemline instance start examples grpc-get-stock --input '{"sku":"SKU-1"}'

The definition registers. The instance faults with a runtime error titled Unknown task type: CallGRPC.

Configure authentication

Attach a policy to the service where the executing runtime supports it. This one sends a bearer token read from the apiToken secret:

document: dsl: '1.0.3' namespace: examples name: grpc-auth-example version: '0.1.0' use: secrets: - apiToken authentications: inventoryAuth: bearer: token: ${ $secrets.apiToken } do: - getStock: call: grpc with: proto: endpoint: file:///opt/shop/inventory.proto service: name: shop.InventoryService host: localhost port: 50051 authentication: use: inventoryAuth method: GetStock arguments: sku: ${ .sku } - recordStock: set: checked: true

Save it as example-using-authentication.yaml. Register it to check the definition; it cannot run on Lemline either:

bin/lemline definition post -f example-using-authentication.yaml

Call an HTTP equivalent

Start the tutorial shop from the root of the Lemline source checkout. Its product endpoint returns the same stock information over HTTP:

docker compose -f examples/tutorial-services/compose.yaml up -d
document: dsl: '1.0.3' namespace: examples name: grpc-alternative version: '1.0.0' do: - getStock: call: http with: method: get endpoint: '${ "http://127.0.0.1:8787/products/\(.sku | @uri)" }'

Save it as alternative.yaml:

bin/lemline definition post -f alternative.yaml bin/lemline instance start examples grpc-alternative --input '{"sku":"SKU-1"}'

The instance completes with the product and its stock, {"id":"SKU-1","name":"Garden hose","category":"garden","price":25,"available":100}. Stop the shop when you are done:

docker compose -f examples/tutorial-services/compose.yaml down

See the gRPC Task for configuration fields.

25 November 2026