Workflows & Automation
Automate processes across modules with workflows
Workflows & Automation
Automate repetitive tasks, enforce processes, and connect modules with workflows.
Overview
Workflows are "if this, then that" automations that run across your modules. They replace manual handoffs, reduce errors, and ensure consistency.
Workflow Components
Triggers (When)
| Trigger | Modules | Description |
|---|---|---|
| Record Created | All | New record added |
| Record Updated | All | Field changed |
| Field Changed | All | Specific field modified |
| Status Changed | All | Workflow status transition |
| Scheduled | All | Time-based (cron) |
| Webhook Received | All | External system calls |
| Button Clicked | All | Manual trigger on record |
| Form Submitted | All | Public form submission |
| Payment Received | Payments | Invoice paid, subscription renewed |
| Appointment Booked | Patients, Bookings | New appointment |
| Stock Low | Stock | Below reorder point |
| Document Signed | Documents | E-signature completed |
Conditions (If)
Filter when actions run:
- Field Equals - Status = "Confirmed"
- Field Contains - Email contains "@company.com"
- Field Greater/Less - Amount > 1000
- Date Relative - Due date within 7 days
- User Role - Current user is "Manager"
- Custom Formula - JavaScript expression
- All/Any - Combine multiple conditions
Actions (Then)
Record Actions:
- Create record (any module)
- Update record (same or related)
- Delete record
- Clone record
- Link records (create relationship)
Communication Actions:
- Send email (template + recipients)
- Send SMS/WhatsApp
- Send in-app notification
- Send webhook (JSON payload)
- Post to Slack/Teams
Process Actions:
- Assign task (to user, role, queue)
- Start approval process
- Generate document (PDF, Word)
- Run script (TypeScript)
- Call API (REST, GraphQL)
- Wait (pause for duration or event)
Data Actions:
- Export to CSV/Excel
- Sync to external system
- Calculate/rollup fields
- Archive old records
Building Workflows
Visual Builder
Drag-and-drop interface:
- Add Trigger - Select event
- Add Conditions - Filter (optional)
- Add Actions - What happens
- Connect - Link in sequence
- Test - Run with sample data
- Activate - Go live
Example: New Patient Onboarding
Trigger: Patient record created
Conditions: Patient type = "New"
Actions:
- Create Task → "Send Welcome Packet" → Assigned to Front Desk
- Send Email → "Welcome Template" → To Patient
- Create Appointment → "New Patient Consult" → Next available slot
- Send SMS → "Appointment Confirmation" → To Patient
- Wait 3 days
- If Appointment not completed → Send Reminder Email
Example: Low Stock Reorder
Trigger: Scheduled (Daily 6 AM)
Conditions: Stock level ≤ Reorder Point AND Status = "Active"
Actions:
- For each low-stock product:
- Calculate order qty (Max - Current)
- Create Purchase Order → Draft
- Assign to Purchasing Manager
- Send Summary Email → "Daily Reorder Report" → To Purchasing Team
Example: Invoice Payment Follow-up
Trigger: Invoice status changed to "Overdue"
Conditions: Amount > 0 AND Customer not on payment plan
Actions:
- Wait 3 days
- Send Email → "Gentle Reminder" → To Customer
- Wait 7 days
- Send Email → "Firm Reminder" → To Customer + CC Sales Rep
- Wait 14 days
- Create Task → "Collection Call" → Assigned to AR Team
- If still unpaid after 30 days → Escalate to Manager
Advanced Features
Branching
If/Else paths:
If Amount > 10000
→ Require Manager Approval
Else
→ Auto-ApproveLoops
Process multiple records:
For each Order Item
→ Create Stock Reservation
→ Update Item StatusParallel Execution
Run actions simultaneously:
Send Email → Customer
Send Slack → Sales Channel
Create Task → Account Manager
(All at once)Error Handling
- Retry - Auto-retry failed actions (configurable)
- Fallback - Alternative action on failure
- Alert - Notify admin on workflow error
- Dead Letter - Queue failed runs for manual review
Versioning
- Draft → Published → Archived
- Rollback to previous version
- A/B test workflow versions
- Change log with author, timestamp
Monitoring
Dashboard
- Active workflows count
- Runs today/week/month
- Success rate %
- Average execution time
- Failed runs (last 24h)
Run History
- Trigger data
- Condition evaluation
- Action results (success/failed)
- Execution time per step
- Error details
Alerts
- Failure rate > threshold
- Execution time > threshold
- Queue backlog growing
- Specific workflow failures
Best Practices
- Start Simple - One trigger, few actions
- Name Clearly - "Invoice Overdue - Day 3 Reminder"
- Document Logic - Description field explains why
- Test Thoroughly - Use sandbox, test edge cases
- Monitor Initially - Watch first 100 runs
- Version Control - Don't edit live workflows
- Avoid Chains - Prefer single workflow over daisy-chained
- Idempotency - Safe to re-run without side effects