> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Selection Guide

> Purpose: Help developers and AI agents choose the correct workflow system for their use case.

**Purpose:** Help developers and AI agents choose the correct workflow system for their use case.

**Last Updated:** 2026-02-01

***

## Quick Decision

| I need to...                                               | Use This           | Spec                                                                       |
| ---------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------- |
| **Trigger actions** on events (form submit, record create) | Automation Engine  | [FW-03](../../../specs/fw/archive/FW-03-automation-engine.md)              |
| **Build complex workflows** with visual designer           | Workflow Builder   | [FW-06](../../../specs/fw/archive/FW-06-advanced-workflow-builder.md)      |
| **Reuse automation patterns** across organizations         | Workflow Templates | [FW-28](../../../specs/fw/archive/FW-28-workflow-templates-marketplace.md) |
| **Route items for approval** with chains                   | Approval Workflows | [FW-34](../../../specs/fw/archive/FW-34-approval-workflows.md)             |

***

## Decision Tree

```
I need workflow automation:
│
├─ Is it a SIMPLE trigger → action pattern?
│   │
│   ├─ YES: Is it a one-time setup?
│   │   │
│   │   ├─ YES → Use Automation Engine (FW-03)
│   │   │   └─ Example: "When form submitted, send email"
│   │   │
│   │   └─ NO: Do you want to reuse it across orgs?
│   │       │
│   │       └─ YES → Use Workflow Templates (FW-28)
│   │           └─ Create template, clone for each org
│   │
│   └─ NO: Is it a COMPLEX multi-step flow?
│       │
│       ├─ YES: Does it involve human approvals?
│       │   │
│       │   ├─ YES: Is it a linear approval chain?
│       │   │   │
│       │   │   ├─ YES → Use Approval Workflows (FW-34)
│       │   │   │   └─ Example: "Submit → Manager → Director → Finance"
│       │   │   │
│       │   │   └─ NO: Complex routing with conditions?
│       │   │       │
│       │   │       └─ YES → Use Workflow Builder (FW-06)
│       │   │           └─ Example: "If amount > $10k, add VP approval"
│       │   │
│       │   └─ NO: Purely automated multi-step?
│       │       │
│       │       └─ YES → Use Workflow Builder (FW-06)
│       │           └─ Example: "Create record → Generate PDF → Send email → Update status"
│       │
│       └─ NO → Probably Automation Engine (FW-03)
```

***

## Detailed Comparison

### Automation Engine (FW-03)

**What it is:** Core infrastructure for trigger-based automation with conditions and actions.

**Best for:**

* ✅ Simple event-driven automation
* ✅ Form submission handlers
* ✅ Record change notifications
* ✅ Status update triggers
* ✅ Scheduled tasks (cron-style)

**Storage:** `fw_automations`, `fw_automation_triggers`, `fw_automation_actions`

**Key features:**

* Event triggers (form submit, record create/update/delete)
* Scheduled triggers (cron expressions)
* Condition evaluation
* Action execution (email, webhook, record update)
* Execution logging

**Example use cases:**

* Send welcome email when employee is created
* Notify manager when leave request is submitted
* Update resident status when bed is assigned
* Daily report generation

***

### Workflow Builder (FW-06)

**What it is:** Visual designer for complex multi-step workflows with branching, parallel paths, and conditions.

**Best for:**

* ✅ Complex business processes
* ✅ Conditional branching ("if X then Y else Z")
* ✅ Parallel execution paths
* ✅ Human-in-the-loop steps
* ✅ Long-running processes

**Storage:** `fw_workflows`, `fw_workflow_steps`, `fw_workflow_executions`

**Key features:**

* Visual drag-and-drop designer
* Node types: trigger, action, condition, approval, delay
* Parallel and sequential paths
* Workflow versioning
* Execution monitoring and debugging

**Example use cases:**

* Employee onboarding process (multiple parallel tracks)
* Invoice processing with conditional routing
* Incident escalation with time-based triggers
* Complex approval routing based on amount/type

***

### Workflow Templates (FW-28)

**What it is:** Reusable workflow patterns that can be cloned and customized by organizations.

**Best for:**

* ✅ Standardized processes across organizations
* ✅ Best practice automation patterns
* ✅ Marketplace distribution
* ✅ Quick-start workflow creation

**Storage:** `fw_workflow_templates`, `fw_workflow_template_ratings`

**Key features:**

* Template marketplace
* Clone and customize
* Version tracking
* Usage analytics
* Rating system

**Example use cases:**

* Standard employee onboarding workflow (clone and customize)
* Industry-standard compliance workflows
* Pre-built approval patterns
* Notification sequence templates

***

### Approval Workflows (FW-34)

**What it is:** Specialized system for routing items through approval chains with escalation and delegation.

**Best for:**

* ✅ Linear approval chains (A → B → C)
* ✅ Role-based approvals
* ✅ Escalation on timeout
* ✅ Delegation and reassignment
* ✅ Audit trail for compliance

