Nodes/ComfyUI-Autogen/Autogen Group Chat
ComfyUI Node

Autogen Group Chat

Where your agents finally talk to each other (and the text that comes out feeds your workflow)

By strand1·Created 2 years ago·Updated 2 years ago· 3
Autogen Group Chat
  • agent_1
  • agent_2
  • agent_3
  • agent_4
  • console_output
  • last_chat
task_inputProvide a task description here.
max_messages10
terminate_stringTERMINATE

This is the payoff node. The other three build pieces - a model client, an assistant, a code executor - and AutogenGroupChat is where they all sit down and actually work the task. You give it two or more AGENT wires and a task_input, it runs a round-robin conversation between them, and it hands you the whole transcript plus the final answer as plain strings you can use anywhere downstream.

How it works

Under the hood it builds AutoGen's RoundRobinGroupChat from your agents, with a combined termination condition: MaxMessageTermination (hard cap at max_messages) OR TextMentionTermination (an agent literally writes terminate_string). Then it streams the run. Every message gets captured as source: content - who said what - and the node grabs the last message that isn't the TERMINATE one as the answer.

The key detail for ComfyUI users: this node redirects stdout internally and returns the chat log as a string. So don't go staring at your terminal expecting to see the conversation - the transcript lives in the console_output output.

The inputs that matter

  • agent_1 / agent_2 (required) - the AGENT outputs from your Assistant and Code Executor nodes. agent_3 / agent_4 are optional extras.
  • task_input - the mission, plain text. This drives everything: vague in, meandering chat out. This is the quality lever, not the temperature knob.
  • max_messages (1–100, default 10) - the hard ceiling on messages before AutoGen stops. If an agent forgets to say TERMINATE, this is what saves you.
  • terminate_string (default TERMINATE) - the word an agent must write to end early. It's case-sensitive, and the convention is to include it in your assistant's system message so it knows to use it.

The two outputs are both STRING: console_output is the full multi-agent transcript (save it to a file, preview it), and last_chat is the final substantive answer - the thing you wire into the rest of your workflow, like a prompt node or a text encoder.

Install

Same as every node in this pack - search "ComfyUI-Autogen" in Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/strand1/ComfyUI-Autogen
cd ComfyUI-Autogen
pip install -r requirements.txt

Restart ComfyUI, then build the chain: AutogenModel → AutogenAssistantAgent (and an AutogenCodeExecutor) → AutogenGroupChat.

Common issues

If the chat just runs to max_messages every time, your assistant never learned to say the terminate word - put it in the system message. If you're getting weird agent errors, check names are unique across the chat. And the practical trap: the conversation shows up in console_output, not your terminal or ComfyUI's console, so "nothing happened" is usually "the transcript is in the string I didn't look at." Wire last_chat somewhere visible and you'll see the pipeline come alive.

This pack is small and early - the whole thing is a handful of files, last touched in early 2025, with zero community chatter. It's niche, but for the specific job of running a real AutoGen agent team inside ComfyUI's graph, there isn't much else competing with it.

CategoryAutogen

Inputs (7)

NameTypeDefaultDescription
agent_1AGENT
agent_2AGENT
task_inputSTRINGProvide a task description here.
agent_3optAGENT
agent_4optAGENT
max_messagesoptINT101–100
terminate_stringoptSTRINGTERMINATE

Outputs (2)

NameTypeDescription
console_outputSTRING
last_chatSTRING