Medicines wholesale · Playbook 68

Pharmacy order desk agent

Pharmacies get straight answers on stock, alternatives, delivery times and credits at any hour, by phone, email or portal. Clear limits keep clinical advice and controlled drugs with people.

  • Speech and voice
  • Agents with tools
  • Retrieval (RAG)
  • Human in the loop
  • MHRA GDP
  • Home Office CD licensing
  • PECR
  • UK GDPR

At a glance

The problem
Pharmacies phone and email to ask what's in stock, what's coming and where their order is, and wait in a queue to find out
Typical volume
Around 1,500 calls and 800 emails a day from 3,000 pharmacy, dispensing doctor and hospital accounts
Who's involved
Customer service, the Responsible Person, the CD team, credits and returns, IT, compliance, data protection
Pilot
8–10 weeks after a 3 week discovery
Clouds
AWS or Azure, UK regions

An illustrative scenario. Linked to a real, anonymised case study below; the numbers here are still typical examples. The cloud services and UK rules were checked on 9 November 2026.

The business problem

Most routine orders reach a wholesaler electronically, straight from the pharmacy's ordering system. The order desk handles everything else: a pharmacist asking whether a short line will come in tomorrow, a dispenser chasing a missing tote, a dispensing practice asking for a different pack size, a branch wanting a credit for a damaged item, and the steady questions about cut-off times and delivery slots.

When medicines are short, calls rise sharply and the questions get harder. Is it out everywhere or just here? Is there another manufacturer's version of the same product? Is it on a manufacturer's quota? Customer service staff look across the ERP, the warehouse system and supplier notices to answer, while the queue grows. Pharmacy teams, who are already stretched, wait on hold to hear an answer that's often 'not until Thursday'.

Some of these conversations carry real risk. A pharmacist may ask what they could use instead, which is a clinical question the wholesaler shouldn't answer. A caller may want to add a Schedule 2 controlled drug to an order, which has its own legal requirements. Unusually large orders may need checking before they're supplied. Any automation has to know exactly where those lines are.

What AI changes

  • Calls, emails and portal messages are answered within seconds, at any hour, with stock and delivery answers taken live from the ERP and warehouse systems.
  • When a line is short, the agent offers like-for-like alternatives only: the same medicine, strength and form from another manufacturer, or a different pack size.
  • Delivery questions are answered from the transport system, including where the van is and the expected time window.
  • Credit and return requests are logged with photos and references, checked against the returns policy, and passed to a controller ready to approve.
  • Clinical questions, controlled drug orders and anything unusual go straight to a person, with a summary so the pharmacy doesn't have to repeat itself.
  • People stay in control: the agent answers and prepares, and staff decide every credit above a set limit, every return to stock and every controlled drug order.

How success is measured

Agree these, and measure the baseline, before anything is built. Example targets are typical, not promises.

Time to answer

How long a pharmacy waits for a first useful answer, by channel.

ExamplePhone under 30 seconds; email under 15 minutes

Resolved without a hand-off

Stock, alternative and delivery queries answered fully by the agent. Measured on queries it should handle, not all contacts.

Example50–60% of those queries

Hand-off quality

How often staff can act on a handed-off query without asking the pharmacy again.

ExampleOver 90%

Wrong answers

Answers found wrong in a weekly sample, such as stock promised that wasn't available.

ExampleBelow 1%, reviewed weekly

Boundary breaches

Any clinical advice or controlled drug action by the agent, found in sampling or testing.

ExampleZero, with every case investigated

Credit turnaround

Time from a pharmacy reporting a damaged or missing item to the credit being issued.

ExampleFrom 5 days to 1–2 days

UK regulation and controls

