Skip to content

Workflows, Rules and Validations ​

Concepts ​

Three tools automate business logic. Choose by what you need:

ToolRunsFor
Validationwhen data is saved"this value is not allowed" (reusable, tenant-wide library)
Ruleat a moment in a record's life (before / after create, update, delete)reject a save, set or compute a field, start a workflow, run a service
Workflowover days, across peoplestages, approvals, deadlines, escalation

A workflow is a set of stages (states) joined by transitions. Each stage can have human tasks (an approval) or a subworkflow. Transitions carry conditions evaluated on the instance's context ({"field": "amount", "op": "gt", "value": 500}, combined with all / any). A running copy is an instance, and every move is recorded in its history.

Problem statement ​

A loan of anything worth over 500 must be approved by the facilities manager within two days; otherwise it goes to the department head. Late returns should notify the borrower. You need a rule that starts the approval when a loan is created, a workflow with a deadline, and a validation on the deposit.

All features ​

Workflow Designer Workflow designer

  • Canvas with Start, stages, End; Properties panel; tabs Problems, Transitions, Simulate, History.
  • Human approval tasks, with approvers fixed by role, by context (${context.manager}, resolved per instance) or by a rule (${rule.name}); ad-hoc add an approver at run time.
  • Conditions on transitions with all / any groups.
  • Parallel gateways: mark two or more transitions parallel to run branches at once and join afterward.
  • SLA timers with escalation (reassign) and on breach stage (force the instance to another stage).
  • Subworkflow (call another workflow as one step).
  • Bulk decide in the Task inbox: approve many at once.
  • Simulate with sample data, in memory, no records written.
  • Notifications on state changes, Generate with AI from a sentence, History of versions.

Rule Designer

  • When: before or after create, update, delete.
  • Only if: conditions on fields.
  • Then: reject with a message, set a value (computed or defaulted field), start a workflow, execute a service. Edit as JSON for lookups and expressions.

Validations: a library of named checks (pattern, range, cross-field expression) that forms and entities reuse.

Step by step ​

Approval workflow

  1. Workflows, New. Name loan-approval.
  2. Drag stages: request (Start), manager, head, approved, rejected.
  3. Add a human task to manager: approver role FACILITIES_MANAGER.
  4. Transition request to manager with condition deposit > 500; another straight to approved otherwise.
  5. In the SLA panel for manager: 2880 minutes (two days), on breach stage head.
  6. manager to approved on approve, to rejected on reject.
  7. Simulate with {"deposit": 700}: the path goes request, manager. With {"deposit": 100} it goes straight to approved.
  8. Publish.

Rule that starts it

  1. Rules, New. When after create on equipment_loan.
  2. Only if deposit greater than 500.
  3. Then start workflow loan-approval. Save and publish.

Validation

  1. Validations, New: deposit-not-negative, field deposit, minimum 0, message "Deposit cannot be negative". Use it from the form's Use from Validation Library and on the entity.

Check it worked ​

Create a loan over 500. A task appears in the manager's Task inbox. Approve it and the instance history shows each move. Create one under 500: no task.

Common mistakes ​

  • A stage with no outgoing transition (Problems flags it).
  • Two rules that set the same field: keep one owner per field.
  • Fixing approvers by person: use a role or context so it survives staff changes.
  • Publishing without Simulate.

Next ​

Security: who may act on tasks (Approval permissions).