Skip to content

Notice deadline from the end date

When a contract arrives whose field Notice deadline is empty, the step Set field sets it to 90 days before the End date, without a script; a deadline the AI read from the contract stays. If the end date is empty, the notice deadline stays as it is, and the history says so. Then the management reviews the contract.

The workflow starts for every document of the type contract. Its file workflow.yaml:

$schema: 'https://docs.acriva.de/schemas/workflow.schema.json'
format: 1
schemaVersion: 5
sdk: '1.0.0'
key: notice-deadline
name: Kündigungsfrist setzen
template: custom
trigger:
documentType: contract
fields: []
start: noticeEmpty
steps:
- kind: condition
name: noticeEmpty
label: Kündigungsfrist leer?
branches:
- when:
kind: compare
field: noticeDate
operator: isEmpty
constants: []
next: deadline
default: review
- kind: setField
name: deadline
label: Kündigungsfrist setzen
assignments:
- field: noticeDate
source: datePlusDays
operands:
- endDate
days: -90
next: review
- kind: humanTask
name: review
label: Vertrag prüfen
taskKind: review
assignees: []
fallback:
kind: role
role: Geschäftsführung
options:
excludeRequester: false
excludeActorsOfSteps: []
pickFile: false
next: approved
onRejected: rejected
- kind: end
name: approved
label: Freigegeben
outcome: approved
- kind: end
name: rejected
label: Zurückgewiesen
outcome: rejected