Skip to main content
A conversation in a workflow is made of two different things. Messages are values. A thread is a place. Every component speaks messages, and one component, data.thread, turns the place into a value and back. This page is the whole story; the pages it links hold the details.

Values and places

  • message is the platform’s one piece of content: a role, blocks, attributes (id, created_at) and metadata. Every port that carries content speaks it: a prompt, a query, a scraped page, an answer (Data Types).
  • messages is an ordered list of them: chunks, search results, tools, a few-shot prompt, a history.
  • Both are values. A component reads them from its inputs and writes them to its outputs. A flow keeps one in a data.message or data.messages component, for the execution or in the session, and every write replaces it whole.
  • A thread is not a value but a session’s append-only log. Each item is a message plus what the platform records about its post: id, source, created_at, parent_id and a role. Many parties write to it, every post raises an event, and the conversation widget follows it live (Thread session object).
data.thread is the only component that knows threads. It is also the only way a thread meets a flow:
  • Read, a thread is a messages value, and each message carries its item’s id as attributes.id.
  • Written, a thread appends. A message becomes one item and a messages value one item per message, in order. A message whose attributes.id already names an item of that thread is skipped, so writing back what was read posts only what was added.
No other component has a thread port or a thread mode. A component reads a thread through any input that takes messages, and posts to one through any output that writes a message or messages.

Every component, by its ports

genai.chat answers what was posted. genai.agent.basic is an agent on a conversation: its history output, the history it read plus its turn, posts only its turn, and its event log can post its steps. logic.code serves tool results (Tool Calling) and anything custom, reading with thread_messages(alias) and posting with post_message(alias, message). logic.copy moves messages between places, below. text.render_template renders a conversation as a transcript, and database.vector.ingest indexes one, one item per chunk. web.search posts results to a research log. logic.insert is not needed on a thread: a post is the append. A port typed message, such as current, takes no thread, as it takes no data.messages: on a thread the newest request is already the end of history.

Mixing them

Both sides are values, so a flow mixes them freely. A chat reads a thread and writes its answer to a data.message for a later step. An agent reads a few-shot prompt from a data.messages and posts to a thread. Mixing has one hazard: a component that returns the whole history with its own messages appended would post the history again. The id rule closes it. The history the component read carries its item ids, and only what it added is posted. A chat wired to the same thread on history and output therefore posts only its answer.

Moving between places

A move is a logic.copy between two data components. logic.copy copies its input to its output unchanged, whatever the value. For a messages value it takes the rules a chat applies to its history, roles, skip_roles, anchor, from, to and keep (Selecting a History): from: -10 keeps the last ten. Anything finer, a date or a search, is a logic.code. A copy into a thread appends: messages from another thread or from a value become new items, stamped with the run’s source, and a thread copied into itself posts nothing.

Which to choose

  • A conversation or a log that several parties append to and someone follows is a thread. Ostrava Pumps’ service desk keeps its requests in one: people post through the widget, a chat answers, a logic.code posts tool results.
  • A value a flow computes and replaces is a data.message or data.messages: a plan, a table of answers, retrieved sources, a prompt.
  • A flow that keeps its conversation in a data.messages keeps working. The history it holds is a value, and chat reads it as it reads a thread.