Package com.google.genkit.plugins.spring
Class GenkitFlowController
java.lang.Object
com.google.genkit.plugins.spring.GenkitFlowController
REST controller that exposes Genkit flows as HTTP endpoints.
This controller dynamically handles requests to flow endpoints based on the registered flows in the Genkit registry.
-
Constructor Summary
ConstructorsConstructorDescriptionGenkitFlowController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates a new GenkitFlowController. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object> executeFlow(String flowName, Object input) Executes a flow by name.health()Health check endpoint.Lists all available flows.
-
Constructor Details
-
GenkitFlowController
public GenkitFlowController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates a new GenkitFlowController.- Parameters:
objectMapper- the ObjectMapper for JSON serialization
-
-
Method Details
-
health
@GetMapping(value="/health", produces="application/json") public org.springframework.http.ResponseEntity<Map<String,String>> health()Health check endpoint.- Returns:
- health status
-
listFlows
@GetMapping(value="/api/flows", produces="application/json") public org.springframework.http.ResponseEntity<Map<String,Object>> listFlows()Lists all available flows.- Returns:
- list of flow names
-
executeFlow
@PostMapping(value="/api/flows/{flowName}", produces="application/json", consumes="application/json") public org.springframework.http.ResponseEntity<Object> executeFlow(@PathVariable String flowName, @RequestBody(required=false) Object input) Executes a flow by name.- Parameters:
flowName- the name of the flow to executeinput- the input data for the flow- Returns:
- the flow execution result
-