Skip to main content
Nine multi-agent structures and SwarmRouter take a channel argument. The structure posts the task once, then each member’s contribution under that member’s name, so the channel becomes a readable record of who said what. Every example on this page uses a FileChannel so you can open the result. Replace it with any other channel and the code stays the same:
Give the channel to the structure only. A structure with a channel detaches the channels of its member agents, with a warning, so each message is posted once.

At a glance

SequentialWorkflow

Each agent also reads what the channel already held before the run, so a second run on the same file continues the conversation.

ConcurrentWorkflow

Each agent receives only the task. The channel records the three answers in agent order, not in the order they finished.

AgentRearrange

The channel records User, Planner, Coder, then Reviewer and Tester from the parallel step.

GraphWorkflow

GraphWorkflow posts each node’s output, layer by layer: Analyst, then Writer and Researcher, then Editor. It does not post the task.

MixtureOfAgents

HierarchicalSwarm

The channel records the task, the director’s plan and orders, and each worker’s report under its name. Internal System notes stay out of the channel.

GroupChat

Only messages that win a turn are posted. The private bids each agent makes are not. GroupChat adds the respond tool the agents need to bid.

MajorityVoting

The channel records the task under user, each voter’s answer, then the Consensus-Agent’s verdict.

PlannerWorkerSwarm

The channel records the task, the planner’s plan, each worker’s result under its name, and the CycleJudge verdict.

SwarmRouter

SwarmRouter forwards the channel for these swarm_type values:

Next steps