# Tasks Execution Order

The following table details the execution order of a Task:

Task | Block
--- | ---
Task.Execute |
For each enabled Block\Sub Task: |
| Copy values to input pins
| Update tag inputs
| Internal Block Execution
| Update tag outputs
| Record Block execution time
If an error is encountered, then execute Task.OnError |
Increment CountSinceLastGC |
IF CountSinceLastGC == GC Frequency, then execute GC.Collect |
Set Task.ExecutionTime |
Execute Task.OnComplete |