> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating to Threads and Components

> What changed for chat flows, thread items, event names and limits, and what to do about it.

## Language models

Each family of models has a provider of its own, `genai.model.<family>`, and `genai.model` became
`genai.model.language`, the language family's
([Language Model](https://docs.blobhub.io/blob-types/workflow/workflows/component-genai-model-language.md)). The migration rewrote every stored
definition that named it: each component, and each run input entry, in a listener's body or anywhere else in a
definition, now names `genai.model.language`, and so does each run input entry a schedule's `workflow` target holds.

* **An `openai` entry with its own `base_url` became `openai_compatible`.** The `openai` vendor now speaks OpenAI's
  Responses API, while a server of your own speaks Chat Completions, as `openai_compatible` does. In the same
  component, the `model` and each `allowed_models` item that started `openai/` (`openai/*` included) now start
  `openai_compatible/`. A component was left as it was when its `model` or `allowed_models` arrives through a data
  connection, whose ids the migration cannot rename, or when it already held an `openai_compatible` entry: make the
  change by hand ([Vendors and Gateways](https://docs.blobhub.io/blob-types/workflow/workflows/vendors-and-gateways.md)).
* **OpenAI moved to the Responses API.** The settings Responses has no field for, `seed`, `stop_sequences`,
  `frequency_penalty`, `presence_penalty` and `top_k`, are left out of the call with a warning, such as
  `Settings left out: seed (openai has no such setting)`. A migrated OpenAI flow that holds one still runs, without
  it.
* **Chat answers only when there is something to answer.** A `genai.chat` with its history wired and nothing in
  `current` calls no model and writes nothing when the conversation ends with the model's own answer, or is empty: it
  posts a `component.output` whose `attributes.code` is `nothing_to_answer`. A flow that wired an empty history to have
  its system message answered gets no answer ([Chat Component](https://docs.blobhub.io/blob-types/workflow/workflows/component-genai-chat.md)).
* **A refusal is an answer.** A vendor's refusal is written as the answer, with `metadata.finish` `refused` and a
  `component.warning`, and the call ends on `success`: a flow wired to `failure` for refusals no longer takes it.

**Clients that send the old type are refused.** The `model=` and `models=` of the SDK 0.5.0 and the `--model` of the CLI
0.9.0 send `genai.model`, and a run that names a model through them is refused with 400 `invalid_input_data` and writes
nothing: a `*` entry with `"*" is accepted only for genai.model.language`, and an entry naming a provider by its alias
with `genai.model takes no run input; these do: data.message, data.messages, genai.model.language`. Install the SDK
0.6.0 (`pip install blobhub`) and the CLI 0.10.0, the releases that send `genai.model.language`. An entry you write
yourself, in a script or a `create_execution` body, names `genai.model.language` too
([Choosing a Model per Run](https://docs.blobhub.io/blob-types/workflow/workflows/choosing-a-model.md)).

**A local copy** pulled before the migration still names `genai.model`: pull it again before the next deploy.
`blobhub workflow deploy` uploads a changed definition before it checks it, so deploying an old copy writes the old
type back to the revision. The check then fails, and every run of the definition ends with `flow.error`
`Workflow definition check failed`.

## Chat widgets

`widget.chat` is gone. The playground has one conversation widget, `widget.thread`
([Widgets](https://docs.blobhub.io/blob-types/workflow/playgrounds/widgets.md#widget-thread)), and every stored `widget.chat` became one,
keeping its `id`, `name`, `category` and `position`.

| `widget.chat` port | `widget.thread` port |
| :- | :- |
| `history` | `thread`, naming the alias of the history with `-thread` added: `log` becomes `log-thread`, `inbox/history` becomes `inbox/history-thread` |
| `send_message_workflow` | `responder` set to `workflow`, and `workflow` holding the same alias or path; a widget without one gets `responder` set to `none` |
| `user_input` | `request`, naming the same alias |
| `max_messages` | dropped: the thread pages, and a flow that wants a window selects one ([Selecting a History](https://docs.blobhub.io/blob-types/workflow/workflows/selecting-a-history.md)) |
| `predefined_inputs`, `content_view`, `width`, `height` and any other port | kept, in their order |

The new ports `models`, `composer` and `steps` are not written, so their defaults apply: no picker, a composer, and
steps folded. A bare alias in `workflow` still names a definition of the playground's own revision, and the path form
is still accepted.

**A conversation moves from an object to a thread.** The widget used to show a `data.messages` object that the flow
appended to with `logic.insert`. Each session's history was copied into the widget's new thread, one item per message,
with the roles a post maps them to and `source` `{kind: platform}`, so a migrated item shows as "Imported" in the
widget. The old object stays where it was, and a second copy posts nothing: a message already copied is found by its
id. The migration changed the widget, not the flow behind it: a flow that kept its conversation in a `data.messages`
object and appended to it with `logic.insert` is rewritten by hand onto a
[`data.thread`](https://docs.blobhub.io/blob-types/workflow/workflows/component-data-thread), under the alias the widget's `thread` port now
names, the old alias with `-thread` added. A session whose new thread already holds an item that was not copied is
skipped, since an append cannot put old turns before newer ones.

## Thread items

Every thread item now records who or what posted it, and the places that used to carry the same fact in another form
dropped it.

* **Every item has a `source`.** The migration gave each stored item the `source` of its `thread.item_posted` event,
  where the event was still held. An item whose event was gone got one derived from the item: an item Missions wrote
  with `metadata.source` `system` or `session` is `{kind: workflow, user_id, depth: 0}`, a listener's receipt is
  `{kind: listener, user_id, depth: 0}`, and any other is `{kind: api, user_id, client?, depth: 0}`
  ([Thread](https://docs.blobhub.io/blob-types/workflow/session-objects/thread/introduction.md#source)).
* **The `item` block of `thread.item_posted` no longer carries `source`.** The event's own `source` is the item's. A
  filter or a listener `where` that read `item.source` reads `source` instead
  ([Session Events](https://docs.blobhub.io/blob-types/workflow/workflows/session-events.md)).
* **A listener receipt no longer carries `metadata.source`.** Its item's own `source` says the listener posted it. A
  reader that told receipts apart by `metadata.source` reads the role `note`, and the item's `source` is the listener.
  Missions' own `metadata.source` (`system`, `session`, `external`) became `metadata.origin`, with the same values.
* **A post to an empty alias creates the thread.** Writers that created the envelope first keep working, and a writer
  that wants a name or a description on the thread still writes the envelope itself.
* **An item holds up to 256 KiB**, where it held 64 KiB, and every block a message holds: `text`, `json`, `file`,
  `reasoning`, `tool_call`, `tool_result` and `vector`. A longer message is the writer's to split, which
  [`data.thread`](https://docs.blobhub.io/blob-types/workflow/workflows/component-data-thread#write) does by posting parts.

## Components

A workflow node is a **component** everywhere the platform names one. The names below changed together, in event types,
attributes, run state and limits.

| Old | New |
| :- | :- |
| `processor.entered`, `processor.exited`, `processor.output`, `processor.warning`, `processor.error` | `component.entered`, `component.exited`, `component.output`, `component.warning`, `component.error` |
| attributes `processor_id`, `processor_type`, `processor_name` | `component_id`, `component_type`, `component_name` |
| `source.processor_id` | `source.component_id` |
| limit `workflow.processor_runs_per_execution` ("Processor runs") | `workflow.component_runs_per_execution` ("Component runs") |

The limit's refusal reads `This execution reached 1,000 component runs, its limit
(workflow.component_runs_per_execution).`, and a limit override you set on the old id is carried to the new one; where
both ids held an override, the new id's stands.

**Stored records were rewritten.** The execution log's event types and attributes, the `source` of stream events and of
the log's events, and each execution's limits snapshot carry the new names. An execution's `input_data` is left as it
was: a listener run's input holds copies of the events that started it, with the names they had then.

**A saved filter is refused.** The execution log holds `flow.*` and `component.*` events, so a `types` pattern that
matches none of them answers 400 `invalid_input_data`. A filter saved with `processor.*` fails with the message
`filter.types[0]: "processor.*" matches no execution event type`. Change it to `component.*`. A malformed filter still
answers `invalid_filter`. See [List Execution Events](https://docs.blobhub.io/blob-types/workflow/operations/list-execution-events.md).

Read the new types on [Execution Events](https://docs.blobhub.io/blob-types/workflow/workflows/execution-events.md).

## Limits

The limits routes answer `level` where they answered `source`, for each limit of a user, an organization or a blob.
The values are the same: `default`, `platform`, `user`, `org` and `blob`. `blobhub blob limits` prints the column as
`LEVEL`. A script that reads `source` from a limits response reads `level` instead. See
[Get Blob Limits](https://docs.blobhub.io/rest-api/blobs/get-limits.md) and [Limits](https://docs.blobhub.io/general/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.