List deployed workflows
List workflow definitions; Workflows coordinates API calls with sequencing, branching, and retries.
Call the Google Cloud REST API with the JDK HTTP client. Requires JDK 17+. Results reflect resources already created in your local project.
Discovery check · reads existing local state.
Save as Hello.java
import java.net.URI;
import java.net.http.*;
import java.time.Duration;
import java.util.Objects;
public class Hello {
public static void main(String[] args) throws Exception {
var project = Objects.requireNonNull(System.getenv("GOOGLE_CLOUD_PROJECT"));
var endpoint = Objects.requireNonNull(System.getenv("SERVICE_USAGE_EMULATOR_HOST"));
var url = URI.create(endpoint.replaceAll("/+$", "") + "/v1/projects/" + project + "/locations/us-central1/workflows");
var request = HttpRequest.newBuilder(url).timeout(Duration.ofSeconds(30)).GET().build();
var client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) {
throw new IllegalStateException(response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
}
} Run the example
java Hello.java Verify the result
The request succeeds. An empty list or no printed rows is valid before matching resources exist. Continue with the documented workflows for a resource test.