Skip to main content

Building an agent

An agent is a flow of steps. It receives data, runs steps in order, and finishes by delivering a result.

Input → Step → Step → … → Result

Every agent's four questions​

QuestionWhere it is answered
What does it receive?The input fields
What does it do?The steps
How does it choose a path?Conditions and switches
What does it return?The Result step

The input fields​

Declare what the agent receives when it is triggered: name, type, whether it is required and, where it makes sense, the valid options.

TypeUse
TextFree-form content
NumberNumeric values
Yes/noBehavior flags
Date and Date and timePeriods and deadlines
Choice from optionsOne value from a closed list
Object and ListStructures coming from another system

The fields you declare become the manual run form, the schedule form, and the contract for whoever calls over HTTP — all three, from the same declaration.

Declare options instead of free text

A choice field avoids the whole class of failures where someone types "Finance" where the condition compares against finance.

The steps​

There are thirteen, in four families:

FamilySteps
DataCall an API · Reshape data · Query corporate data · Run an automation · Prepare data
IntelligenceAI task · Generate with a model
ControlCondition · Choose a path · Combine results · For each item · Wait · Human approval · Call another agent
OutputResult

Each one, with when to use it and what it produces, is in Step types.

The result​

Every agent needs at least one Result step. It is what the API returns to whoever triggered it, and it is where you choose which fields to deliver.

The run finishes successfully the moment a Result completes.

The limits​

Every agent declares three brakes, checked against the space's ceilings at publishing time:

LimitWhat it does
TimeoutThe run's total deadline. Once exceeded, the run ends as expired
Maximum iterationsThe work ceiling for AI steps
Subagent depthHow far the agent-calling-agent chain may go

See Limits.

What publishing checks​

Publishing refuses a structurally broken flow — and the message names the step:

  • every step must be reachable from the start;
  • every step that is not a Result must have an exit;
  • there must be no cycle between steps;
  • there must be at least one Result;
  • a data item can only be referenced by a step that runs after the one producing it;
  • every referenced step must exist.

This is deliberate: a dead end discovered at three in the morning costs far more than a refused deployment now.

In this section​

Next steps​