Cross-sector rules are on the UK regulation map.

  • MHRAGood Distribution Practice: qualifying customers (Green Guide)

    A wholesaler may only supply customers entitled to receive medicines, and the Responsible Person expects unusually large orders to be checked. The agent works only on verified, qualified accounts, and orders above each account's normal pattern for a line go to a person before they're confirmed.

  • Home OfficeMisuse of Drugs Regulations 2001 and the wholesaler's CD licence

    For Schedule 2 and 3 drugs, a supplier must hold a signed requisition on the approved form, the FP10CDF in England, before delivering to the people listed in regulation 14, such as doctors. That includes dispensing practices. The agent never adds, changes or cancels a Schedule 2 or 3 line. It routes the caller to the CD team with the details.

  • DHSC / NHSBSAShortages, alternatives and Serious Shortage Protocols

    Choosing a different medicine is a decision for the prescriber or pharmacist. The agent offers only the same active ingredient, strength and form, and says when a Serious Shortage Protocol is in force, linking to the NHSBSA notice. Clinical questions go to the manufacturer's medical information service or a person.

  • MHRAReturns (GDP chapter 6)

    Returned stock can only go back to saleable stock if conditions are met, including proof of proper storage for fridge lines. The agent logs the request and issues a reference, but whether stock is credited or returned to stock is decided by people, under the Responsible Person's procedures.

  • ICOPECR, as changed by the Data (Use and Access) Act 2025

    Order confirmations and delivery updates are service messages. Promotions are marketing, and many pharmacies are sole traders or partnerships, which PECR treats like individuals, so marketing emails need consent or the soft opt-in. Since February 2026, PECR fines can reach UK GDPR levels. The agent only sends service messages.

  • ICO / Home OfficeCall recording and UK GDPR

    Recording and transcribing calls relies on the Investigatory Powers Act 2016 business regulations and a UK GDPR lawful basis. Callers are told they're speaking to an automated assistant and that calls are recorded. Patient details sometimes come up on calls, so transcripts are minimised and redacted, processed in UK regions, and kept for a set period.

The solution

Showing AWSAzuresovereign / on-prem services. Switch with the toggle; every diagram and table on this page follows it.

Pharmacy order desk agent: reference architecture
  1. 01Channels

    • Phone
    • Email
    • Customer portal
  2. 02Intake

    • Amazon ConnectAzure Communication ServicesYour existing phone system, over SIPContact centre
    • Amazon TranscribeAzure Speech (Foundry Tools)Whisper on your own GPUsSpeech to text
    • Amazon SESLogic Apps email connectorYour existing mail serverInbound email
    • API GatewayAPI ManagementKong, or your existing API gatewayAPI for the portal
  3. 03Intelligence

    • Bedrock Knowledge BasesFoundry IQ (Azure AI Search)OpenSearch, or PostgreSQL with pgvectorProduct, policy and shortage knowledge
    • Amazon TextractContent Understanding (Document Intelligence)Docling plus an open-weight vision modelRead attachments
    • Agent
      Bedrock AgentCoreFoundry Agent ServiceLangGraph on KubernetesOrder desk agent
  4. 04Orchestration

    • Step FunctionsLogic Apps / Durable FunctionsTemporal, or n8nCase workflow
    • EventBridge + SQSEvent Grid + Service BusApache Kafka or RabbitMQEvents and queues
  5. 05Systems of record

    • ERP and order management
    • WMS: stock, allocation, quotas
    • Transport and delivery tracking
    • Customer accounts (CRM)
  6. 06People

    • Person
      Customer service: hand-offs
    • Person
      CD team: Schedule 2 and 3
    • Person
      Credits and returns controllers
  • Cloud or platform service (AWSAzuresovereign / on-prem)
  • AI agent
  • A person decides
  • Your existing systems
  • Outside your organisation

Components, side by side

