Class GenkitFlowController

java.lang.Object
com.google.genkit.plugins.spring.GenkitFlowController

@RestController public class GenkitFlowController extends Object
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 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 execute
      input - the input data for the flow
      Returns:
      the flow execution result