Building a Complete AI Agent on a Low-Code Platform: Architecture and Design Practices
This article examines whether a low-code or visual orchestration platform can support a complete AI agent scenario. It breaks agent capabilities into four layers, explains why model integration and single-turn tool calling are straightforward while multi-step planning, state management, and human-in-the-loop governance require an external orchestration service, and walks through four key designs: structured plans, a state machine for pause and resume, product-level confirmation flows, and observability with failure recovery. A reference pseudocode skeleton and selection guidance for prototyping versus production are included.
1. Framing the Problem: What Counts as a “Complete” Agent
The question of whether a low-code or visual orchestration platform can build an agent for a complete scenario looks like a tooling choice on the surface. In practice, it is a debate about where the boundaries of agent capability lie. If an agent is understood only as a question-answering bot that can call tools, then almost any platform with function-calling support qualifies. But if the target is the form described in the original scenario — autonomously planning tools based on the user’s question, explicitly outputting an execution plan, and waiting for user confirmation before executing — then the evaluation shifts from “can it call tools” to “can it express and govern a multi-state execution process that can be interrupted and resumed.”
An agent that can be called “complete” typically has at least six capabilities:
- Intent understanding: mapping a natural-language request to a structured goal;
- Task planning: decomposing the goal into ordered steps and selecting the tool for each step;
- Tool execution: calling external capabilities with correct arguments and parsing the results;
- State management: preserving intermediate artifacts, completed steps, and failure information across a long flow;
- Human-in-the-loop collaboration: pausing at key points, presenting the plan, and receiving confirmation or修改 feedback;
- Observability and rollback: logging the input and output of every step, supporting root-cause analysis and retry.
The original requirement lands squarely on items 2, 4, and 5 — exactly the areas where most visual orchestration platforms are relatively weak. So the answer is neither a simple “yes” nor “no”: the backbone can be built, but closing the loop requires additional design.
2. Capability Layers: What Platforms Do Well and What They Don’t
Splitting the agent into four layers makes the boundaries much clearer.
Layer 1: Model integration and prompt engineering. This is the most mature part of visual platforms. Connecting a large language model, configuring the system prompt, setting temperature and context window, and binding knowledge-base retrieval are all out-of-the-box capabilities. The “tell the user its execution plan” behavior mentioned in the original text is essentially having the model first emit a piece of structured text, which this layer fully covers.
Layer 2: Single-turn tool calling. Platforms generally support declaring a tool’s name, description, and parameter schema in a configuration-driven way (usually JSON Schema), with the model deciding which tool to call and what arguments to pass. An illustrative tool declaration:
{"name": "query_order_status","description": "Query the current fulfillment status by order ID","parameters": {"type": "object","properties": {"order_id": { "type": "string" }},"required": ["order_id"]}}
Layer 3: Multi-step planning and state transitions. This is the dividing line. Real planning requires “think first, then act,” and the plan itself must be a first-class object that can be reviewed and modified. Most platforms use static orchestration: the wiring is fixed at design time, and at runtime data simply flows along a fixed path. The model can influence branch conditions but cannot actually change the topology. Breaking past this usually requires constraining the output format at the prompt layer and then handing off to an external state machine.
Layer 4: Human-in-the-loop collaboration and long-flow governance. This includes interrupt-and-wait, permission checks, audit trails, and failure compensation. This layer often exceeds what a visual canvas can express and needs to be filled in by external services.
Conclusion: Layers 1 and 2 can be built directly; Layers 3 and 4 require a combined architecture of “platform + external orchestration service.”
3. Key Design 1: Make the Plan a Structured Object
“Outputting an execution plan” cannot rely on free text, otherwise it cannot be validated, rendered, or replayed. The model should be constrained to return a parseable structure, for example:
{"goal": "Verify and update the customer order status","steps": [{"id": 1, "tool": "query_order_status", "args": {"order_id": "A123"}, "reason": "Confirm the current status"},{"id": 2, "tool": "update_crm_note", "args": {"order_id": "A123"}, "reason": "Sync the conclusion"}],"risk": "Write operation, requires human confirmation"}
With this structure in place, three things become possible: rendering the plan as a user-readable checklist; validating argument completeness and permissions before rendering; and persisting the plan as the basis for later resumption. The prompt should explicitly require that “no write-type tool may be called before confirmation is granted” — a security bottom line that must be a hard constraint.
4. Key Design 2: Use a State Machine to Handle Interruption and Recovery
User confirmation means the flow must be able to stop and remember where it stopped. A purely request-response conversational chain cannot naturally carry this, so explicit state must be introduced:
class PlanState:status: str # draft / pending_confirm / running / paused / done / failedplan: list # structured stepscursor: int # which step is currently executingartifacts: dict # intermediate artifacts, such as query resultshistory: list # input, output, and duration of each step
Keep the transition rules minimal: draft → pending_confirm → running → done, where running can move to failed or paused if any step fails. A user reply of “confirm” triggers pending_confirm → running; a reply of “skip step 2” modifies plan first and then transitions. State must be stored externally (such as a cache service or database) so the session can continue after a process restart — a prerequisite for long-flow reliability.
5. Key Design 3: Product-Grade Handling of the Confirmation Step
Confirmation is not a simple boolean check; it requires designing interaction details:
- Diff-based confirmation: show “what will be executed, which data is affected, and whether it is reversible,” rather than only listing tool names;
- Editable plan: allow users to delete or replace steps, with the model replanning accordingly instead of throwing an error;
- Tiered granularity: auto-approve read operations, and force confirmation for write operations and operations with external side effects, to avoid confirmation fatigue;
- Timeout policy: if confirmation does not arrive within a long window, archive the state and release resources to prevent dangling sessions from piling up.
6. Key Design 4: Observability and Failure Recovery
Debugging a multi-step agent is far harder than debugging single-turn Q&A, so every step must be traced. Recommended fields to record include step identifier, tool name, argument summary (with sensitive fields masked), return code, duration, and retry count. Three engineering practices are worth following:
- Idempotency first: design write tools so that repeating the same request produces no side effects;
- Bounded retry with backoff: retry only recoverable errors; argument errors should fail immediately and return the reason;
- Compensation actions: predefine inverse operations for irreversible actions, and roll back completed steps in reverse order on failure.
7. Reference Implementation Skeleton
The pseudocode below shows the main loop of “plan — confirm — execute.” The platform side handles model invocation and tool registration, while the external service handles state and confirmation:
def run_agent(user_input, session_id):state = store.load(session_id) or PlanState(status="draft")if state.status == "draft":state.plan = llm.plan(user_input, tools=registry.schemas())state.status = "pending_confirm"store.save(session_id, state)return render_plan(state.plan) # hand back to the user for confirmationif state.status == "pending_confirm":state.plan = apply_user_edits(state.plan, user_input)state.status, state.cursor = "running", 0while state.cursor < len(state.plan):step = state.plan[state.cursor]if step.tool in registry.write_tools() and not confirmed(step):state.status = "paused"store.save(session_id, state)return "Awaiting confirmation: " + describe(step)result = registry.call(step.tool, step.args) # idempotent + retrystate.artifacts[step.id] = resultstate.history.append(summarize(step, result))state.cursor += 1store.save(session_id, state) # persist after every stepstate.status = "done"store.save(session_id, state)return summarize(state.history)
The key point is: persist after every step, so any interruption can resume from the breakpoint rather than rerunning from the beginning.
8. Common Pitfalls and Selection Guidance
- Pitfall 1: Treating a long prompt as planning capability. A prompt can induce the model to list steps, but it cannot guarantee the steps are executable, acyclic in order, or complete in arguments — structural validation is required.
- Pitfall 2: Piling up branches on the canvas to simulate dynamic planning. The number of branches grows exponentially with scenarios, and maintainability collapses quickly.
- Pitfall 3: Ignoring permission boundaries. Once an agent has write access, it is equivalent to handing system operation rights to a probabilistic model; tool-level permissions and human confirmation are both indispensable.
- Selection guidance: during prototype validation, rely fully on visual orchestration for fast trial and error; entering production, adopt a layered architecture where “visual orchestration handles model and tool integration + an independent orchestration service handles the state machine, confirmation, and auditing,” with the two communicating through well-defined interfaces.
9. Conclusion
Back to the original question: a low-code platform is enough to build the agent’s backbone, getting planning, tool calling, and plan display running within hours. But the “complete” part — interruption and recovery, human confirmation, permission control, and full-chain tracing — requires engineering capability beyond the platform. Structure the plan, externalize the state, productize confirmation, and make the process observable. Get these four things right, and the agent is genuinely ready for deployment. To further reduce build and operations costs, you can rely on general capabilities such as container platforms, cache services, and logging and monitoring alerts from Baidu AI Cloud, and focus your effort on the business logic itself.