Pharmacy order desk agent: components on AWS, Azure and a sovereign or on-prem stack
LayerAWSAzureSovereign / on-prem
Phone and contact centreOr keep your existing contact-centre platform and connect the agent to it.Amazon ConnectAzure Communication Services (Call Automation), or Dynamics 365 Contact CenterYour existing phone system, connected over SIP
SpeechTest on real calls: dispensary noise, drug names, strengths and pack sizes.Amazon TranscribeAzure Speech in Foundry ToolsOpen-weight speech models (e.g. Whisper) on your own GPUs
Email and portal intakeAmazon SES, API GatewayLogic Apps connectors, API ManagementYour existing mail server; Kong, or your existing API gateway
Reading attachmentsPhotos of damaged items, delivery notes and scanned requisitions.Amazon TextractAzure Content Understanding (includes Document Intelligence)Open-source parsing (e.g. Docling) plus an open-weight vision model
Reasoning and repliesEach offers a choice of models.Amazon BedrockMicrosoft FoundryOpen-weight models served with vLLM on your own GPUs, or IONOS AI Model Hub
Product and policy knowledge (retrieval)Product data, cut-off times, returns policy and current Serious Shortage Protocols, each with a named owner.Bedrock Knowledge BasesFoundry IQ, built on Azure AI SearchOpenSearch, or PostgreSQL with pgvector
Agent runtimeThe original Bedrock Agents closed to new customers on 30 July 2026; new builds use AgentCore.Amazon Bedrock AgentCoreFoundry Agent ServiceAn open-source agent framework (e.g. LangGraph) on Kubernetes
Workflow and eventsStep Functions, EventBridge, SQSLogic Apps or Durable Functions, Event Grid, Service BusTemporal or n8n; Apache Kafka or RabbitMQ
Link to ERP, WMS and transportThe agent calls the same APIs as the portal, with the same limits.API Gateway, plus your existing integration platform if you have oneAPI Management, plus your existing integration platform if you have oneKong, or your existing API gateway
PlatformManaged AWS services, Amazon EKS where containers are neededManaged Azure services, AKS where containers are neededKubernetes on-prem (e.g. OpenShift, Rancher), or IONOS Managed Kubernetes
Human hand-offSummary, transcript and suggested next step arrive with the call or case.In the team's existing agent desktop or CRMIn the team's existing agent desktop or CRMIn the team's existing agent desktop or CRM
GuardrailsTopic filters catch clinical questions, but the hard limits sit in the tool permissions.Bedrock GuardrailsFoundry guardrails (Azure AI Content Safety)Open-source guardrails (e.g. NeMo Guardrails, Llama Guard)
Identity, keys, data protectionIAM Identity Center, KMS, MacieEntra ID, Key Vault, PurviewKeycloak or your existing Active Directory; OpenBao or HashiCorp Vault; an HSM
Monitoring and auditEvery answer, tool call and hand-off logged, so any conversation can be replayed.CloudWatch, CloudTrailAzure Monitor, Log AnalyticsPrometheus, Grafana, OpenTelemetry
UK data residencyAzure Communication Services stores data by geography, chosen when the resource is created.eu-west-2 (London)UK South / UK WestYour own UK data centre, or a UK/EU provider (IONOS AI Model Hub runs in Germany)

On a phone, the table shows the platform you pick. Sovereign / on-prem means open, portable components you can run in your own data centre or with a UK or European provider; IONOS is shown as one example, and others exist. What sovereign cloud means →

Hybrid and on-prem

Many organisations keep core systems and sensitive data on their own servers. This is how the same design works across both.

Stays on-prem

The ERP, WMS, transport system and phone system usually stay where they are, often in your own data centre. Pharmacies' electronic orders keep flowing straight into the ERP, and call recordings can stay on-prem if your policy requires it.

Uses cloud AI

Speech-to-text, the order desk agent and the knowledge index run in the cloud, or on your own sovereign stack. Voice needs a fast round trip, so they sit in the same UK region as the contact-centre platform, or next to your own phone system.

How they connect

The agent calls the ERP and WMS through your API gateway across a private link, such as AWS Direct Connect, Azure ExpressRoute or a site-to-site VPN, with the same account checks as the portal. Calls reach a cloud contact centre over SIP trunks; Azure Arc or AWS Outposts can host parts of the stack on-prem if needed.

If the link drops

The agent can't check stock, so it doesn't answer stock or delivery questions. Calls route straight to the team as they do today, emails wait safely in the queue, and orders from pharmacies' own ordering systems are unaffected.

The agents

What each agent may do through its tools, what it may not, and where a person signs off. The limits are enforced by the platform, not the prompt.

Order desk agent

May do

  • Confirm who is calling and which account they're calling for
  • Check available stock, due-in dates and quota status for a line
  • Offer the same medicine, strength and form from another manufacturer, or another pack size
  • Add or amend standard lines on today's order, within the account's normal quantities
  • Give delivery windows and order status from the transport system
  • Log a credit or return request, read the photos, and issue a reference
  • Hand off to a person with a summary and the transcript

May not do

  • Give clinical advice, or suggest a different medicine or strength
  • Add, change or cancel any Schedule 2 or 3 controlled drug line, or accept a requisition
  • Approve a credit above the set limit, or agree that stock can be returned to saleable stock
  • Release an order held for an unusual quantity
  • Change account details, delivery addresses or credit limits
  • Send marketing or promotional messages

Where a person signs offPeople decide every controlled drug order, every held or unusual order, every return to stock, and every credit above the limit. The agent's tools enforce these limits in the platform's identity and policy controls, not in its instructions: it simply has no tool that can touch a Schedule 2 or 3 line or release a held order.

Middleware and integration

The agent reaches the ERP, WMS and transport system only through the same API layer the customer portal uses, with the same account checks and quantity limits. If you already run an integration platform, the agent uses it like any other channel.

Stock answers come from available-to-promise, not raw stock. Stock that's quarantined, allocated to other customers or held back under a manufacturer's quota isn't offered, so the agent can't promise what the warehouse won't pick.

