AfricaOSAfricaOS

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)

TriggerModulesDescription
Record CreatedAllNew record added
Record UpdatedAllField changed
Field ChangedAllSpecific field modified
Status ChangedAllWorkflow status transition
ScheduledAllTime-based (cron)
Webhook ReceivedAllExternal system calls
Button ClickedAllManual trigger on record
Form SubmittedAllPublic form submission
Payment ReceivedPaymentsInvoice paid, subscription renewed
Appointment BookedPatients, BookingsNew appointment
Stock LowStockBelow reorder point
Document SignedDocumentsE-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:

  1. Add Trigger - Select event
  2. Add Conditions - Filter (optional)
  3. Add Actions - What happens
  4. Connect - Link in sequence
  5. Test - Run with sample data
  6. Activate - Go live

Example: New Patient Onboarding

Trigger: Patient record created

Conditions: Patient type = "New"

Actions:

  1. Create Task → "Send Welcome Packet" → Assigned to Front Desk
  2. Send Email → "Welcome Template" → To Patient
  3. Create Appointment → "New Patient Consult" → Next available slot
  4. Send SMS → "Appointment Confirmation" → To Patient
  5. Wait 3 days
  6. 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:

  1. For each low-stock product:
    • Calculate order qty (Max - Current)
    • Create Purchase Order → Draft
    • Assign to Purchasing Manager
  2. 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:

  1. Wait 3 days
  2. Send Email → "Gentle Reminder" → To Customer
  3. Wait 7 days
  4. Send Email → "Firm Reminder" → To Customer + CC Sales Rep
  5. Wait 14 days
  6. Create Task → "Collection Call" → Assigned to AR Team
  7. If still unpaid after 30 days → Escalate to Manager

Advanced Features

Branching

If/Else paths:

If Amount > 10000
  → Require Manager Approval
Else
  → Auto-Approve

Loops

Process multiple records:

For each Order Item
  → Create Stock Reservation
  → Update Item Status

Parallel 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

  1. Start Simple - One trigger, few actions
  2. Name Clearly - "Invoice Overdue - Day 3 Reminder"
  3. Document Logic - Description field explains why
  4. Test Thoroughly - Use sandbox, test edge cases
  5. Monitor Initially - Watch first 100 runs
  6. Version Control - Don't edit live workflows
  7. Avoid Chains - Prefer single workflow over daisy-chained
  8. Idempotency - Safe to re-run without side effects

On this page