Lemline documentation Help

Connections Reference

This reference explains how workflows reuse endpoint settings in Lemline.

Connections Overview

Lemline has no "connection" object: there is no use.connections section, no connection pools to configure, no connection health checks, failover or circuit breakers, and no lemline.connections.* runner settings.

Workflows reuse settings with the reusable components of the Open Workflow DSL that Lemline supports in the use section:

use section

Reused in

authentications

call: http endpoints (authentication.use)

secrets

Expressions, through $secrets

functions

call: <function name>

errors

raise tasks (error: <name>)

retries

try/catch (retry: <name>)

Reusing an Endpoint's Authentication

document: dsl: '1.0.3' namespace: examples name: reusing-an-endpoint-s-authentication version: '1.0.0' use: secrets: - USER_API_TOKEN authentications: userApi: bearer: token: ${ $secrets.USER_API_TOKEN } do: - getUser: call: http with: method: get endpoint: uri: http://127.0.0.1:8787/partner/stock authentication: use: userApi

Reusing a Call with a Function

Wrap a call in a function and call it by name. The with values of the calling task are the function's input:

document: dsl: '1.0.3' namespace: examples name: reusing-a-call-with-a-function version: '1.0.0' use: functions: getCustomer: do: - request: call: http with: method: get endpoint: ${ "http://127.0.0.1:8787/customers/" + .customerId } do: - fetchCustomer: call: getCustomer with: customerId: ${ .id }

Reusing a Retry Policy

document: dsl: '1.0.3' namespace: examples name: reusing-a-retry-policy version: '1.0.0' use: retries: standard: delay: seconds: 2 backoff: exponential: {} limit: attempt: count: 5 do: - fetchData: try: - callApi: call: http with: method: get endpoint: http://127.0.0.1:8787/stock query: fail: '503' failTimes: ${ .failures // 0 | tostring } key: ${ $workflow.id } catch: retry: standard

Broker and Database Connections

The runner's own connections to the message broker and the database are set in the runner configuration, not in workflows. See Runner Configuration Reference and Message Brokers.

Run the Examples

Every example on this page is a complete workflow. Complete the SQLite setup, save each example under the file name used below, and run the commands from the setup directory. With the JAR, substitute java -jar lemline.jar for bin/lemline.

Start the tutorial shop from the root of the Lemline source checkout:

docker compose -f examples/tutorial-services/compose.yaml up -d

The examples read secrets from the worker's environment. Stop the setup worker with Ctrl+C, export the values, and start it again:

export USER_API_TOKEN='demo-token' bin/lemline listen --debug

Run the next commands from a second terminal in the setup directory.

bin/lemline definition post -f reusing-an-endpoint-s-authentication.yaml bin/lemline instance start examples reusing-an-endpoint-s-authentication bin/lemline definition post -f reusing-a-call-with-a-function.yaml bin/lemline instance start examples reusing-a-call-with-a-function --input '{"id":"C-200"}' bin/lemline definition post -f reusing-a-retry-policy.yaml bin/lemline instance start examples reusing-a-retry-policy --input '{"failures":1}'

Example

Expected result

reusing-an-endpoint-s-authentication

The partner stock with "authenticatedWith":"bearer"

reusing-a-call-with-a-function

Customer C-200, Alan Turing

reusing-a-retry-policy

The stock after one retry

Stop the shop when you are done:

docker compose -f examples/tutorial-services/compose.yaml down
25 November 2026