Every order change carries a unique ID, so a dropped call or a repeated email never creates a duplicate order. Changes are confirmed back to the pharmacy in writing.

If the ERP or the agent is down, nothing is guessed. Calls route straight to the team as they do today, and emails wait safely in the queue.

Process and people

  • Clear hand-off rules, owned by customer service and the Responsible Person, for clinical questions, controlled drugs, unusual orders and complaints.
  • A named owner for product data, the returns policy, shortage information and each prompt, with change control like any other system.
  • A weekly review of a sample of conversations, including deliberate tests of the clinical and controlled drug limits.
  • A CD team that receives handed-off controlled drug calls with the account, the lines and the requisition status already on screen.
  • Customer service staff trained before go-live on what the agent can and can't do, and how to correct it.
  • Pharmacies told plainly that they're speaking to an automated assistant, and how to reach a person at any point.

Delivery plan

  1. 3 weeks

    Discovery

    Sample a month of calls and emails to see why pharmacies contact you, measure the baseline, and check API access to the ERP, WMS and transport systems.

  2. Gate · must be true to passContact reasons and baseline agreed, data access confirmed, DPIA started, Responsible Person and compliance involved.

  3. 6–8 weeks

    Pilot

    Email and portal first, for stock, alternative and delivery queries. The agent drafts, staff send, and the drafts are compared with what staff would have written.

  4. Gate · must be true to passAccuracy and hand-off quality within agreed limits, zero boundary breaches in testing, and compliance sign-off.

  5. 4–6 weeks

    Production

    Email and portal answers go live, then voice for the same query types, out of hours first, with monitoring, support and a rollback plan.

  6. Gate · must be true to passMonitoring, support model, rollback plan and staff training in place.

  7. Ongoing

    Scale

    Add credits and returns, then proactive service messages such as a short line arriving early, one at a time.

  8. Gate · must be true to passEach new capability passes the same pilot gate.

Roles and RACI

Who is responsible, accountable, consulted and informed, by activity
ActivityCustomer service directorResponsible PersonSolutions architectI can fill thisTechnical PMI can fill thisEngineersI can fill thisCompliance & DPOSecurityI can fill this
Business case and benefitsAccountableConsultedConsultedResponsibleInformedInformedInformed
Target architectureInformedConsultedAccountable and ResponsibleConsultedConsultedConsultedConsulted
Hand-off rules and agent limitsAccountableResponsibleConsultedConsultedInformedConsultedConsulted
DPIA, PECR and call recording reviewAccountableConsultedConsultedInformedInformedResponsibleConsulted
Build and integrationInformedInformedAccountableResponsibleResponsibleInformedConsulted
Accuracy and boundary testingInformedConsultedAccountableConsultedResponsibleConsultedResponsible
Go-live decisionAccountableResponsibleConsultedResponsibleInformedConsultedConsulted
Run, monitor and improveAccountableConsultedConsultedInformedResponsibleConsultedConsulted

Business case and benefits

Customer service director
A · Accountable
Responsible Person
C · Consulted
Solutions architect
C · Consulted
Technical PM
R · Responsible
Engineers
I · Informed
Compliance & DPO
I · Informed
Security
I · Informed

Target architecture

Customer service director
I · Informed
Responsible Person
C · Consulted
Solutions architect
A/R · Accountable and Responsible
Technical PM
C · Consulted
Engineers
C · Consulted
Compliance & DPO
C · Consulted
Security
C · Consulted

Hand-off rules and agent limits

Customer service director
A · Accountable
Responsible Person
R · Responsible
Solutions architect
C · Consulted
Technical PM
C · Consulted
Engineers
I · Informed
Compliance & DPO
C · Consulted
Security
C · Consulted

DPIA, PECR and call recording review

Customer service director
A · Accountable
Responsible Person
C · Consulted
Solutions architect
C · Consulted
Technical PM
I · Informed
Engineers
I · Informed
Compliance & DPO
R · Responsible
Security
C · Consulted

Build and integration

Customer service director
I · Informed
Responsible Person
I · Informed
Solutions architect
A · Accountable
Technical PM
R · Responsible
Engineers
R · Responsible
Compliance & DPO
I · Informed
Security
C · Consulted

Accuracy and boundary testing

Customer service director
I · Informed
Responsible Person
C · Consulted
Solutions architect
A · Accountable
Technical PM
C · Consulted
Engineers
R · Responsible
Compliance & DPO
C · Consulted
Security
R · Responsible

Go-live decision

Customer service director
A · Accountable
Responsible Person
R · Responsible
Solutions architect
C · Consulted
Technical PM
R · Responsible
Engineers
I · Informed
Compliance & DPO
C · Consulted
Security
C · Consulted

Run, monitor and improve

Customer service director
A · Accountable
Responsible Person
C · Consulted
Solutions architect
C · Consulted
Technical PM
I · Informed
Engineers
R · Responsible
Compliance & DPO
C · Consulted
Security
C · Consulted

R ResponsibleA AccountableC ConsultedI Informed· not involved

Where I'd fit

Option A

Lead the architecture

If there's no architect on the programme, I'd own the design end to end: the contact channels, the agent and its limits, the integration with your ERP, warehouse and transport systems, and the gates. I'd report to your programme board and agree the hand-off rules with your Responsible Person early.

Option B

Support your architect

If your partner or your own team already has an architect, I'd take on the agent's tools and permissions and the integration with your ERP and warehouse system under their lead, which is where order desk projects usually get stuck, and give them a second senior opinion on the rest.

Where this goes wrong

  1. Goes wrong

    The agent says a line is in stock, but it's allocated, quarantined or on quota.

    How the design avoids it

    Answers come from available-to-promise and quota rules through the API layer, never from a raw stock figure.

  2. Goes wrong

    A pharmacist asks what they could use instead, and the agent drifts into clinical advice.

    How the design avoids it

    Alternatives come only from a same-ingredient, same-strength list, clinical questions hand off, and every release is tested with questions designed to push it over the line.

  3. Goes wrong

    A drug name or strength is misheard on a noisy call.

    How the design avoids it

    The agent reads back product, strength, pack size and quantity, matches on product code, and confirms every change in writing.

  4. Goes wrong

    Hand-offs lose the context, so the pharmacy explains everything twice.

    How the design avoids it

    The summary, transcript and account details arrive on the person's screen with the call or case.

  5. Goes wrong

    Helpful 'back in stock' messages slowly turn into promotions sent without consent.

    How the design avoids it

    Service messages and marketing are separate flows. The agent sends service messages only, and marketing goes through PECR checks owned by the marketing team.

On the horizon

Changes already announced or under way that affect this design. More in the UK horizon scan.

  1. 31 January 2027
    The analogue phone network switches off

    The national analogue phone (PSTN) switch-off has no further extension. Some pharmacies still phone or fax orders over analogue lines. Make sure your own lines and any fax-to-email route are on IP, and expect some of that traffic to move to email and the portal, where the agent can pick it up.

  2. Since September 2026
    Pharmacists qualify as independent prescribers

    Most newly registered pharmacists are now independent prescribers, and prescribing is being added to community pharmacy services. Expect more varied and more urgent orders. Keep the clinical line sharp, and check with your CD lead how requisition rules apply as prescribing grows.

  3. 2026 onwards
    Requisitions move towards electronic forms

    NHSBSA's July 2026 guidance describes an electronic FP10CDF that can be completed online, though it's still printed and signed in ink. Design the requisition check so a scanned form can be matched to an order now, and a fully electronic one later.

  4. Through 2026–2027
    Data (Use and Access) Act changes bed in

    The main data protection changes took effect on 5 February 2026, including higher PECR fines and new rules on automated decisions. The ICO is reviewing its marketing guidance. Keep service and marketing messages apart in the design, and track the ICO's updates.

  5. Ongoing
    Contact-centre and agent platforms are changing fast

    Amazon Connect was relaunched in April 2026 with agentic self-service, and Bedrock Agents closed to new customers in July 2026. Keep the agent's tools behind your own APIs, so the contact platform or agent runtime can change without rewriting the integration.

Questions to ask your partner or vendor

Good answers are specific. Vague answers to any of these are worth following up.

Copy them into your next supplier meeting

  1. Where does the agent's stock answer come from, and does it account for allocation, quarantine and quotas?
  2. Which actions can the agent take without a person, and where is that enforced?
  3. How do you test that it never gives clinical advice or touches a controlled drug line?
  4. What happens to calls and emails when the ERP or the agent is down?
  5. Where are recordings and transcripts processed and stored, for how long, and are they used to train anyone's model?
  6. What does it cost per thousand contacts, by channel, at our volume?

Planning something like this?

Whether you need someone to lead the design or to support the architect you already have, let's talk it through.

Sam Naseem
Sam NaseemBirmingham, UK · UK & Europe
Available now