Skip to main content

Scheduled Workflows

Automate time-based actions like escalations, reminders, and automatic state changes.


Scheduled Trigger Types

SCHEDULED WORKFLOW AUTOMATION
═══════════════════════════════════════════════════════════════════════════════

┌─────────────────────────────────────────────────────────────────────────────┐
│ SCHEDULED TRANSITIONS │
│ ───────────────────── │
│ Automatically move to new state after delay │
│ Example: Auto-escalate if no approval after 48 hours │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│ SCHEDULED ACTIONS │
│ ───────────────── │
│ Execute action after delay without changing state │
│ Example: Send reminder email after 24 hours │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│ WORKFLOW INITIATION ON SCHEDULE │
│ ─────────────────────────────── │
│ Start workflow on scheduled basis │
│ Example: Daily review of pending items │
└─────────────────────────────────────────────────────────────────────────────┘

Scheduled Transitions

Auto-Escalation

AUTO-ESCALATION EXAMPLE
═══════════════════════════════════════════════════════════════════════════════

Escalate to director if manager doesn't respond in 2 days:

Day 0 Day 2 (No Response) Resolution
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ PENDING │ ─────→ │ DIRECTOR │ ─────────→ │ APPROVED/ │
│ MANAGER │ auto │ REVIEW │ button │ REJECTED │
└───────────┘ └───────────┘ └───────────┘

Scheduled Transition Configuration:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Name: Auto Escalate to Director │
│ From State: Pending Manager Approval │
│ To State: Pending Director Approval │
│ Trigger: Scheduled │
│ │
│ Schedule: │
│ Delay: 2 │
│ Delay Unit: Days │
│ │
│ Entry Actions (on Director state): │
│ • Send email to Director │
│ • Send notification to Manager (escalation notice) │
│ • Update custom field: escalation_count + 1 │
└─────────────────────────────────────────────────────────────────────────────┘

XML:
<workflowtransition scriptid="trans_auto_escalate">
<name>Auto Escalate</name>
<tostate>workflowstate_director</tostate>
<scheduledaction>
<delay>2</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
</workflowtransition>

Auto-Rejection

AUTO-REJECTION AFTER TIMEOUT
═══════════════════════════════════════════════════════════════════════════════

Auto-reject if no response after 7 days:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Configuration: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Transition: Auto Reject │ │
│ │ From: Pending Approval │ │
│ │ To: Rejected │ │
│ │ │ │
│ │ Schedule: │ │
│ │ Delay: 7 Days │ │
│ │ │ │
│ │ Condition: (optional) │ │
│ │ Only if no activity on record │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

Timeline:
Day 0 Day 2 Day 5 Day 7
│ │ │ │
Submitted Reminder 1 Reminder 2 AUTO-REJECT
│ │ │ │
└──────────────┴─────────────┴─────────────┘
Pending State

Scheduled Actions (Reminders)

Email Reminders

REMINDER EMAIL SEQUENCE
═══════════════════════════════════════════════════════════════════════════════

Send reminder emails at intervals without changing state:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Pending Approval State - Scheduled Actions: │
│ │
│ Action 1: First Reminder │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Trigger: After 24 hours │ │
│ │ Action: Send Email │ │
│ │ To: Approver │ │
│ │ Subject: Reminder: Approval Required for {tranid} │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Action 2: Second Reminder │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Trigger: After 48 hours │ │
│ │ Action: Send Email │ │
│ │ To: Approver + Manager │ │
│ │ Subject: URGENT: Approval Required for {tranid} │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Action 3: Final Warning │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Trigger: After 72 hours │ │
│ │ Action: Send Email │ │
│ │ To: Approver + Manager + Director │ │
│ │ Subject: FINAL: Auto-reject in 24 hours - {tranid} │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

XML:
<workflowactions triggertype="SCHEDULED">
<sendemailaction>
<scheduledaction>
<delay>1</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
<recipientfield>custbody_approver</recipientfield>
<subject>Reminder: Approval Required for {tranid}</subject>
</sendemailaction>
</workflowactions>

Delay Units

AVAILABLE DELAY UNITS
═══════════════════════════════════════════════════════════════════════════════

┌─────────────────────────────────────────────────────────────────────────────┐
│ Unit │ XML Value │ Use Case │
├─────────────┼──────────────┼────────────────────────────────────────────────┤
│ Minutes │ MINUTES │ Quick follow-ups, urgent notifications │
│ Hours │ HOURS │ Same-day reminders, short escalations │
│ Days │ DAYS │ Standard approval timeouts │
│ Weeks │ WEEKS │ Long-term follow-ups │
│ Months │ MONTHS │ Contract renewals, annual reviews │
└─────────────┴──────────────┴────────────────────────────────────────────────┘

