Skip to content

Wait for the delivery note

After the approval, the workflow waits with Wait for up to 7 days for a delivery note of the same vendor. When it arrives, the workflow shows it as a linked document to everyone who may open it. If it doesn’t, accounting hears at the timeout that it is missing. If it is already there, the workflow goes on at once. Any member who may file a delivery note with this vendor can end the wait.

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: 1
schemaVersion: 5
sdk: '1.0.0'
key: wait-for-delivery-note
name: Auf den Lieferschein warten
template: custom
trigger:
documentType: incoming-invoice
fields: []
start: approval
steps:
- kind: humanTask
name: approval
label: Freigabe Kostenstelle
taskKind: approve
assignees:
- when: null
assignee:
kind: costCenterResponsible
fallback:
kind: role
role: Buchhaltung
options:
excludeRequester: true
excludeActorsOfSteps: []
pickFile: false
next: waitForNote
onRejected: rejected
- kind: wait
name: waitForNote
label: Warten auf den Lieferschein
waitFor: document
field: vendorName
documentType: delivery-note
otherField: vendorName
timeoutDays: 7
next: approved
onTimeout: missingNote
- kind: notification
name: missingNote
label: Lieferschein fehlt
recipients:
- kind: role
role: Buchhaltung
notice: forInformation
next: approved
- kind: end
name: approved
label: Freigegeben
outcome: approved
- kind: end
name: rejected
label: Zurückgewiesen
outcome: rejected