Agents
Pipeline Validation

Pipeline Validation

Before an agent can be activated or invoked, almyty validates its pipeline to ensure correctness. Validation runs automatically when saving an agent and can be triggered manually via the API.

Validation Rules

Structural Rules

RuleDescription
Single InputExactly one Input node must exist
Single OutputExactly one Output node must exist
No CyclesThe pipeline must be a directed acyclic graph (DAG)
Connected GraphAll nodes must be reachable from the Input node
Output ReachableThe Output node must be reachable from at least one path

Node Configuration Rules

Node TypeRequirement
InputMust have a valid JSON Schema in data.schema
OutputMust have a non-empty data.mapping expression
LLM CallMust have providerId and userPromptTemplate
Tool CallMust have toolId referencing an existing tool
ConditionMust have a non-empty expression
TransformMust have non-empty code
LoopMust have iterableExpression
Sub-AgentMust have agentId referencing an existing agent

Expression Validation

Template expressions ({{...}}) are checked for:

  • Valid syntax — Properly closed double curly braces
  • Valid references — Referenced node IDs must exist in the pipeline
  • Upstream dependency — Referenced nodes must be upstream (executed before) the current node
  • No self-reference — A node cannot reference its own output

Validation API

# Validation happens on save — errors are returned in the response
curl -X PATCH https://api.almyty.com/agents/{id} \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "pipeline": { ... }
  }'

If validation fails, the response includes detailed errors:

{
  "success": false,
  "message": "Pipeline validation failed",
  "errors": [
    {
      "nodeId": "llm_1",
      "field": "providerId",
      "message": "LLM provider is required"
    },
    {
      "nodeId": null,
      "field": "structure",
      "message": "No Output node found in pipeline"
    }
  ]
}

Common Issues

Disconnected Nodes

If you add a node but forget to connect it with edges, validation will report it as unreachable. Fix by adding edges from an upstream node to the disconnected node.

Circular Dependencies

Pipelines must be acyclic. If node A depends on node B and node B depends on node A, validation fails. Use Loop nodes instead for iterative processing.

Missing Provider

LLM Call nodes require a valid providerId. If the referenced provider has been deleted or is inactive, validation will flag it. Navigate to AI Models to configure a provider first.

Invalid Template Expressions

// Bad — references a non-existent node
{{nodes.nonexistent.output}}

// Bad — references a downstream node (not yet executed)
{{nodes.output_1.output}}  // Output is always the last node

// Good — references an upstream node
{{nodes.llm_1.output}}

UI Validation Indicators

In the visual agent builder, validation issues are displayed as:

  • Red border on nodes with configuration errors
  • Warning icon on edges with expression issues
  • Error panel at the bottom listing all validation problems

Fix all issues before activating the agent. Draft agents can be saved with validation warnings but cannot be activated or invoked.