Skip to main content

Building Squads

A squad is a multi-agent workflow. It defines the order in which agents run and how data flows between them. Obi provides a visual editor where you arrange agents on a canvas and connect them with edges to create the execution sequence.

Creating a Squad

  1. Open an app from the sidebar.
  2. Select Squads.
  3. Click Create Squad.
  4. The squad appears in the list. Click on it to open the visual editor.

Using the Visual Editor

The editor shows your workflow as a graph. Each agent is a node, and the connections between them are edges that define the execution order.

Adding Agents to the Canvas

Agents you have created in the app appear as nodes you can place on the canvas. Position them to reflect the flow of your workflow, typically from left to right or top to bottom.

Connecting Agents

To define the order of execution, drag a connection from one agent's output to another agent's input. This creates an edge that tells Obi to run the second agent after the first one finishes.

You can create linear chains (Agent A runs, then Agent B, then Agent C) or branching flows where multiple agents run after a single predecessor.

Edge Logic

Edges can include conditions that control whether the next agent runs. This lets you create workflows that branch based on the output of a previous agent.

Defining Output Variables

A squad can have output variables that capture the final results of the workflow. These are the values you see when an execution completes.

  1. In the squad editor, find the Output Variables panel on the right.
  2. Click Add Output Variable.
  3. Give the variable a key and description.
  4. The variable will be populated during execution based on the agents' outputs.

Running a Squad

You can run a squad directly from the editor.

  1. Open the squad in the visual editor.
  2. Click the Execute button.
  3. Obi creates an execution and begins running the workflow. You are taken to the execution page where you can follow the progress.

You can also run squads automatically using triggers. See Setting Up Triggers for details.

Sub-Workflows

Squads can include other squads as nodes. This allows you to compose complex workflows from smaller, reusable pieces. When a nested squad runs, it executes its entire internal workflow before passing control to the next node.

Editing and Deleting Squads

To edit a squad, select it from the list and make changes in the visual editor. The graph updates automatically as you add, remove, or reconnect nodes.

To delete a squad, select it and use the delete option. Any triggers pointing to the deleted squad will stop creating executions until you reassign them.