Portal Community
What this node does: The FlowAiAgent node embeds a full agentic reasoning loop inside your workflow. You describe a goal in natural language, hand the agent a set of available tools, and the agent autonomously decides which tools to call, in what order, how many times — iterating until the goal is achieved or the maximum turn limit is reached. The agent maintains memory across all turns within a single invocation, produces a chain-of-thought trace, and records every tool call for observability.

How the Reasoning Loop Works

The agent operates a multi-turn think-act-observe cycle. Each turn the model reads the goal, all accumulated context, and the list of available tools, then either calls a tool or declares the goal complete.

Receive Goal Think Choose Tool / Done Execute Tool Observe Result Think (next turn) → … until done

The loop terminates when either the model outputs a final answer (early termination) or the max_turns limit is reached. On early termination the node routes to the success port. On max-turns exhaustion without a final answer the node routes to the error port.

Supported Models

Model IDProviderRecommended Use
claude-opus-4AnthropicComplex multi-step reasoning, high-stakes decisions, long tool chains
claude-sonnet-4AnthropicBalanced capability and speed — default for most business agents
claude-haiku-3-5AnthropicHigh-volume, low-latency simple routing tasks
gpt-4oOpenAIGPT-based workflows, vision-augmented agents
gpt-4o-miniOpenAICost-efficient OpenAI alternative for simpler tasks

Key Capabilities

Business Benefits

Autonomous Customer Query Resolution

Instead of building a rigid branching workflow to handle every possible customer question, deploy an AI agent with tools to look up account data, check order status, query the knowledge base, and send emails. The agent decides which tools are needed for each unique query and composes a coherent response — handling rare combinations of questions without any workflow changes.

Intelligent Document Processing

Give the agent tools to read files, call classification APIs, extract fields, and route to queues. The agent reads an incoming document, classifies its type, extracts relevant fields based on that type, validates them, and routes to the correct downstream process — all in one agentic pass without hand-coded document-type branching.

Multi-Step Data Enrichment

Enrich a lead record by letting the agent call LinkedIn lookup, CRM search, company data APIs, and news feeds — synthesising all results into a single structured enrichment record. The agent handles partial failures gracefully, using whatever data it could retrieve.

Automated Report Generation

Provide tools for querying databases, calling analytics APIs, and writing files. The agent collects the data it needs, runs calculations, and produces a formatted report — adapting its data-gathering strategy dynamically based on what each API returns.

Use Cases at a Glance

Use CaseTools Given to AgentGoal Description
Customer support resolutionlookupAccount, checkOrderStatus, sendEmail"Resolve this customer query: {@ $var.query }"
Lead enrichmentsearchLinkedIn, lookupCRM, updateRecord"Enrich this lead with company and role data"
Intelligent routingclassifyText, lookupQueue, routeRequest"Classify this request and route it to the right queue"
Report generationqueryDB, callAnalyticsAPI, writeReport"Generate the weekly sales summary for region {@ $var.region }"
Exception handlinggetRecord, checkRules, escalate, sendAlert"Handle this payment exception according to company policy"
NL parameter extractionparseIntent, lookupProduct, buildParams"Extract workflow parameters from this user instruction"

In This Guide

Configuration

Full property reference — goal, context, tools, model, max_turns, temperature, system_prompt.

Input & Output

Output ports, data schemas, and example agent responses with tool call traces.

Examples

Four complete examples: customer support, data enrichment, intelligent routing, and report generation.

Token and cost management: Each agent turn consumes tokens proportional to the accumulated context. Set max_turns conservatively (5–10) for production workflows and monitor token usage during testing. Use claude-haiku-3-5 or gpt-4o-mini for high-volume, simpler tasks to control costs. The turns_used output field helps you identify agents that are consistently hitting the turn limit.

How FlowAiAgent Differs from Chat and Prompt Nodes

FeatureFlowAiAgentChat NodePrompt Node
Multi-turn reasoningYes — up to max_turnsSingle prompt-responseSingle prompt-response
Tool invocationYes — full tool use loopNoNo
Chain-of-thought traceYes — full reasoning logNoNo
Autonomous decision makingYesNoNo
Suitable forComplex multi-step goalsSimple Q&A, chat historyText generation, classification
Cost per invocationHigher (multiple turns)LowerLowest

Use the FlowAiAgent node when the task requires the AI to make decisions, call multiple tools, or adapt its plan based on intermediate results. For fixed, single-step text generation or classification, use the Chat or Prompt node instead.

Tool Registry Integration

Tools available to the FlowAiAgent are defined in the BizFirst Tool Registry. Each tool is registered with:

The agent receives all tool descriptions automatically at the start of each invocation. You never need to describe tools inside the system_prompt — doing so wastes tokens and may cause confusion.

Observability tip: The tool_calls output array provides a complete audit trail of everything the agent did. Log this array to your monitoring system on every invocation. When an agent produces unexpected results, the reasoning trace and tool calls are the primary debugging tool — they show exactly what the agent concluded at each step and what data it received.

Production Readiness Checklist