Skip to main content

HTTP API Overview

Constellation Engine exposes a REST API for compiling and executing pipelines, plus a WebSocket endpoint for IDE integration via the Language Server Protocol.

Base URL​

http://localhost:8080

The port is configurable via the CONSTELLATION_PORT environment variable.

note

All endpoints except /health, /health/live, /health/ready, and /metrics require API key authentication when authentication is enabled via CONSTELLATION_API_KEYS.

Endpoints​

Core​

EndpointMethodDescription
/healthGETHealth check (liveness)
/health/liveGETLiveness probe
/health/readyGETReadiness probe
/health/detailGETDetailed diagnostics (auth-gated, opt-in)
/modulesGETList registered modules with type signatures
/compilePOSTCompile constellation-lang source, return DAG
/runPOSTCompile and execute in one call
/executePOSTExecute a previously stored pipeline
/metricsGETRuntime metrics (cache stats, execution counts)
/lspWebSocketLanguage Server Protocol for IDE support

Pipeline Management​

EndpointMethodDescription
/pipelinesGETList stored pipelines
/pipelines/{ref}GETGet pipeline metadata by name or hash
/pipelines/{ref}DELETEDelete a stored pipeline
/pipelines/{name}/aliasPUTRepoint a pipeline alias to a different hash

Suspension Management​

EndpointMethodDescription
/executionsGETList suspended executions
/executions/{id}GETGet suspension detail
/executions/{id}/resumePOSTResume with additional inputs
/executions/{id}DELETEDelete a suspended execution

Pipeline Versioning​

EndpointMethodDescription
/pipelines/{name}/reloadPOSTHot-reload a pipeline from new source
/pipelines/{name}/versionsGETList version history
/pipelines/{name}/rollbackPOSTRollback to previous version
/pipelines/{name}/rollback/{version}POSTRollback to a specific version

Canary Releases​

EndpointMethodDescription
/pipelines/{name}/canaryGETGet canary deployment status and metrics
/pipelines/{name}/canary/promotePOSTManually promote canary to next step
/pipelines/{name}/canary/rollbackPOSTRollback canary deployment
/pipelines/{name}/canaryDELETEAbort canary deployment

Module HTTP Endpoints​

EndpointMethodDescription
/modules/publishedGETList modules published as HTTP endpoints
/modules/{name}/invokePOSTInvoke a published module directly with JSON inputs

Common Workflows​

Validate a Pipeline Without Executing​

Use /compile when you want to check syntax and types without running the pipeline. This is useful for CI/CD validation or IDE integration.

curl -X POST http://localhost:8080/compile \
-H "Content-Type: text/plain" \
-d 'in x: Int; out x'

Run a Pipeline Once (Development)​

Use /run for ad-hoc execution during development. It compiles and executes in a single request—convenient but slower for repeated calls.

curl -X POST http://localhost:8080/run \
-H "Content-Type: application/json" \
-d '{"source": "in x: Int; out x", "input": {"x": 42}}'

Execute a Pre-Compiled Pipeline (Production)​

Use /compile once, then /execute repeatedly for production workloads. This avoids recompilation overhead.

# Step 1: Compile and get pipeline ID
PIPELINE_ID=$(curl -s -X POST http://localhost:8080/compile \
-H "Content-Type: text/plain" \
-d @pipeline.cst | jq -r '.pipelineId')

# Step 2: Execute by ID (fast, no recompilation)
curl -X POST "http://localhost:8080/execute/${PIPELINE_ID}" \
-H "Content-Type: application/json" \
-d '{"x": 42}'

Invoke a Module Directly (No Pipeline)​

Use /modules/{name}/invoke to call a published module without writing a .cst pipeline. First, mark the module with .httpEndpoint() in your Scala code.

# Discover published modules
curl http://localhost:8080/modules/published

# Invoke a module directly
curl -X POST http://localhost:8080/modules/Uppercase/invoke \
-H "Content-Type: application/json" \
-d '{"text": "hello world"}'

Check Server Health​

Use the health endpoints for monitoring and load balancer configuration.

EndpointUse Case
GET /healthQuick health check
GET /health/liveKubernetes liveness probe
GET /health/readyKubernetes readiness probe

Compile​

Choosing Between /run and /compile + /execute

Use /run for one-off executions where you have all inputs upfront. Use /compile followed by /execute when you want to compile once and execute multiple times with different inputs, or when you need to inspect the DAG before execution.

Compile constellation-lang source and return the execution DAG without running it.

curl -X POST http://localhost:8080/compile \
-H "Content-Type: application/json" \
-d '{
"source": "in text: String\nresult = Uppercase(text)\nout result"
}'

Run​

Compile and execute a pipeline in a single request.

curl -X POST http://localhost:8080/run \
-H "Content-Type: application/json" \
-d '{
"source": "in text: String\nresult = Uppercase(text)\nout result",
"inputs": { "text": "hello world" }
}'

Health Checks​

# Basic health check
curl http://localhost:8080/health

# Kubernetes liveness probe
curl http://localhost:8080/health/live

# Kubernetes readiness probe
curl http://localhost:8080/health/ready

Suspension Management​

Pipelines that encounter missing inputs suspend instead of failing. Use these endpoints to manage suspended executions.

List Suspended Executions​

curl http://localhost:8080/executions

Returns a list of execution summaries with executionId, structuralHash, resumptionCount, missingInputs, and createdAt.

Get Suspension Detail​

curl http://localhost:8080/executions/{id}

Returns the full detail of a single suspended execution, including all missing inputs and their expected types.

Resume a Suspended Execution​

curl -X POST http://localhost:8080/executions/{id}/resume \
-H "Content-Type: application/json" \
-d '{
"additionalInputs": { "missingField": "value" }
}'

The request body accepts:

  • additionalInputs -- map of input name to JSON value for missing inputs
  • resolvedNodes -- map of node name to JSON value for directly resolving nodes

Returns the same response format as /run and /execute. The pipeline may complete or suspend again if further inputs are still missing.

Delete a Suspended Execution​

curl -X DELETE http://localhost:8080/executions/{id}

Pipeline Management​

List Stored Pipelines​

curl http://localhost:8080/pipelines

Returns pipeline summaries with structuralHash, syntacticHash, aliases, compiledAt, moduleCount, and declaredOutputs.

Get Pipeline Detail​

# By alias name
curl http://localhost:8080/pipelines/my-pipeline

# By structural hash
curl http://localhost:8080/pipelines/sha256abcdef0123456789...

Pipeline references are resolved as follows: if the ref is exactly 64 hex characters, it's treated as a structural hash; otherwise it's treated as an alias name.

Delete a Pipeline​

curl -X DELETE http://localhost:8080/pipelines/my-pipeline

Returns 409 Conflict if other aliases still point to this pipeline.

Repoint an Alias​

curl -X PUT http://localhost:8080/pipelines/my-pipeline/alias \
-H "Content-Type: application/json" \
-d '{ "structuralHash": "abc123..." }'

Points the alias my-pipeline to a different structural hash.


Pipeline Versioning​

Versioning must be enabled on the server. These endpoints manage the version history of named pipelines.

Hot-Reload a Pipeline​

curl -X POST http://localhost:8080/pipelines/my-pipeline/reload \
-H "Content-Type: application/json" \
-d '{
"source": "in text: String\nresult = Uppercase(text)\nout result"
}'

Compiles the new source and atomically replaces the pipeline. The response includes previousHash, newHash, changed (whether the hash actually changed), and version (the new version number).

Optionally start a canary deployment on reload:

curl -X POST http://localhost:8080/pipelines/my-pipeline/reload \
-H "Content-Type: application/json" \
-d '{
"source": "...",
"canary": {
"initialWeight": 0.05,
"promotionSteps": [0.10, 0.25, 0.50, 1.0],
"observationWindow": "5m",
"errorThreshold": 0.05,
"autoPromote": true
}
}'

List Version History​

curl http://localhost:8080/pipelines/my-pipeline/versions

Returns the pipeline name, list of versions (each with version, structuralHash, createdAt, active), and activeVersion.

Rollback to Previous Version​

curl -X POST http://localhost:8080/pipelines/my-pipeline/rollback

Returns previousVersion, activeVersion, and the structuralHash of the now-active version.

Rollback to Specific Version​

curl -X POST http://localhost:8080/pipelines/my-pipeline/rollback/2

Canary Releases​

Canary deployments split traffic between an old and new pipeline version, gradually promoting the new version if metrics are healthy.

Get Canary Status​

curl http://localhost:8080/pipelines/my-pipeline/canary

Returns the canary state including currentWeight (traffic fraction to new version), currentStep, status (observing, promoting, rolled_back, complete), startedAt, and per-version metrics (request counts, error rates, latencies).

Promote Canary​

curl -X POST http://localhost:8080/pipelines/my-pipeline/canary/promote

Manually advances to the next promotion step.

Rollback Canary​

curl -X POST http://localhost:8080/pipelines/my-pipeline/canary/rollback

Routes all traffic back to the old version.

Abort Canary​

curl -X DELETE http://localhost:8080/pipelines/my-pipeline/canary

Aborts the canary deployment and routes all traffic to the old version.


Authentication​

warning

Request body size is limited by the underlying HTTP server configuration. For very large pipeline sources or input payloads, consider chunking your data or increasing server limits via http4s configuration.

Authentication is opt-in. When enabled, pass the API key in the Authorization header:

curl -H "Authorization: Bearer your-api-key" http://localhost:8080/modules

Roles control access levels:

RolePermissions
AdminAll HTTP methods
ExecuteGET + POST only
ReadOnlyGET only

Public paths exempt from auth: /health, /health/live, /health/ready, /metrics.

Server Configuration​

Configure via environment variables:

VariableDefaultDescription
CONSTELLATION_PORT8080Server port
CONSTELLATION_API_KEYS(none)Comma-separated key:Role pairs
CONSTELLATION_CORS_ORIGINS(none)Allowed CORS origins
CONSTELLATION_RATE_LIMIT_RPM100Requests per minute per client IP
CONSTELLATION_RATE_LIMIT_BURST20Burst size for rate limiter

Programmatic Server Setup​

import io.constellation.http.ConstellationServer

ConstellationServer.builder(constellation, compiler)
.withPort(8080)
.withAuth(AuthConfig(apiKeys = Map("key1" -> ApiRole.Admin)))
.withCors(CorsConfig(allowedOrigins = Set("https://app.example.com")))
.withRateLimit(RateLimitConfig(requestsPerMinute = 100, burst = 20))
.withHealthChecks(HealthCheckConfig(enableDetailEndpoint = true))
.run

See the Programmatic API guide for full details on setting up the runtime and server.

WebSocket (LSP)​

The /lsp endpoint provides Language Server Protocol support for IDEs. See the LSP WebSocket documentation for the protocol details.

Next Steps​