WebRobot

App Studio guide

Sample app 5 / 5 · Purchasing for manufacturing companies

Ufficio Acquisti

What was asked

A buyer describes what is needed and attaches the specification. Agents write the requests for quotation to the suppliers from the ERP’s supplier list, read the offers, compare them and draft the order. The buyer approves; above 5,000 euros the purchasing manager approves too; the order is registered in the ERP and the suppliers are chased for the confirmation and the delivery.

How the manifest models it

Who

Buyers sign up; the purchasing manager is invited. All records belong to the company’s back office: a buyer reads the ones with their own email in buyer_email, the manager reads and edits all of them.

Agents

Five agents in a chain. The writer and the orderer call the company ERP through http tools, with one API key set by the admins for the whole app and the ERP host declared in the egress list. The writer and the reader open the attached files with read_file.

Events

Each record queued in the outbox emails a supplier; a request turning quotes_ready starts the comparison; the buyer’s approval and then the manager’s start the orderer; two date triggers chase the supplier two days after the order and one day after the expected delivery.

Views

The request form with the specification attached, the requests, quotes and orders tables, a form to update an order, the approvals.

Money

Team plans with monthly credits; the writer and the comparer are charged on real usage (AI and compute, with a 50% markup); the requests per month depend on the plan, unlimited on the largest.

From the manifest: Email to the supplier, a two-level approval, the reminder

An excerpt: 54 of the manifest’s 1092 lines, copied as they are.

spec:
  triggers:
  - key: rfq_send
    'on':
      collection: rfq_outbox
      op: insert
    notify:
      to: record.supplier_email
      subject: '{record.subject}'
      body: '{record.body}'
  - key: chase_confirmation
    'on':
      date:
        collection: orders
        field: order_date
        offsetDays: 2
        hour: 8
    start:
      agent: expediter
    goal: 'Controlla se per l''ordine {record.order_id} è arrivata la conferma del fornitore {record.supplier_name};
      se no scrivi il sollecito. Stato conferma: {record.confirmation}.'
  approvals:
  - key: buyer_ok
    title:
      it: Approva la bozza d'ordine
      en: Approve the draft order
    description: Il buyer conferma fornitore e bozza d'ordine proposti dall'agente
    decidedBy: requester
    timeoutMinutes: 10080
  - key: manager_ok
    title:
      it: Approvazione responsabile acquisti (sopra soglia)
      en: Purchasing manager approval (above threshold)
    description: Ordini sopra 5000 EUR
    role: manager
    timeoutMinutes: 10080
    onTimeout: reject
  data:
    credentials:
    - provider: erp
      kind: api_key
      scope: org
      label:
        it: ERP aziendale
        en: Company ERP
      help:
        it: Chiave API dell'ERP per leggere l'anagrafica fornitori e registrare gli ordini (impostata
          dagli admin).
        en: ERP API key to read suppliers and register orders (set by admins).
  egress:
    hosts:
    - erp.azienda.example
    notes: 'Host dell''ERP aziendale: sostituire con l''host reale dell''API ERP del cliente (anagrafica
      fornitori in lettura, ordini di acquisto in scrittura).'

The whole manifest · Ufficio AcquistiDownload
Loading…

The result

The home page.
The home page.
The purchase requests and their status.
The purchase requests and their status.
The offers read from the suppliers, side by side, with the CSV download.
The offers read from the suppliers, side by side, with the CSV download.
The approvals waiting for the buyer or the manager.
The approvals waiting for the buyer or the manager.

What it cannot express yet

Three needs stay in extensions: reading the suppliers’ replies from the company mailbox (today the buyer uploads the offer), the real ERP endpoints of each customer, and a price per seat.

What the manifest cannot express goes into spec.extensions, in words, so nothing is lost silently. A sample generated by the co-pilot; the records in the screenshots are made up.

← Gruppi in Partenza← All five apps