The SchemaClient provides operations to manage schemas in Conductor. Schemas define the structure of workflow inputs, outputs, and task data using JSON Schema, Avro, or Protobuf formats.
- Java 21+
- A running Conductor server with schema APIs enabled (start one locally with the CLI, or use an existing server)
org.conductoross:conductor-client:<VERSION>from Maven Central
import com.netflix.conductor.client.http.ConductorClient;
import io.orkes.conductor.client.OrkesClients;
import io.orkes.conductor.client.SchemaClient;
ConductorClient client = new ConductorClient("https://your-conductor-server/api");
OrkesClients orkesClients = new OrkesClients(client);
SchemaClient schemaClient = orkesClients.getSchemaClient();import com.netflix.conductor.common.metadata.SchemaDef;
import java.util.Map;
SchemaDef schema = SchemaDef.builder()
.name("my-schema")
.version(1)
.type(SchemaDef.Type.JSON)
.data(Map.of(
"type", "object",
"properties", Map.of(
"id", Map.of("type", "string"),
"name", Map.of("type", "string")
)
))
.build();
schemaClient.saveSchema(schema);schemaClient.saveSchemas(List.of(schemaA, schemaB));SchemaDef schema = schemaClient.getSchema("my-schema");SchemaDef schema = schemaClient.getSchema("my-schema", 2);// Full details
List<SchemaDef> all = schemaClient.getAllSchemas(false);
// Short format (name + version only)
List<SchemaDef> summary = schemaClient.getAllSchemas(true);// Delete all versions
schemaClient.deleteSchema("my-schema");
// Delete a specific version
schemaClient.deleteSchema("my-schema", 2);Every SchemaDef carries an integer version field (default 1). To create a new version of an existing schema, save a SchemaDef with the same name and an incremented version.
SchemaDef v2 = SchemaDef.builder()
.name("my-schema")
.version(2)
.type(SchemaDef.Type.JSON)
.data(updatedData)
.build();
schemaClient.saveSchema(v2);| Type | Description |
|---|---|
JSON |
JSON Schema format |
AVRO |
Apache Avro schema |
PROTOBUF |
Protocol Buffers schema |