MCPcopy Create free account
hub / github.com/The-Pocket/PocketFlow-Go / InternalRun

Method InternalRun

pocketflow.go:526–546  ·  view source on GitHub ↗

InternalRun implements the retry logic at the item level within Exec.

(ctx *PfContext)

Source from the content-addressed store, hash-verified

524
525// InternalRun implements the retry logic at the item level within Exec.
526func (bn *BatchNode) InternalRun(ctx *PfContext) (string, error) {
527 prepRes, err := bn.Prep(ctx) // prepRes should be []any
528 if err != nil {
529 return "", newPocketFlowError(fmt.Sprintf("Prep phase failed in %T", bn), err)
530 }
531
532 // Exec handles its own item-level retry/fallback
533 execRes, err := bn.Exec(ctx, prepRes) // execRes should be []any
534 if err != nil {
535 // Error from Exec already includes context about retries/fallbacks
536 return "", err // Don't wrap again
537 }
538
539 // Post phase
540 action, err := bn.Post(ctx, prepRes, execRes) // Post expects []any, []any
541 if err != nil {
542 return "", newPocketFlowError(fmt.Sprintf("Post phase failed in %T", bn), err)
543 }
544
545 return action, nil
546}
547
548// --- Flow ---
549

Callers 1

RunMethod · 0.95

Calls 4

PrepMethod · 0.95
ExecMethod · 0.95
PostMethod · 0.95
newPocketFlowErrorFunction · 0.85

Tested by

no test coverage detected