MCPcopy Create free account
hub / github.com/astercloud/aster / GetExecutionDetails

Method GetExecutionDetails

server/handlers/workflow.go:453–483  ·  view source on GitHub ↗

GetExecutionDetails retrieves a single execution

(c *gin.Context)

Source from the content-addressed store, hash-verified

451
452// GetExecutionDetails retrieves a single execution
453func (h *WorkflowHandler) GetExecutionDetails(c *gin.Context) {
454 ctx := c.Request.Context()
455 executionID := c.Param("eid")
456
457 var execution WorkflowExecution
458 if err := (*h.store).Get(ctx, "workflow_executions", executionID, &execution); err != nil {
459 if errors.Is(err, store.ErrNotFound) {
460 c.JSON(http.StatusNotFound, gin.H{
461 "success": false,
462 "error": gin.H{
463 "code": "not_found",
464 "message": "Execution not found",
465 },
466 })
467 return
468 }
469 c.JSON(http.StatusInternalServerError, gin.H{
470 "success": false,
471 "error": gin.H{
472 "code": "internal_error",
473 "message": "Failed to get execution: " + err.Error(),
474 },
475 })
476 return
477 }
478
479 c.JSON(http.StatusOK, gin.H{
480 "success": true,
481 "data": &execution,
482 })
483}
484
485// Suspend suspends a workflow
486func (h *WorkflowHandler) Suspend(c *gin.Context) {

Callers

nothing calls this directly

Calls 4

JSONMethod · 0.80
ContextMethod · 0.65
GetMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected