← All Workflows

💬 Multi-Turn Chat

A persistent chatbot that remembers the entire conversation across ComfyUI queue runs. History is saved to disk as JSON and reloaded automatically — true multi-turn sessions.

Nodes 8
Agents 1
Agent ID chatbot@localhost
Key Feature ChatHistory
ChatHistory × 2 PromptTemplate LLM ToolParser

Pipeline Flow

Load history → add user message → format with PromptTemplate → LLM responds → save response back to history.

Identity
Setup
chatbot@localhost
Load + Add
ChatHistory
session: "my-chat"
Prompt
SystemPrompt
assistant persona
Format
PromptTemplate
{a} = history
Inference
LLM
system + formatted
Parse
ToolParser
extract tools
Display
TextDisplay
show response
Save
ChatHistory
append assistant msg
Load History + Add User Message Generate Response Display + Save to History

Key Features

💾

Persistent Sessions

ChatHistory stores the full conversation as a JSON file in the agent's data directory. Restart ComfyUI, re-queue — the conversation continues exactly where it left off.

🔄

Circular Flow

Two ChatHistory nodes create a loop: the first loads history and adds the user message, the second appends the LLM response. Each queue run is one turn.

🔧

Max Turns Trimming

Configurable max_turns prevents the history from growing unbounded. Old messages are trimmed from the front, keeping the conversation within context limits.