Class ExecutionController
java.lang.Object
ai.nervemind.app.api.ExecutionController
REST API controller for workflow executions.
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionController(ExecutionService executionService) Constructs a new ExecutionController. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> Cancels a running workflow execution.CompletableFuture<ai.nervemind.common.dto.ExecutionDTO> executeWorkflow(Long workflowId, Map<String, Object> input) Triggers an asynchronous workflow execution.ai.nervemind.common.dto.ExecutionDTOexecuteWorkflowSync(Long workflowId, Map<String, Object> input) Triggers a synchronous workflow execution.List<ai.nervemind.common.dto.ExecutionDTO> findAll()Retrieves all workflow executions.org.springframework.http.ResponseEntity<ai.nervemind.common.dto.ExecutionDTO> Retrieves a specific workflow execution by ID.List<ai.nervemind.common.dto.ExecutionDTO> findByWorkflowId(Long workflowId) Retrieves all executions for a specific workflow.List<ai.nervemind.common.dto.ExecutionDTO> Retrieves all currently running workflow executions.
-
Constructor Details
-
ExecutionController
Constructs a new ExecutionController.- Parameters:
executionService- the execution service to use
-
-
Method Details
-
findAll
Retrieves all workflow executions.- Returns:
- list of all executions
-
findById
@GetMapping("/{id}") public org.springframework.http.ResponseEntity<ai.nervemind.common.dto.ExecutionDTO> findById(@PathVariable Long id) Retrieves a specific workflow execution by ID.- Parameters:
id- the execution ID- Returns:
- the execution if found, or 404
-
findByWorkflowId
-
findRunning
Retrieves all currently running workflow executions.- Returns:
- list of currently running executions
-
executeWorkflow
@PostMapping("/run/{workflowId}") @ResponseStatus(ACCEPTED) public CompletableFuture<ai.nervemind.common.dto.ExecutionDTO> executeWorkflow(@PathVariable Long workflowId, @RequestBody(required=false) Map<String, Object> input) Triggers an asynchronous workflow execution.- Parameters:
workflowId- the workflow to executeinput- optional input data- Returns:
- future with the execution result
-
executeWorkflowSync
@PostMapping("/run/{workflowId}/sync") public ai.nervemind.common.dto.ExecutionDTO executeWorkflowSync(@PathVariable Long workflowId, @RequestBody(required=false) Map<String, Object> input) Triggers a synchronous workflow execution.- Parameters:
workflowId- the workflow to executeinput- optional input data- Returns:
- the execution result
-
cancel
-