Contract closing
When a contract arrives, the workflow sets its “Contract status” to “In review”, with no script. Purchasing reviews the contract; then the management and accounting approve it in parallel, both must approve, and whoever reviewed it doesn’t approve it again. When someone rejects it, the contract goes back to “Draft” and the workflow ends. After the approval the status becomes “For signature”, and the card “Send for signature” sends the contract in order to the requesting person as “Auftraggeber” and to the contract partner as “Auftragnehmer”, with a simple electronic signature (SES) and 14 days to sign. When the partner’s first name, last name or email address is missing in the three fields the workflow declares on the contract, the requesting person enters them first in the task “Vertragspartner erfassen”. When both have signed (“signed”), the status becomes “Active”, and the requesting person chooses the partner’s file under “File” in the task “In die Vertragspartner-Akte ablegen”, and Acriva files the signed contract into it with their rights; a person always chooses the file, never the AI. The workflow doesn’t set the field “Counterparty file”: for “Check invoice against contract” to find the contract and for its deadlines to remind the file’s responsible person, a person links it on the contract. When someone declines (“declined”), the time runs out (“expired”) or the email address isn’t valid, the requesting person clears it up in the task “Klären”. The workflow needs a person who uploaded the contract, and the add-on E-signature.
The workflow
Section titled “The workflow”The workflow starts for every document of the type contract. Its file workflow.yaml:
$schema: 'https://docs.acriva.de/schemas/workflow.schema.json'format: 1schemaVersion: 9sdk: '1.0.0'key: contract-closingname: Vertragsabschlusstemplate: customtrigger: documentType: contractfields: - key: partnerFirstName kind: text labelDe: Vorname Vertragspartner labelEn: Partner's first name documentTypes: - contract - key: partnerLastName kind: text labelDe: Nachname Vertragspartner labelEn: Partner's last name documentTypes: - contract - key: partnerEmail kind: text labelDe: E-Mail Vertragspartner labelEn: Partner's email documentTypes: - contractstart: inReviewsteps: - kind: setField name: inReview label: Status „In Prüfung“ assignments: - field: contractStatus source: constant value: inReview next: review - kind: humanTask name: review label: Vertrag prüfen taskKind: review assignees: [] fallback: kind: member member: einkauf@example.com options: remindAfterWorkingDays: 2 excludeRequester: false excludeActorsOfSteps: [] pickFile: false next: approval onRejected: draft - kind: humanTask name: approval label: Freigabe durch Geschäftsführung und Buchhaltung taskKind: approve assignees: [] fallback: kind: role role: Geschäftsführung options: excludeRequester: false excludeActorsOfSteps: - review pickFile: false next: forSignature onRejected: draft parallelApproval: mode: all approvers: - kind: role role: Geschäftsführung - kind: role role: Buchhaltung - kind: setField name: forSignature label: Status „Zur Signatur“ assignments: - field: contractStatus source: constant value: forSignature next: partnerKnown - kind: condition name: partnerKnown label: Vertragspartner vollständig? branches: - when: kind: or conditions: - kind: compare field: partnerFirstName operator: isEmpty constants: [] - kind: compare field: partnerLastName operator: isEmpty constants: [] - kind: compare field: partnerEmail operator: isEmpty constants: [] next: capturePartner default: sign - kind: humanTask name: capturePartner label: Vertragspartner erfassen taskKind: capture assignees: [] fallback: kind: requester options: remindAfterWorkingDays: 2 excludeRequester: false excludeActorsOfSteps: [] pickFile: false next: sign requiredFields: fields: - partnerFirstName - partnerLastName - partnerEmail requireComment: false - kind: signature name: sign label: Zur Signatur senden signers: - kind: requester label: Auftraggeber - kind: external label: Auftragnehmer firstNameField: partnerFirstName lastNameField: partnerLastName emailField: partnerEmail ordered: true level: ses expiryDays: 14 fieldMode: detect reviewer: kind: requester allowConfidential: false language: de next: active onDeclined: clarify onExpired: clarify onSkipped: clarify - kind: setField name: active label: Status „Aktiv“ assignments: - field: contractStatus source: constant value: active next: file - kind: humanTask name: file label: In die Vertragspartner-Akte ablegen taskKind: acknowledge assignees: [] fallback: kind: requester options: remindAfterWorkingDays: 2 excludeRequester: false excludeActorsOfSteps: [] pickFile: true next: signed - kind: humanTask name: clarify label: Klären taskKind: review assignees: [] fallback: kind: requester options: excludeRequester: false excludeActorsOfSteps: [] pickFile: false next: notSigned onRejected: notSigned - kind: setField name: draft label: Status „Entwurf“ assignments: - field: contractStatus source: constant value: draft next: rejected - kind: end name: signed label: Signiert und aktiv outcome: completed - kind: end name: notSigned label: Nicht signiert outcome: completed - kind: end name: rejected label: Zurückgewiesen outcome: rejected