Examples:
┌─────────────────────────────────────────────────────────────────────────────┐
│ <delay>30</delay> │
│ <delayunit>MINUTES</delayunit> │
│ Result: Triggers 30 minutes after entering state │
├─────────────────────────────────────────────────────────────────────────────┤
│ <delay>4</delay> │
│ <delayunit>HOURS</delayunit> │
│ Result: Triggers 4 hours after entering state │
├─────────────────────────────────────────────────────────────────────────────┤
│ <delay>2</delay> │
│ <delayunit>DAYS</delayunit> │
│ Result: Triggers 2 days after entering state │
└─────────────────────────────────────────────────────────────────────────────┘

Conditional Scheduled Actions

Only Fire If Condition Met

CONDITIONAL SCHEDULING
═══════════════════════════════════════════════════════════════════════════════

Only execute scheduled action if condition still true:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Scheduled Transition: Auto-Escalate │
│ │
│ Delay: 2 Days │
│ Condition: {approvalstatus} = 'Pending' │
│ │
│ Behavior: │
│ • After 2 days, workflow checks condition │
│ • If still pending → escalate │
│ • If already approved/rejected → do nothing │
└─────────────────────────────────────────────────────────────────────────────┘

XML:
<workflowtransition scriptid="trans_auto_escalate">
<tostate>workflowstate_director</tostate>
<scheduledaction>
<delay>2</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
<condition>
<formula>{STDBODYAPPROVALSTATUS} = 'Pending Approval'</formula>
</condition>
</workflowtransition>

Multi-Level Escalation Pattern

TIERED ESCALATION WORKFLOW
═══════════════════════════════════════════════════════════════════════════════

Day 0 Day 2 Day 4 Day 6
│ │ │ │
▼ ▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ PENDING │ → │MANAGER │ → │DIRECTOR │ → │ CFO │
│ SUBMIT │auto │ REVIEW │auto │ REVIEW │auto │ REVIEW │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │ │ │
│ [Approve] [Approve] [Approve]
│ [Reject] [Reject] [Reject]
│ │ │ │
└────────────────┴────────────────┴────────────────┘


┌─────────────────┐
│ APPROVED/REJECTED│
└─────────────────┘

Configuration for Each Level:

Manager State:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Entry Actions: │
│ • Set status = "Pending Manager" │
│ • Email manager │
│ │
│ Transitions: │
│ • Approve → Approved (button) │
│ • Reject → Rejected (button) │
│ • Auto-Escalate → Director (scheduled, 2 days) │
└─────────────────────────────────────────────────────────────────────────────┘

Director State:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Entry Actions: │
│ • Set status = "Pending Director" │
│ • Email director │
│ • Email manager (escalation notice) │
│ │
│ Transitions: │
│ • Approve → Approved (button) │
│ • Reject → Rejected (button) │
│ • Auto-Escalate → CFO (scheduled, 2 days) │
└─────────────────────────────────────────────────────────────────────────────┘

Business Hours Consideration

SCHEDULED TIMING NOTES
═══════════════════════════════════════════════════════════════════════════════

Important: Scheduled actions run on calendar time, not business hours!

┌─────────────────────────────────────────────────────────────────────────────┐
│ If workflow enters state Friday 5pm with 2-day delay: │
│ │
│ Friday 5pm Saturday Sunday Monday Tuesday │
│ │ (Day 1) (Day 2) │ │ │
│ Submit Escalate │
│ Sunday 5pm │
│ │
│ The scheduled action fires Sunday, not Tuesday! │
└─────────────────────────────────────────────────────────────────────────────┘

Workaround for Business Days:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Option 1: Use longer delays to account for weekends │
│ (2 days → 4 days for business-day equivalent) │
│ │
│ Option 2: Use Workflow Action Script with business day logic │
│ Calculate next business day in script │
│ │
│ Option 3: Add condition to check if business day │
│ Only escalate if current day is weekday │
└─────────────────────────────────────────────────────────────────────────────┘

SLA Monitoring Pattern

SLA MONITORING WORKFLOW
═══════════════════════════════════════════════════════════════════════════════

Track response time against SLA targets:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Case Management SLA: │
│ │
│ Priority │ First Response │ Resolution │ Escalate After │
│ ───────────┼────────────────┼─────────────┼─────────────────────────────── │
│ Critical │ 1 hour │ 4 hours │ 30 minutes │
│ High │ 4 hours │ 8 hours │ 2 hours │
│ Medium │ 8 hours │ 24 hours │ 4 hours │
│ Low │ 24 hours │ 72 hours │ 12 hours │
└─────────────────────────────────────────────────────────────────────────────┘

