Skip to main content

Worker agent API

The WME agent (daghandler, Go 1.22 + Gin) runs on every worker at port 8090. Only the backend should call it.

SettingValue
Sourcemaize-processing-engine-worker/daghandler
FoldersDAGS_DIR=/app/dags, PROCESSORS_DIR=/app/processors (mounted from the worker host)
DockerGo SDK over /var/run/docker.sock
SecretWME_SERVICE_TOKEN (required to start)

DAG and processor files​

These endpoints are not authenticated — restrict port 8090 to the backend.

Method & pathBodyEffect
POST /createDag{filename, content}Write a DAG file into dags/
DELETE /deleteDag{filename}Remove a DAG file
POST /cloneRepo{folderName, repoUrl, branch, subdirectory, accessToken}git clone --depth 1 into processors/<folderName> (5-minute timeout); verifies a compose file exists; the token is used only for https URLs
POST /createProcessorFolder{folderName, dockerComposeContent}Write a docker-compose.yml (legacy upload-based definitions)
DELETE /deleteProcessorFolder{folderName}Remove a processor folder

Runtime​

Every /runtime/* request needs:

X-WME-Service-Token: <WME_SERVICE_TOKEN>
X-WME-Owner-Id: <Keycloak user id>

A wrong or missing token returns 401 {"message": "invalid service token"}. Results are limited to containers labelled wme.managed=true and wme.owner-id=<owner>.

Method & pathEffect
GET /runtime/containersContainers with their wme.* labels, state, health, image, created time, restart count
GET /runtime/containers/{containerId}/logs?tail=200Last n log lines (1–2000, default 200)
POST /runtime/processor-manifests/{pmId}/actions/{action}start, stop or restart the processor's containers
DELETE /runtime/processor-manifests/{pmId}/containersRemove the processor's containers (orphan cleanup)

The backend exposes these to the editor as /user/v1/monitoring/workers/{workerId}/... (API reference).

OpenAPI

daghandler/openapi.yaml currently documents only the file endpoints, not /runtime/*.