Skip to content

Workflow Definition

Workflow Structure

workflows:
  WorkflowName:
    trigger: "afterSave|beforeSave|manual|scheduled"
    entity: "EntityName"
    isActive: true

    # Conditions
    conditions:
      - type: "fieldEquals"
        field: "status"
        value: "New"

      - type: "fieldChanged"
        field: "status"

      - type: "fieldIsEmpty"
        field: "assignedUserId"

      - type: "formula"
        formula: "entity.get('amount') > 10000"

    # Actions
    actions:
      - type: "notification"
        target: "role:Manager"
        template: "high_value_order"

      - type: "createEntity"
        entity: "Task"
        data:
          name: "Review order {entity.number}"
          assignedUserId: "{entity.assignedUserId}"
          dateEnd: "{dateAdd(now, 1, 'day')}"

      - type: "updateEntity"
        field: "status"
        value: "UnderReview"

      - type: "sendEmail"
        to: "{entity.contact.emailAddress}"
        template: "order_confirmation"

      - type: "executeFormula"
        formula: |
          entity.set('reviewDate', datetime.now());
          entity.set('reviewerId', user.id);

Trigger Types

Trigger Description
afterSave After record is saved
beforeSave Before record is saved
manual Manual run
scheduled Scheduled (cron)

Condition Types

Type Description
fieldEquals Field has a specific value
fieldChanged Field changed
fieldIsEmpty Field is empty
fieldIsNotEmpty Field is not empty
formula Custom formula

Action Types

Type Description
notification Send notification
createEntity Create record
updateEntity Update record
sendEmail Send e-mail
executeFormula Run formula
createTask Create task

➡️ Continue with Layouts.