Agents, Workflows & Multi-Agent Teams
The three modules that do the actual work in Derbee Studio — what each one is, how it executes, and when to reach for which.
Overview
Read this first — it explains why there are three modules instead of one.
Every other module in Derbee Studio is something an agent uses: a knowledge base it reads, a template it follows, a guardrail it obeys, a model it calls. These three modules are different — they are the things that actually run. They form a stack, and each layer exists because the layer below it stops being enough at a certain level of complexity.
An Agent is one reasoning unit. Give it a model, a knowledge source, some prompt templates and a guardrail, and it can take a question, work out what is being asked, gather what it needs, and answer. For a very large class of problems — support Q&A, document lookup, a bot that calls two or three tools — a single agent is the entire solution, and adding anything more would only be overhead.
A Workflow is the plan an agent runs inside one turn. Agents reason well but improvise the order of their work. When the order matters — extract these fields, then look them up, then score the result, then shape it to this exact schema — you stop describing the outcome and start describing the steps. A workflow is that list of steps, with real dependencies, parallel branches, retries and error policies.
A Multi-Agent Team is a graph of agents plus control-flow blocks. One agent with one long instruction degrades as you pile on responsibilities: the prompt grows, the persona blurs, and the model starts dropping requirements. A team splits the job across specialists — each with its own model, instruction and tools — and adds the machinery to route between them: conditions, loops, variables, code, and human approval gates.
How they fit together
What lives inside an agent, and how an agent becomes one node in a team graph.
Choosing between them
Start at the top of this table and stop at the first row that matches what you need.
| Use | When | Signals you have outgrown it |
|---|---|---|
| Agent alone | One subject area, one persona, an answer that can be reasoned out in a single pass | The order of operations keeps coming out wrong, or the output schema drifts |
| Agent + Workflow | The work is a repeatable pipeline — parse, look up, score, reshape, write | The instruction needs several conflicting personas, or a step needs a human to approve it |
| Team | Distinct roles, branching, iteration over a collection, or an approval gate | Nothing above — this is the top of the stack |
Modules
Agents
An Agent is a configured, addressable AI entity. It owns a model, a set of prompt templates, one knowledge source, optional tool bindings, a guardrail and a set of policies. Once saved it can be called from Chat, from an API key, from a channel, from a schedule, or as a node inside a team — and it behaves identically through every one of those doors.
What makes an agent more than a prompt is that the platform owns the plumbing. You never write retrieval code, tool-calling loops, token accounting or safety checks. You declare what the agent knows and how it should behave; the runtime handles classification, retrieval, tool execution, guardrail enforcement, streaming and logging on every single turn.
Anatomy of an agentEvery turn runs as a state machine, not a single prompt. Each stage below is a real node with its own inputs, outputs and routing rules — which is why an agent run is traceable step by step rather than a black box.
- Per-tenant concurrency limiting with FIFO queueing
- Session-scoped MCP connections, closed at turn end
- Single-flighted connects shared across parallel steps
- Pre-flight token estimation before each model call
- A faster utility model for classification and planning
- Checkpointed graph state with TTL cleanup
- Streamed output with mid-stream stop
- Per-run cost, token and latency capture
Workflows
A Workflow is an ordered plan of discrete actions that runs inside a single agent turn. Where an agent decides what to say, a workflow decides what happens before it says it — and in what order, with what dependencies, and what to do when a step fails.
Workflows are standalone records, not fields on an agent. That means one pipeline can be reused by several agents, versioned independently, and bound to a specific template so it only runs for the kind of request it was built for. A workflow also carries its own model and resource bindings, so it can run on its own without an agent wrapped around it.
Three authoring modesEvery step, in every mode, is the same shape. These fields are what make a workflow a pipeline rather than a list.
Each completed step publishes its output under its stepId. Any later step reads earlier outputs by naming them in inputs or fieldsFrom — there is no implicit global state to reason about, which is what keeps a large pipeline debuggable.
Two special values let a step inherit from the matched template instead of repeating it: from_template_task supplies a scoring rubric, and from_template_outputFormat supplies an output schema. Change the template and every step that references it follows.
- extract_keys — pull fields by dot path
- embed_fields — vectorise field values
- rag_search — vector search a KB or collection
- llm_generate — generate from template or instruction
- image_generate — text-to-image, local Ollama
- score — grade against a rubric
- transform_json — reshape to a schema
- conditional — branch on an expression
- mcp — plan and run MCP tools
- api_registry — call a REST endpoint
Full configuration for each type is in the reference tables at the end of this page.
Multi-Agent Teams
A Team is a graph you draw on a canvas. Some nodes are agents; the rest are control-flow and data blocks that decide which agent runs next and what it receives. The whole graph executes as a state machine, so the wiring owns control flow and a shared run context owns the data — the two never get tangled.
An agent node either references an agent you already built, or carries its own inline model, instruction and tool bindings. Either way it executes through the same agent runtime described above, which means a team never re-implements what an agent already does: guardrails, retrieval, tool loops and tracing all behave identically inside a team node.
Orchestration strategiesThe supervisor chooses from the agents wired to it, using only their name and description — so those two fields do real work. Before it chooses, the roster passes through a deterministic capability filter: an agent whose name, role or instruction marks it as a category specialist — a web scraper, an email composer — is dropped from the roster when the query carries none of that category's signals. An agent matching no category is always kept, so the filter only ever removes clearly irrelevant specialists. Three decision styles are then available per node:
Seventeen block kinds, in four families. Agent blocks think; data blocks move and reshape values; control blocks decide and repeat; structural blocks bound the graph.
The canvas checks the whole graph before you can run it, and reports errors and warnings against the specific node. The checks that catch the most real mistakes:
- Cycles — use a loop block instead
- Supervisors may only dispatch to agent nodes
- Workers not wired to the supervisor can never be picked
- Workers with no role or instruction to choose on
- Nodes with no model and no team fallback
- Unreachable nodes in a sequential chain
- Cycles inside a loop body
- Invalid regex, dot paths or JSON field maps
- Missing end node after a data-producing block
- Max steps below 1, or loop iterations above the cap
- sharedContext — one scratchpad or isolated memory
- maxSteps — hard ceiling on supervisor hops
- stopCondition — when the supervisor should finish
- modelId — fallback model for unset nodes
- guardrailId — perimeter input and output gate
- rateLimit — daily invocation ceiling
- Per-tenant team concurrency limiter
- logLevels — trace verbosity, empty means off
- isActive — deactivate without deleting
How They Work — Flow Examples
Five diagrams tracing real execution paths. Each box is a stage the runtime actually has; arrows show where control goes next, and dashed arrows are loops back.
Example 1 — The agent request lifecycle Agents
One turn, end to end. The branch after the input guardrail is the key decision: a workflow-backed turn takes the action engine, a research-backed turn gathers context first, and a simple turn goes straight to generation.
Example 2 — The three workflow authoring modes Workflows
The same pipeline expressed three ways. Linear is a list, DAG is a dependency graph, and dynamic hands the shape of the plan to a planner model at run time.
Example 3 — A DAG workflow, step by step Workflows
A document-scoring pipeline. Two independent lookups run at the same time, both feed one reshaping step, and every step reads earlier output by step id rather than from hidden global state.
Example 4 — A supervisor team in motion Teams
The supervisor dispatches one agent at a time, reads what comes back, and decides again — bounded by max steps. When its stop condition is met it exits to the finish path instead of dispatching.
Example 5 — Control flow inside a team Teams
A sequential team using the non-agent blocks: a condition splits the path, a loop repeats work over a collection, and a human approval gate holds the run before the end block renders the output.
Reference Tables
Every workflow action type and every team block, with the settings that matter most.
Workflow action types
| Type | What it does | Key settings |
|---|---|---|
| extract_keys | Pull specific values out of input JSON using dot-notation paths | sourceField, keys |
| embed_fields | Generate vector embeddings for extracted field values | fieldsFrom, keys |
| rag_search | Vector search a knowledge base, or a custom collection with its own index | knowledgeBaseId or collectionName, query, topK, filter |
| llm_generate | Generate content from a saved template or a custom instruction, over earlier step output | instructionMode, templateId / instruction, inputs, outputSchema |
| image_generate | Produce an image from a text prompt, optionally built by an upstream step. Runs against a locally pulled Ollama image model — macOS only | prompt, inputs, model, size |
| score | Grade data against a rubric and return a score | rubric (or from_template_task), inputs, scoreFormat |
| transform_json | Restructure data by model, by deterministic field map, or by merging inputs | mode, inputs, outputSchema, format |
| conditional | Evaluate an expression over earlier results and route accordingly | expression |
| mcp | Let a tool planner select and run the relevant MCP tools, then return their combined output | mcpRegistryId, query, instruction, inputs |
| api_registry | Call a saved endpoint or an inline URL, with query and body overrides from earlier steps | apiRegistryId or url, method, headers, params, body |
Team block types
| Block | Purpose | Key settings |
|---|---|---|
| Agent blocks | ||
| supervisor | Routes work to the agents wired to it and decides when the run is done | strategy, instructionMode, tools |
| worker | A specialist agent — inline, or a reference to a saved agent | sourceAgentId, role, modelId, tools |
| Data blocks | ||
| llm | A plain prompt with no retrieval or tools | prompt |
| extract | Pull values by JSON path, or by regex, delimiter, line range or split | source, extractMode, paths / pattern |
| transform | Reshape data by model, field map, or passthrough merge | transformMode, inputs, fieldMap / outputSchema |
| aggregator | Merge named variables into one object | inputs, output |
| variable | Set, append to, or increment a named value | varName, op, value |
| template | Render text against current variables, no model call | template |
| code | Run JavaScript or Python, inline or from a relative file | language, sourceMode, body / filePath |
| tool | Invoke one tool directly without an agent deciding to | toolKind, target |
| Control blocks | ||
| condition | Branch on a rule list with true and false handles | rules, logic |
| loop | Repeat child blocks over a collection, a count, or while a condition holds | loopMode, over, itemVar, maxIterations |
| hitl | Pause for human approval before or after a step | hitlTiming, hitlPrompt, hitlTimeout, hitlAutoApprove |
| Structural blocks | ||
| start | Graph entry point | — |
| end | Graph exit — its output template is what the caller receives | output template |
| empty | Placeholder for work in progress | — |
| note | Canvas annotation, never executed | — |