AI Agent Planning, Approval, and Execution: Building an End-to-End Workflow
An end-to-end AI agent must do more than call a language model: it must turn a user’s goal into a visible plan, obtain appropriate approval, execute within defined boundaries, and report outcomes with supporting evidence. This article explains how to implement that workflow on a visual LLM application platform, covering versioned plans, risk-based approval, tool design, state persistence, multi-agent coordination, and production monitoring.
An AI agent is not complete simply because it can call a large language model. The real test is whether it can carry a task through its full lifecycle: understand the goal, break it into steps, select tools, explain the plan, wait for approval at critical points, execute the approved actions, record evidence, and handle exceptions.
Visual LLM application platforms typically provide conversation interfaces, knowledge retrieval, workflow orchestration, and tool integration. These capabilities can support an end-to-end workflow. However, the difference between a working demo and a business-ready system still depends on state management, permission boundaries, and human oversight.
What Makes an AI Agent Complete?
An agent designed for business use needs at least five capabilities.
1. Task understanding. The system must translate a natural-language request into an executable goal. It should distinguish information retrieval, document processing, multi-step procedures, and operations that write to external systems. A system that only explains what could be done, but never executes anything, is an adviser rather than an agent.
2. Planning and tool selection. A plan should not be a long model-generated passage treated as an executable script. It should contain a bounded sequence of steps, each with a purpose, inputs, proposed tool, expected output, and fallback if it fails. Tool selection must be restricted to an allowlist rather than letting the model invent interfaces.
3. Plan visibility and approval. Users need to understand what the agent intends to do, which data it will use, and whether it will change external systems. Approval can cover the entire task or follow a risk-based policy: read-only steps may proceed automatically, while writes, deletions, outbound communications, and financial operations must pause for approval.
4. Controlled execution and observability. The executor should consume only an approved plan version. It calls tools step by step, records input and output summaries, execution time, and error codes, and reports progress to the user. Any mid-task change requires a new plan version rather than silently overwriting the existing one.
5. Completion and review. At the end of a task, the agent should report results, supporting evidence, and unfinished items. If the task fails, it should identify the failed step, explain which side effects have already occurred, and describe how they can be compensated for.
Automatic tool calls without approval and auditing may be suitable for low-risk prototypes. Planning without an executor cannot close the loop. A complete agent combines both planning and controlled execution.
Mapping Platform Capabilities to the Workflow
Visual development platforms commonly divide applications into conversation entry points, model nodes, knowledge retrieval, conditional branches, code or function nodes, and external tools. These building blocks can support an agent, but responsibilities should be separated instead of placing all logic in one oversized prompt.
A practical design uses four workflow stages:
- Collect intent and constraints. Extract the goal, target objects, time range, and user permissions. When information is missing, ask only for the required fields rather than repeatedly extending the conversation.
- Generate the plan. Provide the planning node with a structured task and the available tool list. Its output should be a draft plan with fixed fields: step ID, action type, tool name, parameter source, read-only status, approval requirement, and success criteria.
- Apply the approval gate. Render the plan as a readable explanation and persist its version number. The user can approve, reject, or modify the constraints. Execution must not begin before the required approval is recorded.
- Execute and summarize. Call tools in sequence, validate their response structures, and retry, skip, or terminate on failure as appropriate. Then produce a result summary.
The following diagram illustrates the control flow without relying on any specific product interface:
User request-> Complete required fields-> Generate draft plan(plan_version)-> Display plan and wait for approvalReject: stop or replanApprove: lock plan-> Execute step by step(locked version only)-> Record execution trace and return results
Knowledge bases are useful for policies, templates, and historical examples. They are not substitutes for transactional systems. Actions that change data must use controlled tools, which must independently validate identity and parameters rather than trusting model-generated text.
Why Plans Need Explicit Approval
Explaining a plan before execution aligns expectations; it is not merely a user-experience feature. A model may misunderstand the scope of a request—for example, interpreting “summarize this month’s contract risks” as “update contract statuses in bulk.” Without an approval gate, that misunderstanding can propagate into external systems.
An effective approval summary should be brief and verifiable, without exposing a lengthy reasoning process. It should include:
- Goal: What the system understands the task to be, and what it will not do.
- Steps: A one-sentence description of each step, labeled as read-only or write.
- Data scope: Which knowledge sources or business objects will be accessed.
- Side effects: What will be created, updated, sent, or deleted.
- Stop conditions: Which failures will terminate execution and whether partial success is acceptable.
Risk-based approval is more practical than interrupting every action. Retrieval, summarization, and draft generation can run automatically. Tools that change business state require human approval. For bulk operations, show the number of affected objects and a sample before allowing execution to continue.
Even after the user approves the overall task, the executor must reject tools that are absent from the plan and parameters that exceed its declared scope.
Human approval also introduces interruptions. The platform must persist the conversation, plan version, and pending approval state so that a user can leave and later resume the same version. It should not ask the model to recreate the plan freely. Drafts that remain unapproved beyond the timeout should expire, preventing stale plans from being executed after the context has changed.
Improving Planning Quality and Tool Design
Reliable planning depends more on constrained inputs than on longer prompts. For each planning request, provide only the tools the current user is authorized to use. Tool descriptions should specify their names, purposes, parameter meanings, read or write behavior, idempotency, timeouts, and error semantics. Ambiguous descriptions make incorrect tool selection more likely.
Do not let the model construct final requests directly. A safer approach is for the model to fill business fields while deterministic code handles validation, defaults, and invocation. Date ranges, object identifiers, and quantity limits should be checked in code. Invalid values should trigger a clarification request rather than execution with incorrect parameters.
Set a maximum number of plan steps. Exceeding that limit usually indicates that the task should be split across multiple agents or work items, not that a single reasoning sequence should become longer. Each step should perform one action so it can be approved, retried, and diagnosed independently.
For write tools, prioritize idempotency keys and compensating actions. Repeated approval clicks or retries after a network timeout should not create duplicate records. Actions that cannot be compensated for should be explicitly marked as high risk and require stricter approval by default.
When Multiple Agents Are Necessary
A complete agent does not need to be a multi-agent system from the outset. Contract review, report drafting, and customer support triage are easier to debug with one planner and a set of tools when a single workflow can express the task clearly.
Separate roles become useful when a task requires substantially different specialist skills and intermediate results need independent validation. Possible roles include planning and coordination, information retrieval, drafting, and rule checking.
Roles should exchange structured artifacts and version numbers rather than sharing an uncontrolled, lengthy conversation. The coordinator owns planning and approval. Specialist roles should be read-only by default, and all writes should return to the same approval gate. This prevents multiple roles from independently modifying external systems.
Overlapping responsibilities and implicit state are common causes of collaboration failures. Define in advance who can propose new steps, who can veto them, and which plan version takes precedence when conflicts occur. Without that responsibility map, multiple agents mainly add latency and make behavior harder to explain.
Moving from Prototype to an Operational System
Implementation should proceed along three tracks rather than aiming immediately for full autonomy.
Scope. Start with a frequent task that has relatively clear rules and recoverable failures, such as generating recommendations from a policy or creating a task after approval. Do not begin by trying to cover every business system.
Control. For each run, save an input summary, plan version, approver, approval timestamp, tool trace, and final status. Use logs and monitoring to identify repeatedly failing steps, unusually high approval rejection rates, and excessively long tasks. Avoid recording secrets or complete sensitive documents in traces; store references where necessary.
Operations. Deploy orchestration, model calls, and tool adapters separately. Model and retrieval services can scale horizontally, while write operations should use queues with concurrency limits. Store files and intermediate results in object storage, session state in reliable storage, and secrets in a dedicated credential management system—not in prompts.
In a cloud environment such as Baidu AI Cloud, this can mean running orchestration services on a container platform, storing artifacts in object storage, and using logging, monitoring, and alerts to observe failed steps. These infrastructure capabilities support the agent; they are not the agent itself.
Evaluation should go beyond fluent responses. At a minimum, track whether:
- The plan covers the user’s goal.
- Tool selection stays within the user’s permissions.
- The approval summary matches the actual calls.
- Read-only tasks avoid unintended writes.
- Failures stop execution at the declared step.
Use a fixed set of regression cases so that prompt changes can be compared consistently.
Common Failure Points and Design Principles
Plan–execution mismatch is the most serious defect. If the model independently generates the explanation shown to the user while the executor uses a separate set of parameters, approval becomes meaningless. The same structured plan must drive both presentation and execution.
Approval fatigue reduces the value of oversight. When every step interrupts the user, approval can become habitual. Let low-risk steps proceed automatically and group side-effecting actions for approval so that each decision remains meaningful.
Knowledge retrieval must not be confused with execution. Retrieved documents can support an explanation, but they do not prove that a business action has occurred. Responses should clearly distinguish supporting evidence from completed actions.
Error recovery must remain controlled. Tool timeouts, insufficient permissions, and changed response structures should map to understandable states: retryable, additional information required, or human takeover required. After a failure, the model must not independently switch tools and continue writing data.
Conclusion
Visual LLM application platforms can support end-to-end AI agents, provided that planning, explanation, approval, execution, and auditing are implemented as explicit workflow stages. A single conversation should not be expected to handle all of these responsibilities automatically.
The platform supplies orchestration and integration. Agent completeness comes from constrained tools, versioned plans, risk-based human approval, and observable execution with recovery paths. Validate these foundations in one business workflow before expanding the knowledge sources, tool set, or specialist roles. That is how an agent moves from a demonstration to reusable production capability.
