Vendor master data from an Excel list
You keep your vendor list in Excel: name, creditor account, payment terms in days and whether the vendor is blocked. Upload the XLSX file into a data table lieferanten with the name as its key column; for a new version of the list, simply upload it again. The script looks up the invoice’s vendor in the table and sets the creditor account and the day the invoice is payable by, two fields the workflow declares itself. It marks a blocked vendor with the tag “Prüfen”, and for a vendor missing from the list the approval gets a hint. When all you need per vendor is the cost center and the G/L account, a card is enough: Allocation from a data table.
The workflow
Section titled “The workflow”The workflow starts for every document of the type incoming-invoice. Its file workflow.yaml:
$schema: 'https://docs.acriva.de/schemas/workflow.schema.json'format: 1schemaVersion: 4sdk: '1.0.0'key: vendor-master-dataname: Lieferantenstammdaten aus der Lieferantenlistetemplate: customtrigger: documentType: incoming-invoicefields: - key: creditorAccount kind: text labelDe: Kreditorenkonto labelEn: Creditor account documentTypes: - incoming-invoice - key: paymentDue kind: date labelDe: Zahlbar bis labelEn: Payable by documentTypes: - incoming-invoicestart: enrichsteps: - kind: script name: enrich label: Stammdaten des Lieferanten script: enrich.ts hook: onDocumentArrived inputs: - kind: field key: vendorName type: text - kind: field key: invoiceDate type: date - kind: table key: lieferanten returns: [] exits: [] next: approve - kind: humanTask name: approve label: Freigabe taskKind: approve assignees: - when: null assignee: kind: costCenterResponsible fallback: kind: role role: Buchhaltung options: excludeRequester: true excludeActorsOfSteps: [] pickFile: false next: approved onRejected: rejected - kind: end name: approved label: Freigegeben outcome: approved - kind: end name: rejected label: Zurückgewiesen outcome: rejectedThe script enrich.ts
Section titled “The script enrich.ts”Hook: onDocumentArrived · Inputs: vendorName, invoiceDate, data table lieferanten · Return values: none
import { date, defineScript } from '@acriva/workflow-sdk';
export default defineScript({ hook: 'onDocumentArrived', async run(ctx) { const { vendorName, invoiceDate } = ctx.document.fields; if (vendorName == null) return; // The row whose key column (the vendor's name) holds the name, or null when the list has none. const vendor = await ctx.tables.lookup('lieferanten', vendorName); if (vendor === null) { ctx.hint( `„${vendorName}“ steht nicht in der Lieferantenliste. Bitte ergänzen Sie den Lieferanten in der Datentabelle Lieferanten.`, ); return; } if (vendor.gesperrt) { ctx.addTag('Prüfen'); ctx.hint( `„${vendorName}“ ist in der Lieferantenliste gesperrt. Bitte klären Sie, ob die Rechnung bezahlt wird.`, ); } if (vendor.kreditorenkonto) ctx.setField('creditorAccount', vendor.kreditorenkonto); if (invoiceDate != null && vendor.zahlungszielTage != null) ctx.setField('paymentDue', date.addDays(invoiceDate, vendor.zahlungszielTage)); },});What it does
Section titled “What it does”A test runs each of these cases in the sandbox and compares the result.
A blocked vendor
Section titled “A blocked vendor”- Input:
vendorNameBillig-Druck Ltd.,invoiceDate2026-10-15 - Data table
lieferanten: 3 rowsnameTelekom Deutschland GmbH,kreditorenkonto70012,zahlungszielTage30,gesperrtfalsenameBürobedarf Schmidt KG,kreditorenkonto70044,zahlungszielTage14,gesperrtfalsenameBillig-Druck Ltd.,kreditorenkonto70091,zahlungszielTagenull,gesperrttrue
- Exit: the default next step
- Changes: tag “Prüfen”; hint on the next task: “„Billig-Druck Ltd.“ ist in der Lieferantenliste gesperrt. Bitte klären Sie, ob die Rechnung bezahlt wird.”; field
creditorAccount=70091
A vendor on the list
Section titled “A vendor on the list”- Input:
vendorNameTelekom Deutschland GmbH,invoiceDate2026-10-15 - Data table
lieferanten: 3 rowsnameTelekom Deutschland GmbH,kreditorenkonto70012,zahlungszielTage30,gesperrtfalsenameBürobedarf Schmidt KG,kreditorenkonto70044,zahlungszielTage14,gesperrtfalsenameBillig-Druck Ltd.,kreditorenkonto70091,zahlungszielTagenull,gesperrttrue
- Exit: the default next step
- Changes: field
creditorAccount=70012; fieldpaymentDue=2026-11-14
A vendor missing from the list
Section titled “A vendor missing from the list”- Input:
vendorNameNeue Firma AG,invoiceDate2026-10-15 - Data table
lieferanten: 3 rowsnameTelekom Deutschland GmbH,kreditorenkonto70012,zahlungszielTage30,gesperrtfalsenameBürobedarf Schmidt KG,kreditorenkonto70044,zahlungszielTage14,gesperrtfalsenameBillig-Druck Ltd.,kreditorenkonto70091,zahlungszielTagenull,gesperrttrue
- Exit: the default next step
- Changes: hint on the next task: “„Neue Firma AG“ steht nicht in der Lieferantenliste. Bitte ergänzen Sie den Lieferanten in der Datentabelle Lieferanten.”