Skip to content

Flow Diagrams

All diagrams are PlantUML sequence diagrams showing the full request lifecycle from trigger to Tripletex API call. Components map to the IDesign architecture layers.


Flow 1: Employee Submits Receipt via Slack

Employee Receipt Flow

Steps:

  1. Employee sends photo + description in Slack
  2. Conversation Agent receives message + image, manages context
  3. Conversation Agent calls Accounting API (POST /solve)
  4. TaskManager classifies as receipt expense
  5. AgentManager runs LLM to extract fields from image
  6. LLM calls Tripletex API to register supplier invoice
  7. RulesEngine checks expense against company policy
  8. Response returned to Conversation Agent, which posts reply to Slack thread

Flow 2: Daily Compliance Monitoring

Daily Monitoring Flow

Checks performed daily:

  1. Overdue bills -- Supplier invoices past due date, alert accountant
  2. Expense violations -- Travel expenses without receipts, alert employee + manager
  3. Month-end status -- Missing depreciation, accruals, trial balance, remind accountant
  4. Customer follow-up -- Overdue customer invoices > 30 days, alert sales contact

Flow 3: Invoice Creation via Slack

Invoice Creation Flow

Steps:

  1. Employee requests invoice creation in Slack with customer name, hours, and rate
  2. Conversation Agent handles clarification (e.g., which customer, rate), then calls Accounting API
  3. ClassifyEngine identifies as create_invoice
  4. AgentManager resolves the customer (searches by name)
  5. LLM creates invoice with correct line items, VAT, and due date
  6. RulesEngine validates invoice amount and customer credit
  7. Confirmation returned to Conversation Agent, which posts draft summary and "send" action

Flow 4: Month-End Closing Checklist

Month-End Flow

Checklist items (automated):

Step Action Tripletex API
1 Book depreciation POST /ledger/voucher
2 Reconcile salary vs bank GET /salary/payslip, GET /bank/statement
3 Accrue supplier invoices POST /ledger/voucher
4 Prepaid expenses POST /ledger/voucher
5 Generate trial balance GET /ledger/account
6 Prepare VAT return GET /ledger/posting with VAT filters

The agent runs each step sequentially, logging progress. The accountant sees a live checklist with status updates.


Flow 5: Bank Reconciliation from CSV

Bank Reconciliation Flow

Steps:

  1. Accountant uploads CSV bank statement
  2. FileAccessor parses transactions (date, amount, description, reference)
  3. AgentManager fetches open receivables and payables from Tripletex
  4. LLM matches each transaction against open items using amount + description fuzzy match
  5. Matched items: payment registered automatically via POST /supplierInvoice/:id/:action=pay
  6. Unmatched items: LLM suggests account code, presented for manual confirmation
  7. Summary posted with match rate and list of unmatched transactions

Flow 6: Supplier Invoice from Email

Supplier Invoice Email Flow

Steps:

  1. Employee forwards PDF invoice to regnskap@firma.no
  2. Conversation Agent receives email webhook, extracts attachment, calls Accounting API (POST /solve)
  3. FileAccessor extracts text from PDF (OCR if scanned)
  4. LLM parses invoice fields: supplier, amounts, dates, line items, VAT
  5. Supplier lookup by org number; created if new
  6. Invoice registered in Tripletex with correct account codes
  7. AuditManager logs all actions with PDF reference
  8. Response returned to Conversation Agent, which sends confirmation to employee and accountant

Flow 7: Monthly Payroll Run

Payroll Flow

Steps:

  1. Cron triggers on the 20th (or manual request)
  2. AgentManager fetches active employees and timesheet entries
  3. RulesEngine validates: hours within limits, salary vs historical average
  4. Payslips created per employee via POST /salary/payslip
  5. Employer tax (AGA) and holiday pay calculated by ComplianceEngine
  6. Transactions posted to general ledger
  7. Anomalies flagged (e.g., >20% deviation from average)
  8. Summary sent to accountant for approval before payout

Flow 8: Employee Asks About Budget

Employee Question Flow

Steps:

  1. Employee asks a natural-language question in Slack
  2. Conversation Agent receives question, manages conversation context, calls Accounting API (POST /solve)
  3. ClassifyEngine identifies as read-only query (no confirmation needed)
  4. Employee context resolved (department, role, access level)
  5. AgentManager fetches relevant ledger postings from Tripletex
  6. LLM summarizes data in natural language with numbers
  7. Response returned to Conversation Agent, which posts in Slack thread

Key design decision: Read-only queries skip the RulesEngine and do not require confirmation, enabling instant responses.