Workflow Implementation:

State: Awaiting Response
┌─────────────────────────────────────────────────────────────────────────────┐
│ Scheduled Actions by Priority: │
│ │
│ Critical Escalation: │
│ Delay: 30 Minutes │
│ Condition: {priority} = 'Critical' AND {status} = 'Awaiting Response' │
│ Action: Email Manager + Set SLA Breach Flag │
│ │
│ High Priority Escalation: │
│ Delay: 2 Hours │
│ Condition: {priority} = 'High' AND {status} = 'Awaiting Response' │
│ Action: Email Manager │
│ │
│ (Similar for Medium, Low) │
└─────────────────────────────────────────────────────────────────────────────┘

Complete Scheduled Workflow Example

<?xml version="1.0" encoding="UTF-8"?>
<workflow scriptid="custworkflow_approval_sla">
<name>Approval with SLA</name>
<recordtype>vendorbill</recordtype>
<initoncreate>T</initoncreate>

<workflowstates>
<!-- Pending Manager State -->
<workflowstate scriptid="state_pending_mgr">
<name>Pending Manager</name>

<!-- Entry Actions -->
<workflowactions triggertype="ENTRY">
<setfieldvalueaction>
<field>STDBODYAPPROVALSTATUS</field>
<value>Pending Approval</value>
</setfieldvalueaction>
<sendemailaction>
<recipientfield>custbody_approver</recipientfield>
<subject>Approval Required: {tranid}</subject>
</sendemailaction>
</workflowactions>

<!-- Scheduled Reminder (24 hours) -->
<workflowactions triggertype="SCHEDULED">
<sendemailaction>
<scheduledaction>
<delay>1</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
<recipientfield>custbody_approver</recipientfield>
<subject>REMINDER: Approval Required for {tranid}</subject>
</sendemailaction>
</workflowactions>

<!-- Transitions -->
<workflowtransitions>
<!-- Button: Approve -->
<workflowtransition scriptid="trans_approve">
<tostate>state_approved</tostate>
<buttonaction>
<label>Approve</label>
</buttonaction>
</workflowtransition>

<!-- Button: Reject -->
<workflowtransition scriptid="trans_reject">
<tostate>state_rejected</tostate>
<buttonaction>
<label>Reject</label>
</buttonaction>
</workflowtransition>

<!-- Scheduled: Auto-Escalate after 2 days -->
<workflowtransition scriptid="trans_escalate">
<tostate>state_pending_dir</tostate>
<scheduledaction>
<delay>2</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
<condition>
<formula>{STDBODYAPPROVALSTATUS} = 'Pending Approval'</formula>
</condition>
</workflowtransition>
</workflowtransitions>
</workflowstate>

<!-- Pending Director State -->
<workflowstate scriptid="state_pending_dir">
<name>Pending Director (Escalated)</name>

<workflowactions triggertype="ENTRY">
<setfieldvalueaction>
<field>STDBODYAPPROVALSTATUS</field>
<value>Escalated - Pending Director</value>
</setfieldvalueaction>
<sendemailaction>
<recipientfield>custbody_director</recipientfield>
<subject>ESCALATED: Approval Required for {tranid}</subject>
</sendemailaction>
</workflowactions>

<workflowtransitions>
<workflowtransition scriptid="trans_dir_approve">
<tostate>state_approved</tostate>
<buttonaction>
<label>Approve</label>
</buttonaction>
</workflowtransition>
<workflowtransition scriptid="trans_dir_reject">
<tostate>state_rejected</tostate>
<buttonaction>
<label>Reject</label>
</buttonaction>
</workflowtransition>
</workflowtransitions>
</workflowstate>

<!-- Approved/Rejected States -->
<workflowstate scriptid="state_approved">
<name>Approved</name>
<workflowactions triggertype="ENTRY">
<setfieldvalueaction>
<field>STDBODYAPPROVALSTATUS</field>
<value>Approved</value>
</setfieldvalueaction>
</workflowactions>
</workflowstate>

<workflowstate scriptid="state_rejected">
<name>Rejected</name>
<workflowactions triggertype="ENTRY">
<setfieldvalueaction>
<field>STDBODYAPPROVALSTATUS</field>
<value>Rejected</value>
</setfieldvalueaction>
</workflowactions>
</workflowstate>
</workflowstates>
</workflow>

Next Steps

GoalGo To
Design best practicesBest Practices →
Add custom script logicWorkflow Action Script →
Return to WorkflowsWorkflows Overview →