Skip to content
TriedDocs
Conversation flow

Components

Reusable subflows. Build a sequence of nodes once, run it from component nodes in one or many flows, and keep shared copies in sync through the library.

A component is a reusable subflow: a small flow with its own nodes, a Begin tag and one or more Exit nodes. A Component node in a flow runs the subflow from its start, and when the subflow reaches an Exit, the flow continues along the component node's own transitions.

Use components for sequences you repeat: collecting an address, verifying identity, taking a message, a compliance disclosure.

The component editor with a Begin tag, a Start node and an Exit node

Local and library components#

Local component Library component
Stored in The flow's components[] The workspace library (/create-conversation-flow-component)
Badge in the editor This flow only Shared library
Used by Component nodes in this flow Component nodes in any flow
Versioned With the flow Own version number, shown as v0, v1 ...

Create a component#

  1. In the flow builder's left column, open the Subflows tab.
  2. Under COMPONENTS, click + ("New component in this flow") for a local component, or the library icon ("New shared library component") for a library component.
  3. The component editor opens full screen with a Start conversation node, an Exit node and a Done transition between them.
  4. Add nodes from ADD NODE: Conversation, Function, Code, Call Transfer, Logic Split, Extract Variables, Send SMS, End and Exit. Click a node to edit it in the same settings panel as the main canvas.
  5. Rename the component in the name box and click Save component.

Saving warns "Add a Component Exit node so the subflow can hand control back." when there is no Exit, and refuses to save an Extract Variables node with an unnamed variable.

Use a component in a flow#

  1. Add a Component node from the node list.
  2. In Node settings, pick the Component. Local components come first; library components show "(library)". Picking a library component turns on Sync with library.
  3. Open jumps into the component editor.
  4. Add transitions on the component node. They are evaluated when the subflow reaches an Exit. New component nodes start with an Else edge.
Field Type Description
component_id string The component to run
sync boolean true: always use the latest library version. false: use the copy stored in this flow
edges, else_edge Followed after the subflow exits

Publish a local component to the library#

In the editor of a local component, Add to library copies it into the shared library. The flow's component nodes that used the local copy are pointed at the new library entry with Sync with library on. Saving a library component shows "Library component saved. Synced flows use it on their next call."

Component fields#

Field Type Description
component_id string component_...
name string
start_node_id string or null Where the subflow starts (the Begin tag)
nodes array of nodes Any node types, including component_exit
tools array of tools with tool_id Functions used inside the component
begin_tag_display_position {x, y}

Library entries also carry version, last_modification_timestamp and linked_conversation_flow_ids (on get).

How components run#

Before a call starts, the engine flattens every component node:

  • The component node becomes a pass-through step that goes straight to the subflow's start.
  • Each subflow node gets a namespaced id, <component node id>::<node id>, so the same component can be used several times.
  • Each Exit node takes over the component node's transitions and else edge.
  • The component's tools are added to the flow's tools unless a tool with the same tool_id exists.
  • Global node settings inside the component are dropped.
  • Components can contain component nodes, up to 5 levels deep.

A component node whose component cannot be found becomes a dead end, and the call stays there.

In call logs and test output, node ids inside a component appear in the namespaced form.

Test a component on its own#

Test subflow in the component editor opens a test panel that starts at the component's Begin node: "Testing this component on its own: the chat starts at its first node." It offers Test LLM, Simulate and Mocks. Unsaved changes are saved before each test. Reaching the Exit shows "Subflow finished: reached the component exit".

Testing a component on its own in the component editor

Through the API, pass start_component_id to POST /agent-playground-completion/:agent_id or POST /agent-playground-simulation/:agent_id.

Delete#

Delete a local component from the Subflows list (component nodes using it stop working until you pick another). A library component that flows still use cannot be deleted through the API without ?force=true; the API answers 409 and lists the flows.