View this page in the latest version of Appian. Design Patterns for Production AI Agents Share Share via LinkedIn Reddit Email Copy Link Print On This Page The following patterns address multi-agent coordination, error handling, security, and design evolution — helping you build AI agents that are reliable, maintainable, and cost-efficient at scale. Note: The patterns on this page focus on process agents that run autonomously within process models. Many of these patterns (such as multi-agent architectures and error handling) also apply to chat agents, but the deployment-specific patterns (watchdog timer, graceful degradation via process flows) are specific to process agents. For an overview of agent types, see About AI Agents. For foundational best practices, see Best Practices for Designing AI Agents. For guidance on when to use AI agents, see About AI Agents. Multi-agent architectures Complex workflows benefit from multiple specialized AI agents working together rather than a single AI agent handling everything. Breaking work into focused AI agents improves maintainability, testability, and reusability. Orchestrator pattern In the orchestrator pattern, a primary AI agent receives input and delegates to specialized AI agents: The orchestrator AI agent interprets the request, determines which specialized AI agents to invoke, and coordinates the overall workflow. Specialized AI agents handle specific tasks such as data extraction, validation, research, or decision-making. The orchestrator AI agent collects results from each specialized AI agent and produces the final output. The orchestrator pattern works well when a workflow has distinct phases that require different expertise or tool sets. For example, a loan processing workflow might use separate AI agents for document classification, data extraction, eligibility assessment, and risk scoring. Context passing strategies When one AI agent calls another, the amount of context you pass affects both accuracy and cost. Choose the strategy that gives the child AI agent enough information to complete its task without overloading its context window: Summary only: Pass a brief summary of findings so far. This approach is efficient and keeps AI action consumption low, but the child AI agent may miss details that weren't included in the summary. Structured fields: Pass specific data fields the child AI agent needs. This approach balances fidelity and efficiency — the child AI agent receives exactly the data relevant to its task. Full context: Pass all raw data from the parent AI agent's execution. This approach provides maximum fidelity but consumes more AI actions because the child AI agent must reason through all the information. Start with structured fields and expand to full context only if the child AI agent's accuracy suffers. Depth limits Limit multi-agent collaboration to two levels maximum. Do not create patterns where a parent AI agent calls a child AI agent that calls another child AI agent. Deep nesting causes: Excessive AI action consumption as context accumulates across levels. Difficult troubleshooting when issues occur deep in the chain. Risk of infinite loops if AI agents call each other or themselves. If your workflow requires more than two levels of AI agent collaboration, restructure it so the orchestrator AI agent calls each specialized AI agent directly rather than chaining them. Error handling and resilience Production AI agents encounter errors — failed tool calls, unexpected data formats, timeouts, and edge cases the prompt doesn't cover. Design your AI agents and surrounding processes to handle these situations gracefully. Self-healing through error feedback Ensure error messages from process model tools are stored as process variables and passed back to the AI agent. When the AI agent receives an error, it can reason about the failure and try an alternative approach. To enable self-healing: Configure your process model tools to capture error details in an output variable rather than terminating the process. Return the error message to the AI agent as part of the tool's output. Include guidance in your prompt for how the AI agent should handle common errors. For example, "If a document fails to process due to size, split it into smaller sections and retry." Provide the AI agent with tools that let it react to errors. For example, if a document extraction tool fails on a large file, give the AI agent a tool to split the document into smaller chunks before retrying. Watchdog timer Use a parallel flow with a timer event to prevent stalled processes when an AI agent takes longer than expected: One branch executes the AI agent via the Execute AI Agent smart service. A parallel branch contains a timer event set to your maximum acceptable duration. If the AI agent doesn't complete within the defined window, the timer triggers a graceful escalation. The escalation path can route to a human queue, log the timeout for investigation, or trigger a simplified fallback process that handles the case without AI agent reasoning. Graceful degradation Design AI agents to produce partial results and signal when they cannot complete a task, rather than failing silently: Include an output variable (such as completion_status) that indicates whether the AI agent fully completed its task, partially completed it, or could not proceed. When the AI agent encounters a situation it cannot resolve, instruct it to document what it accomplished, what it could not complete, and why. The parent process model can then route partial results to a human for completion or trigger an alternative workflow. The graceful degradation pattern ensures that work is never lost, even when the AI agent encounters unexpected situations. Security and permissions AI agents execute within Appian's security framework. Understanding how permissions apply to AI agent execution helps you design secure, predictable workflows. Permission inheritance The AI agent executes under the security context of the user who initiated the run (or the service account configured in the process model). The initiating user's permissions determine what the AI agent can access: The AI agent can only access records, process models, and expression rules that the initiating user has permission to use. Tool calls that query records respect record-level security — the AI agent only sees data the initiating user is authorized to view. Process model tools execute with the permissions of the process model's configured run-as user. Ensure that the initiating user (or service account) has rights to all tools, expression rules, process models, and records the AI agent needs. If the AI agent encounters permission errors during execution, it cannot complete its task. Define clear boundaries Use your prompt to establish explicit boundaries for what the AI agent is allowed to do: Actions the AI agent can take: List the specific operations the AI agent is authorized to perform (read data, update records, create tasks). Actions the AI agent must not take: Define operations that are off-limits (deleting records, modifying security settings, accessing sensitive data categories). Escalation triggers: Define conditions where the AI agent must stop and route to a human rather than proceeding (low confidence, policy exceptions, high-value transactions). Prompt-defined boundaries work alongside Appian's security model. The prompt defines behavioral constraints, while Appian's security framework enforces access control. Service account considerations When AI agents run in production, consider using a dedicated service account rather than inheriting the end user's permissions: A service account provides consistent access regardless of which user triggers the workflow. A service account can be granted exactly the permissions the AI agent needs — no more, no less. Audit trails clearly show which actions were taken by the AI agent versus human users. Configure the service account in the process model that executes the AI agent. See Use AI Agents in a Process for configuration details. When to evolve your design Production AI agents should be monitored and refined over time. Use data from production runs to identify opportunities to improve efficiency, reduce cost, or simplify your architecture. Monitor production patterns Track how your AI agent behaves across many runs. Look for patterns that indicate the design should evolve: High path consistency: If the AI agent follows the same sequence of tool calls 85% or more of the time, extract that path into a deterministic process model. Reserve the AI agent for the remaining edge cases where reasoning adds value. Unused tools: If certain tools are rarely or never called, remove them. Fewer tools in the AI agent's configuration means less reasoning overhead per run. Repeated failures: If the AI agent consistently fails on a specific type of input, add targeted handling for that case in the prompt or create a dedicated tool. Track AI action consumption Monitor AI action usage over time and investigate unexpected increases. Use the Monitor tab to track tool call patterns and resource consumption across runs: Rising costs without rising complexity may indicate the AI agent is over-reasoning — spending AI actions on decisions that could be made deterministically. A sudden increase in tool calls per run may indicate a prompt change introduced ambiguity that causes the AI agent to explore more options before deciding. Compare AI action consumption across similar cases to identify outliers that warrant investigation. Iterate with feedback data Use feedback from human reviewers and end users to refine your AI agent: Collect structured feedback (such as accuracy ratings or correction notes) on AI agent outputs. Identify patterns in incorrect or low-confidence outputs. Adjust prompt language, constraints, or tool descriptions to address recurring issues. Re-run your test case library after each change to verify improvements without regressions. Know when to simplify Not every workflow needs to remain an AI agent indefinitely. As you gather production data, you may discover that portions of the AI agent's work can be converted to simpler, more efficient automation: Extract predictable paths into process models with AI skills for the cognitive steps. Keep the AI agent focused on the genuinely unpredictable portions of the workflow. Measure whether the simplified design maintains the same quality of outcomes at lower cost. The goal is the right tool for each part of the workflow — not AI agents everywhere or process models everywhere, but the combination that delivers the best results at the lowest cost. Feedback Was this page helpful? SHARE FEEDBACK Loading...