How to Maintain AI Workflows During System Changes
A business AI workflow connects an AI model to documents and business software, then uses the model’s output to do things such…
When a small business uses AI to turn customer requests into sales quotes, the model should draft descriptions and organize request details while ordinary software calculates prices and enforces business rules. A pricing rule is a defined limit, such as a minimum selling price, a maximum discount, or a minimum gross margin, which sets the minimum share of the selling price left after costs. Keeping those rules outside the model prevents a plausible-sounding draft from becoming an unauthorized price.
The quote software should retrieve current product, customer, and order records, calculate the permitted price, and check whether a person must approve an exception. The model can then write customer-facing language from those validated results. The model proposes and drafts. The quote software's code checks whether the numbers and approval status meet the rules.
Use the customer’s request to identify what needs quoting, then have application code retrieve the relevant business records. Product records should supply identifiers, descriptions, units, eligible price-list entries, and cost data when the margin rule needs it. Customer records should supply the applicable price list, currency, and approved contract terms. Order details should supply quantities, configurations, and delivery information that affects pricing.
A price list can set different prices by product, unit, currency, customer, or effective date. Microsoft Dynamics 365 documentation explains that price lists contain entries linking products to prices and related conditions. Your lookup should select the entry that matches the actual quote context, rather than asking the model to choose a price from prose.
For example, code can use a validated customer identifier to retrieve the customer’s terms, then use the requested product identifier, unit, currency, and quote date to retrieve the matching price-list entry. Keep the source and effective date of each important value with the draft. If an identifier is ambiguous, a required term is missing, or a price entry has expired, request clarification or route the quote for review instead of filling the gap with a guess.
Put minimum prices, discount limits, minimum-margin requirements, and rules for who can approve exceptions in a pricing service or other standard quote-software code. Keep the rules configurable and versioned so authorized staff can update them without relying on prompt wording. The calculation should record which rules and price-list version it used.
Check the final price after all discounts, rather than checking each discount on its own. For a minimum gross margin, define the cost basis and whether the rule applies to each line or to the full quote. Gross margin is the difference between selling price and cost divided by selling price. If the required margin is m and the relevant cost is c, the corresponding price floor is c / (1 - m). This formula assumes that the business defines gross margin on selling price; the business must also decide which costs count and how it handles freight, labor, overhead, taxes, and rounding. Microsoft’s price-calculation guidance distinguishes margin-based pricing from markup on cost, which produces a different result.
Have the pricing service return the selected price-list entry, discounts applied, final net price, margin, floor, and policy version. The model can explain those results in readable language, but the quote record should keep the service’s calculated values. This division also makes it easier for a reviewer to see why a quote passed or failed a rule.
A structured response format, such as JSON Schema, tells a model which fields and data types to return. It helps software read the response reliably, but it does not prove that a value is correct or authorized. OpenAI’s Structured Outputs documentation explicitly leaves business rules that the schema does not express to the application.
Use the model to extract the requested products along with their quantities and configuration details, or to write a quote description from validated data. Keep price and discount fields out of the model’s accepted output where practical. After the pricing service returns approved values, application code should attach them to the quote. If the model returns a price anyway, ignore or reject it rather than copying it into the quote record.
If the model uses a tool to request a lookup, treat that request as a proposal. The application should validate its arguments, perform only the permitted lookup, and return the result. OpenAI’s function-calling documentation describes this separation between a model’s proposed tool call and the application code that executes it.
Define which conditions stop an automatic draft from progressing. Examples include a missing or expired price entry. Stop the draft if the customer’s terms do not match the selected currency or the product combination is unrecognized. Also stop it if the price falls below the required floor or the discount exceeds the requester’s authority. An unusual quantity or configuration can also prompt a human to confirm the request. Set thresholds from your own catalog and pricing policy; examples from another company do not establish the right limits for yours.
Show the reviewer the proposed quote and the inputs used in the calculation. Include the rule that triggered the exception and the resulting price or margin. A person should approve the specific version of the quote and the values they reviewed. If someone later changes the product mix or quantity, invalidate that approval or require a new one. Do the same if they change the price, discount, or relevant terms. Commercial software documents approval routing and quote locking as ways to control review and editing, but the business must verify that its own configuration enforces those controls. See Salesforce’s approval example and its quote locking guidance.
Route unresolved or high-risk cases to a competent reviewer while allowing clearly in-policy quotes to proceed through the configured checks. When the business sends every routine quote for approval, the review takes longer and reviewers may become less attentive. The business’s risk and policy determine where it sets the boundary.
Keep the authority to activate, export, or email a quote in code that runs on your servers, outside the model. Before release, code should recalculate or recheck the pricing rules, confirm that required approval exists, and verify that the approved quote still matches the current revision. An approval button alone does not stop a later edit or an alternate send path from bypassing review.
Give the model only the access needed to draft and retrieve relevant records. Do not give it broad write access to price tables, customer terms, quote approval states, or email. Validate product IDs, quantities, currencies, and other proposed inputs in code, and check that the person requesting an action has permission to do so. OWASP’s guidance on prompt injection recommends limiting access and validating actions because instructions embedded in external content can try to influence a model. Its agent security guidance also emphasizes checking approval for the specific action and its parameters.
Stop release when a required check fails. Missing price data, an unavailable pricing service, a failed validation, or an uncertain approval state should leave the quote unsent rather than trigger a fallback to a model-generated number. Log the source records and pricing-policy version with the calculation result. Also record the exception reason, approval, and changes that affect the quote so an owner can trace how the released quote was produced.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com