// The externally facing API allowing users to interact with workflows. edition = "2023"; package workflows.v1; import "buf/validate/validate.proto"; import "google/protobuf/timestamp.proto"; import "tilebox/v1/id.proto"; import "tilebox/v1/query.proto"; import "workflows/v1/core.proto"; import "workflows/v1/resource.proto"; option features.field_presence = IMPLICIT; // A cluster is a grouping of tasks that are related. message Cluster { // 1 is reserved for a potential id field in the future. reserved 1; // The unique slug of the cluster within the namespace. string slug = 2; // The display name of the cluster. string display_name = 3; // A description for the cluster. string description = 6; // Where the cluster is deletable bool deletable = 4; // The workflows that are currently deployed to this cluster. Each workflow will only contain one release, // which is the currently deployed release for that workflow on this cluster. repeated Workflow deployed_releases = 5; } // CreateClusterRequest creates a new cluster. message CreateClusterRequest { // The name of the cluster. string name = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; // A description for the cluster. string description = 2 [(buf.validate.field).string.max_len = 50000]; // An optional cluster slug. If not set, a slug derived from the name will automatically be generated. string slug = 3 [ (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[A-Za-z0-9-]*$" ]; } // GetClusterRequest requests details for a cluster. message GetClusterRequest { // The slug of the cluster to get details for. Empty string requests the default cluster. string cluster_slug = 1 [ (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[A-Za-z0-9-]*$" ]; } // GetClusterRunnerEnvironmentRequest lets runners poll for deployments and environment changes. message GetClusterRunnerEnvironmentRequest { // An active cluster in the caller's namespace. Empty selects the default cluster. string cluster_slug = 1 [ (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[A-Za-z0-9-]*$" ]; } // GetClusterRunnerEnvironmentResponse combines cluster deployments with resolved environment values. // Deployments and values are read separately and may reflect concurrent changes. // Never log or cache this response. message GetClusterRunnerEnvironmentResponse { // Includes deployed releases and artifacts, as in GetCluster. Cluster cluster = 1; // One entry per name, including full secret values. Cluster-specific values win over all-clusters values. // Values are literal strings, without interpolation. Replace the previous environment, even when this list is empty. repeated RunnerEnvironmentVariable environment_variables = 2; } // UpdateClusterRequest updates an existing cluster, by updating all fields that are set to their new values. // If a field is not set, it will not be updated. message UpdateClusterRequest { string cluster_slug = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[A-Za-z0-9-]*$" ]; string name = 2 [ features.field_presence = EXPLICIT, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; string description = 3 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 50000 ]; } // DeleteClusterRequest deletes an existing cluster. message DeleteClusterRequest { // The slug of the cluster to delete. string cluster_slug = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[A-Za-z0-9-]*$" ]; } // DeleteClusterResponse is the response to DeleteClusterRequest. message DeleteClusterResponse {} // ListClustersRequest lists all clusters. message ListClustersRequest {} // ListClustersResponse is the response to ListClustersRequest. message ListClustersResponse { // The clusters. repeated Cluster clusters = 1; } // GetWorkflowRequest requests details for a workflow. message GetWorkflowRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; } // UpdateWorkflowRequest updates an existing workflow, by updating all fields that are set to their new values. // If a field is not set, it will not be updated. message UpdateWorkflowRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; string name = 2 [ features.field_presence = EXPLICIT, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; // Short text summary. Omit to leave unchanged, or set to empty to clear. string summary = 4 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 50000 ]; string description = 3 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 1000000 ]; } // DeleteWorkflowRequest deletes an existing workflow. message DeleteWorkflowRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; } // DeleteWorkflowResponse is the response to DeleteWorkflowRequest. message DeleteWorkflowResponse {} // PublishWorkflowReleaseRequest publishes a new workflow release artifact, and associates it with a workflow. message PublishWorkflowReleaseRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; tilebox.v1.ID artifact_id = 2 [(buf.validate.field).required = true]; ReleaseContent content = 3 [(buf.validate.field).required = true]; } // UnpublishWorkflowReleaseRequest unpublishes a specific workflow release. message UnpublishWorkflowReleaseRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; // The ID of the release to unpublish. tilebox.v1.ID release_id = 2 [(buf.validate.field).required = true]; } // UnpublishWorkflowReleaseResponse is the response to UnpublishWorkflowReleaseRequest. message UnpublishWorkflowReleaseResponse {} // ListWorkflowsRequest lists all workflows owned by the authenticated organization. message ListWorkflowsRequest { // Pagination in descending creation order; the default and maximum limit is 100. tilebox.v1.Pagination page = 1 [features.field_presence = EXPLICIT]; } // ListWorkflowsResponse is the response to ListWorkflowsRequest. message ListWorkflowsResponse { repeated Workflow workflows = 1; // Pagination parameters for the next page, absent when there are no more workflows. tilebox.v1.Pagination next_page = 2 [features.field_presence = EXPLICIT]; } // ListPublicWorkflowsRequest lists workflow summaries shared with every organization in named namespaces. // Releases are available through GetWorkflow; private sharing grants are not included in this listing. message ListPublicWorkflowsRequest { // Pagination in descending creation order; the default and maximum limit is 100. tilebox.v1.Pagination page = 1 [features.field_presence = EXPLICIT]; } // ListPublicWorkflowsResponse is the response to ListPublicWorkflowsRequest. message ListPublicWorkflowsResponse { repeated Workflow workflows = 1; // Pagination parameters for the next page, absent when there are no more workflows. tilebox.v1.Pagination next_page = 2 [features.field_presence = EXPLICIT]; } // CreateWorkflowRequest creates a new workflow. The request can include a workflow slug, which will be used as the // preferred remote reference for the workflow if it's not in use yet. message CreateWorkflowRequest { string name = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; // Portable project slug. Empty derives it from the name (slugify). // Used as the preferred remote reference; collisions add a suffix to the reference only. string project_slug = 4 [ (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*)?$" ]; // short text summary of the workflow to create string summary = 3 [(buf.validate.field).string.max_len = 50000]; // optional longer description of the workflow to create, in markdown format string description = 2 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 1000000 ]; // Whether managed runners must also advertise unscoped task aliases for this workflow. // Omission defaults to true for older clients. Set false explicitly to create a scoped-only workflow. // Scoped task addresses are available regardless of this value. Needed during the migration to scoped task addresses, // and this flag will be retired once all deployed runners support scoped tasks. bool legacy_task_aliases = 5 [features.field_presence = EXPLICIT]; } // Workflow represents a logical grouping for a set of tasks. It can have multiple releases, each comprising a different // set of tasks. message Workflow { // The immutable workflow ID used to scope task identifiers. Only used to resolve TaskIdentifier.workflow_id for // scoped tasks in the runner. Not used for user-facing addressing, which is always by workflow reference. tilebox.v1.ID id = 1; // Allocated remote address: owner-local, or namespace:reference for another namespace's workflow. // Public listings always qualify references. Pass this value to workflow_reference request fields. string reference = 2; // Portable, non-unique project slug. Use reference to address a remote workflow. string project_slug = 8; string name = 3; // short text summary of the workflow string summary = 6; // optional longer description of the workflow, in markdown format string description = 4; repeated WorkflowRelease releases = 5; // additional presentation metadata for public workflows, to display in the public workflow gallery. WorkflowPresentation presentation = 7; // Whether managed runners must advertise unscoped task aliases in addition to workflow-scoped addresses. // Unscoped task aliases must not conflict with other deployed task addresses on the same cluster. bool legacy_task_aliases = 10 [features.field_presence = EXPLICIT]; } // WorkflowPresentation is an extended metadata message for a workflow, providing additional presentation properties // for a public workflow. message WorkflowPresentation { string image_url = 1; string image_alt = 2; repeated string imagery_type = 3; // e.g. "optical", "radar", "hyperspectral", "thermal", "atmosphere" repeated string use_case = 4; // e.g. "mosaic", "change-detection", "object-detection" repeated string dataset_label = 5; // e.g. "Sentinel-2 L2A ยท 10 m" } // WorkflowRelease represents an immutable release of a workflow, which includes a set of tasks and an artifact. // Cluster deployment manifests omit deleted releases and workflows the caller can no longer read. message WorkflowRelease { tilebox.v1.ID id = 1; Artifact artifact = 2; ReleaseContent content = 3; google.protobuf.Timestamp created_at = 4; repeated Cluster clusters = 5; // List of clusters that the workflow is published to } // Artifact represents the artifact associated with a workflow release, // which is the file that contains the code and dependencies needed to execute the tasks in the release. message Artifact { tilebox.v1.ID id = 1; string digest = 2 [(buf.validate.field).string.pattern = "^[a-f0-9]{64}$"]; } // ReleaseContent represents the content of a workflow release, which is the set of files that are included, // the list of task identifiers, and the command to start a worker runtime for executing the tasks in the release. // The fingerprint is a hash of the release content. message ReleaseContent { // A fingerprint of the release content, which is a hash of the task identifiers, files, runner object path, // command override, and build config. Computed by the client for idempotent builds. string fingerprint = 1 [(buf.validate.field).string.pattern = "^[a-f0-9]{64}$"]; // Unbound task definitions included in the release artifact, without workflow IDs in both requests and responses. // The managed runner binds them to the owning workflow when advertising capabilities; release content stays unbound. repeated UnboundTaskIdentifier tasks = 2 [(buf.validate.field).repeated.min_items = 1]; // List of files/directories included in the release artifact. repeated Path files = 3; // The python module/object path to the runner instance, e.g. "my_module.my_runner:runner". string runner_object_path = 4; // A custom command override for starting a worker runtime. This is optional, and if not set defaults to // "uv run python -m tilebox.workflows.runner ". This allows users to specify a custom command // for starting the worker runtime, e.g. to set environment variables or use a different entrypoint. repeated string command_override = 5; // Build rules used for this release, relative to its build root. BuildConfig build_config = 6; } // BuildConfig preserves the build rules needed to rebuild a project from a release. message BuildConfig { // File patterns to include, relative to the build root. repeated string include = 1; // File patterns to exclude, relative to the build root. repeated string exclude = 2; // Whether to apply Git ignore rules. Omitted means true. bool use_gitignore = 3 [features.field_presence = EXPLICIT]; } // Path represents a file or directory path in the release content. If it is a directory, it can have child paths. message Path { string path = 1; bool directory = 2; repeated Path children = 3; } // DeployWorkflowReleaseRequest deploys a workflow release to a set of clusters, making the tasks available for // execution on those clusters. message DeployWorkflowReleaseRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; tilebox.v1.ID release_id = 2; repeated string cluster_slugs = 3 [ (buf.validate.field).repeated.min_items = 0, (buf.validate.field).repeated.items.string.min_bytes = 1, (buf.validate.field).repeated.items.string.max_len = 100, (buf.validate.field).repeated.items.string.pattern = "^[A-Za-z0-9-]*$" ]; } // DeployWorkflowReleaseResponse is the response to DeployWorkflowReleaseRequest, // containing the deployed release and the new state of all the clusters it was deployed to. message DeployWorkflowReleaseResponse { WorkflowRelease release = 1; repeated Cluster clusters = 2; } // UndeployWorkflowReleaseRequest undeploys a workflow release from a set of clusters, making it no longer available // for execution on those clusters. When release_id is omitted, all releases of the workflow deployed on the target // clusters are removed. message UndeployWorkflowReleaseRequest { // The unique workflow reference, potentially suffixed, and potentially namespace-qualified remote reference, which // acts as the unique external identifier for a workflow. // e.g. `my-worklow`, `my-workflow-AGimUihHGGahtT`, or `other-namespace:my-workflow`. string workflow_reference = 1 [ (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 201, (buf.validate.field).string.pattern = "^([a-z0-9]+(-[a-z0-9]+)*:)?[A-Za-z0-9-]{1,100}$", (buf.validate.field).cel = { id: "workflow_reference.namespace_length" message: "workflow namespace must be at most 100 characters" expression: "!this.contains(':') || this.split(':')[0].size() <= 100" } ]; // The optional ID of the release to undeploy. When omitted, all deployed releases of the workflow are removed. tilebox.v1.ID release_id = 2; repeated string cluster_slugs = 3 [ (buf.validate.field).repeated.min_items = 0, (buf.validate.field).repeated.items.string.min_bytes = 1, (buf.validate.field).repeated.items.string.max_len = 100, (buf.validate.field).repeated.items.string.pattern = "^[A-Za-z0-9-]*$" ]; } // UndeployWorkflowReleaseResponse is the response to UndeployWorkflowReleaseRequest and contains the new cluster state. message UndeployWorkflowReleaseResponse { // The undeployed release when exactly one release was removed. The response may contain only its ID. WorkflowRelease release = 1; repeated Cluster clusters = 2; } // A service for managing workflows. service WorkflowsService { rpc CreateCluster(CreateClusterRequest) returns (Cluster); rpc GetCluster(GetClusterRequest) returns (Cluster); rpc GetClusterRunnerEnvironment(GetClusterRunnerEnvironmentRequest) returns (GetClusterRunnerEnvironmentResponse); rpc UpdateCluster(UpdateClusterRequest) returns (Cluster); rpc DeleteCluster(DeleteClusterRequest) returns (DeleteClusterResponse); rpc ListClusters(ListClustersRequest) returns (ListClustersResponse); rpc CreateWorkflow(CreateWorkflowRequest) returns (Workflow); rpc ListWorkflows(ListWorkflowsRequest) returns (ListWorkflowsResponse); rpc ListPublicWorkflows(ListPublicWorkflowsRequest) returns (ListPublicWorkflowsResponse); rpc GetWorkflow(GetWorkflowRequest) returns (Workflow); rpc UpdateWorkflow(UpdateWorkflowRequest) returns (Workflow); rpc DeleteWorkflow(DeleteWorkflowRequest) returns (DeleteWorkflowResponse); rpc PublishWorkflowRelease(PublishWorkflowReleaseRequest) returns (WorkflowRelease); rpc UnpublishWorkflowRelease(UnpublishWorkflowReleaseRequest) returns (UnpublishWorkflowReleaseResponse); rpc DeployWorkflowRelease(DeployWorkflowReleaseRequest) returns (DeployWorkflowReleaseResponse); rpc UndeployWorkflowRelease(UndeployWorkflowReleaseRequest) returns (UndeployWorkflowReleaseResponse); }