AutoFlow
Workflows

Overview

How Ask Sage Agent Builder workflows are structured and generated.

AutoFlow generates workflows for Ask Sage's Agent Builder — a visual node-and-edge workflow engine. Each workflow is a JSON document containing nodes (processing steps), edges (connections between nodes), and metadata.

Example Workflow

A classification workflow connects nodes like this:

Workflow Structure

{
  "nodes": [
    {
      "id": "intake",
      "type": "llm",
      "position": { "x": 0, "y": 0 },
      "config": {
        "system_prompt": "You are a classifier...",
        "prompt_template": "Classify: {{input.message}}",
        "temperature": 0.0,
        "model": "gpt-4o-mini",
        "max_tokens": 500
      },
      "label": "Classify Input"
    }
  ],
  "edges": [
    {
      "id": "edge_intake_to_router",
      "source": "intake",
      "target": "router",
      "sourceHandle": "out",
      "targetHandle": "in"
    }
  ],
  "metadata": {
    "name": "Email Classifier",
    "tier": 1,
    "pattern": "classification",
    "description": "Classifies incoming emails by category",
    "category": "intelligence",
    "tags": ["email", "classification", "routing"]
  }
}

Key Concepts

Nodes

Each node is a processing step with a type, config, and position. AutoFlow supports 8 node types covering LLM calls, file reading, loops, conditionals, decision trees, and data transforms.

Edges

Edges connect nodes via sourceHandle and targetHandle ports:

  • Standard flow: "out""in"
  • Conditionals: "true"/"false" or "if"/"else""in"
  • Loops: "loop_out" (iteration) and "complete" (done) → "in" or "loop_in"
  • Decision trees: Dynamic category names as handles (e.g., "urgent", "spam") → "in"

Variables

Nodes reference each other's outputs via double-brace syntax: {{node_id.response}}, {{input.message}}, {{loop.item}}.

Metadata

Workflow metadata includes name, description, tier (0-2), pattern type, category, tags, use cases, complexity level, author, and version.

Dive Deeper

On this page