# Example of Workflow Template

The Invoice Approval Workflow Template is an example of a predefined workflow used to manage the process of invoice verification and acceptance.

It demonstrates how tasks can be combined into a process, connected with dependencies, and supported by conditions that reflect business rules.

<mark style="color:$danger;">screenshot\_of\_configuration</mark>

### Structure of the Invoice Approval Workflow

The template consists of five tasks with different types and dependencies:

| Task ID | Label                | Type   | Activation Policy | Predecessors | Activation Condition           | Terminal | Action/Outcome                               |
| ------- | -------------------- | ------ | ----------------- | ------------ | ------------------------------ | -------- | -------------------------------------------- |
| T1      | Upload Invoice       | Manual | All               | -            | -                              | No       | Employee uploads invoice document            |
| T2      | Manager Acceptance   | Manual | All               | T1           | -                              | No       | Manager reviews and accepts invoice          |
| T3      | Check Invoice Amount | Script | All               | T2           | -                              | No       | System checks if total\_to\_transfer > 20000 |
| T4      | CFO Acceptance       | Manual | All               | T3           | IF total\_to\_transfer > 20000 | No       | CFO must accept invoice if condition is met  |
| T5      | Archive Document     | Manual | Any               | T3,T4        | -                              | Yes      | Invoice marked as finalized and archived     |

### **Process Flow**

1. Start: Employee uploads invoice (T1).
2. Manager Acceptance (T2): Task is activated automatically once T1 is completed.
3. System Validation (T3): Script checks the invoice amount.
   * If amount ≤ 20000 → process continues directly to Archiving (T5).
   * If amount > 20000 → CFO Acceptance (T4) must be performed.
4. CFO Acceptance (T4): Required only if the condition is met.
5. Archiving (T5): Final task; invoice is marked as approved and archived.

### Referenced Objects

This workflow template typically references the Expenses\_Incomes object (invoice).

Fields used in conditions include:

* total\_to\_transfer
* state
