Configure a leave approval workflow
This walkthrough builds the most common gov-app workflow:
When a staff member submits a leave application, route it to their supervisor. If approved, mark the record
approvedand email the applicant. If rejected, markrejectedand email a reason.
You will end up with: 1 Start, 1 Approval Task, 1 Decision, 2 Actions (emails), 2 Ends.
Before you start
You need:
- A table for leave applications, with at least these fields:
staff_id,start_date,end_date,days,status,reason. - A status field that uses a Dropdown type with values like
submitted,approved,rejected. - An assignment rule for "Supervisor" — set up under Roles & Permissions → Assignment Rules.
Steps
1. Create the workflow
- Open Build -> Workflows and click New workflow.
- Name it
Leave approval. - Pick the table — Leave Applications.
- Trigger event —
record.status_changed. - Trigger field —
status. - Trigger config —
from: any,to: submitted. The workflow now only runs when an application becomessubmitted.
2. Add the Start node
The Start node is created automatically. Leave it as-is.
3. Add the Approval Task
- Drag in an Approval Task node. Label it
Supervisor review. - Assignee: pick the Supervisor assignment rule.
- Approve outcome: name it
approved. - Reject outcome: name it
rejected. - Connect the Start node → Supervisor review.
4. Add a Decision after the Approval
The Approval Task itself emits two outcomes (approved / rejected),
but you can also add a Decision afterwards if your routing depends
on extra conditions (e.g. long leaves go to HR).
For the simple case, skip the Decision and connect the Approval Task's outcomes straight to the right Actions.
5. Add the "Approved" branch
- Drag in an Action node. Label it
Mark approved. - Action type: Update field. Field:
status. Value:approved. - Connect Supervisor review → Mark approved on the approved edge.
- Drag in another Action node. Label it
Email applicant — approved. - Action type: Send email. Template:
leave-approved. To:staff.email. - Connect Mark approved → Email applicant — approved.
- Drag in an End node. Label it
Approved. - Connect Email applicant — approved → Approved.
6. Add the "Rejected" branch
Repeat step 5, but with rejected values and a leave-rejected
template. End node label: Rejected.
7. Save and review
Open the Checklist tab in the Assistant drawer. You should see all green ticks. If anything fails, fix it before publishing.
8. Publish
Click Publish at the top right of the workflow editor. The workflow is now live and will run on the next status change.
What happens at runtime
- Creator submits a leave application —
statusflips tosubmitted. - Workflow trigger fires.
- Supervisor sees the request in their inbox.
- Supervisor approves or rejects.
- The chosen branch runs — field updates and email send happen automatically.
- End node logged in the workflow audit trail.