**Storage:** `fw_approval_chains`, `fw_approval_requests`, `fw_approval_actions`

**Key features:**

* Multi-step approval chains
* Role-based or user-based approvers
* Timeout and escalation
* Delegation support
* Complete audit trail
* Integration with notifications

**Example use cases:**

* Leave request approval (Employee → Manager → HR)
* Purchase order approval (Requester → Manager → Finance)
* Policy approval (Author → Reviewer → Approver)
* Expense report approval with thresholds

***

## Side-by-Side Comparison

| Aspect              | FW-03 (Engine)   | FW-06 (Builder) | FW-28 (Templates) | FW-34 (Approvals) |
| ------------------- | ---------------- | --------------- | ----------------- | ----------------- |
| **Purpose**         | Trigger → Action | Complex flows   | Reusable patterns | Approval routing  |
| **Complexity**      | Simple           | Complex         | Varies            | Medium            |
| **Visual Designer** | ❌ No             | ✅ Yes           | ✅ Yes (via FW-06) | ❌ No              |
| **Branching**       | Basic            | Advanced        | Inherited         | Linear            |
| **Human Steps**     | ❌ No             | ✅ Yes           | ✅ Yes             | ✅ Yes (approvals) |
| **Templates**       | ❌ No             | ❌ No            | ✅ Yes             | ❌ No              |
| **Audit Trail**     | Basic            | Detailed        | Inherited         | Complete          |

***

## Feature Dependencies

```
FW-03 (Automation Engine) ← Base infrastructure
   │
   ├── FW-06 (Workflow Builder) ← Visual design
   │      │
   │      └── FW-28 (Workflow Templates) ← Reusable patterns
   │
   └── FW-34 (Approval Workflows) ← Specialized approvals
```

**Note:** FW-03 is the foundation. FW-06 builds on it for visual design. FW-28 packages FW-06 workflows as templates. FW-34 is a specialized approval system that can integrate with FW-03/06.

***

## Common Mistakes

### ❌ Using Automation Engine for Complex Flows

**Wrong:** Building a 10-step process with multiple conditions using FW-03

**Problem:**

* Hard to visualize and maintain
* No built-in parallel execution
* Difficult to debug

**Solution:** Use Workflow Builder (FW-06) for complex multi-step processes

***

### ❌ Using Workflow Builder for Simple Triggers

**Wrong:** Creating a workflow in FW-06 just to send an email on form submit

**Problem:**

* Overkill for simple trigger → action
* Unnecessary complexity
* Harder to maintain

**Solution:** Use Automation Engine (FW-03) for simple event-driven actions

***

### ❌ Building Custom Approval Logic in Workflow Builder

**Wrong:** Recreating approval chain logic manually in FW-06

**Problem:**

* Misses built-in escalation, delegation, timeout
* No standardized approval audit trail
* Duplicates FW-34 functionality

**Solution:** Use Approval Workflows (FW-34) for approval chains

***

### ❌ Duplicating Workflows Across Organizations

**Wrong:** Creating the same workflow manually in each organization

**Problem:**

* No consistency across orgs
* Updates require manual changes everywhere
* No best practice sharing

**Solution:** Use Workflow Templates (FW-28) to create once, clone many

***

## Integration Points

### Automation Engine (FW-03) integrates with:

* FW-01 (Form Builder) - Form submission triggers
* PF-10 (Notifications) - Send email/SMS actions
* Database triggers - Record change events

### Workflow Builder (FW-06) integrates with:

* FW-03 (Automation Engine) - Base execution
* FW-34 (Approval Workflows) - Approval nodes
* PF-10 (Notifications) - Notification actions

### Workflow Templates (FW-28) integrates with:

* FW-06 (Workflow Builder) - Template source
* Marketplace - Distribution

### Approval Workflows (FW-34) integrates with:

* FW-01 (Forms) - Approval triggers
* PF-10 (Notifications) - Approval notifications
* PF-02 (RBAC) - Role-based approvers

***

## Quick Reference Table

| Scenario                       | Recommended | Why                         |
| ------------------------------ | ----------- | --------------------------- |
| Send email when form submitted | FW-03       | Simple trigger → action     |
| Multi-step onboarding process  | FW-06       | Complex with parallel paths |
| Standard leave approval chain  | FW-34       | Built-in approval features  |
| Share workflow across orgs     | FW-28       | Template and clone          |
| Daily report generation        | FW-03       | Scheduled trigger           |
| Conditional routing by amount  | FW-06       | Complex branching           |
| Escalate if no response in 24h | FW-34       | Built-in escalation         |

***

## Related Documentation

* [TERMINOLOGY.md](../../architecture/standards/TERMINOLOGY.md) - Workflow terminology definitions
* [Wizard Selection Guide](./wizard-selection.md) - Choosing wizard types
* [Template Selection Guide](./template-selection.md) - Choosing template types
* [Clarity Analysis](./clarity-analysis.md) - Feature comparison
* FW README - FW module overview

***

**Last Updated:** 2026-02-01
