PlanRunner

org.llm4s.agent.orchestration.PlanRunner
See thePlanRunner companion object
class PlanRunner(maxConcurrentNodes: Int)

Executes DAG plans with topological ordering and parallel execution.

Value parameters

maxConcurrentNodes

Maximum number of nodes that can execute in parallel (default: 10). Used to prevent resource exhaustion in large DAGs. Follows LLM4S patterns:

  • Uses AsyncResult[_] (Future[Result[_]]) for async operations
  • Structured logging with MDC context
  • Proper error types from OrchestrationError
  • Result.safely for exception handling
  • Standard Future combinators

Attributes

Note

MDC context is preserved across async boundaries using MDCContext utility.

Supports cancellation via CancellationToken for long-running operations.

Example
val runner = PlanRunner(maxConcurrentNodes = 5)
val token = CancellationToken()
val result = runner.execute(plan, Map("input" -> data), token)
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def execute(plan: Plan, initialInputs: Map[String, Any], cancellationToken: CancellationToken)(implicit ec: ExecutionContext): AsyncResult[Map[String, Any]]

Execute a plan with the given initial inputs

Execute a plan with the given initial inputs

Value parameters

cancellationToken

Optional token for cancelling execution

ec

Execution context for async operations

initialInputs

Map from node ID to input value

plan

The execution plan

Attributes

Returns

AsyncResult with final results from all exit points