ConcurrentWorkflowBuilder class final

Fluent builder for concurrent agent workflows: a fan-out start that broadcasts the incoming messages to every participating agent, a per-agent accumulator that batches each agent's outgoing messages, and a fan-in aggregator that reduces them into a single output list.

When no explicit output designations are made, the default is the Python-aligned shape: the terminal aggregator is the workflow output, and every participating agent (plus its per-agent accumulator) is designated as an intermediate output source. Calling withOutputFrom or withIntermediateOutputFrom at all suppresses these defaults.

Inheritance

Constructors

ConcurrentWorkflowBuilder(Iterable<AIAgent> agents)
Creates a ConcurrentWorkflowBuilder with the given participating agents.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyMetadata(WorkflowBuilder builder) → void
Applies the optional name and description to builder. Intended for subclasses, which should call this from their build() implementation.
inherited
applyOutputDesignations(WorkflowBuilder builder, Map<String, String> agentExecutorIds, String orchestrationKind, void applyDefaults()) → void
Applies the user's memoized output designations to builder, or invokes applyDefaults if the user made no explicit designation.
inherited
build() → Workflow
Builds the configured concurrent workflow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withAggregator(List<ChatMessage> aggregator(List<List<ChatMessage>> lists)) → ConcurrentWorkflowBuilder
Sets the aggregator function. If not called, defaults to returning the last message from each agent that produced at least one message.
withDescription(String description) → ConcurrentWorkflowBuilder
Sets the description for the workflow.
inherited
withIntermediateOutputFrom(Iterable<AIAgent> agents) → ConcurrentWorkflowBuilder
Designates the given agents as sources of intermediate workflow output. See withOutputFrom for the defaults-suppression semantics.
inherited
withName(String name) → ConcurrentWorkflowBuilder
Sets the human-readable name for the workflow.
inherited
withOutputFrom(Iterable<AIAgent> agents) → ConcurrentWorkflowBuilder
Designates the given agents as sources of terminal workflow output.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited