# 🚪 Main

In PAW Template, the process flow is built on a standard structure that progresses through defined steps from start to close.

This structure provides the process with:

* A controlled start,
* Preparation of the data,
* Processing and proper termination.

  

The flow basically consists of the following steps:


1. **Set Config (Start)**
2. **Add To Process (Data Preparation)**
3. **Automate Process (Data Processing)**
4. **End (Closing)**

 ![Main Workflow, PAW State Machine](https://outline-production-attachments.s3-accelerate.amazonaws.com/uploads/16a71ae5-139a-40ac-a944-e134297802cb/9baa37f2-58b7-4a30-9179-a7fca8b7cbef/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4EOUDTOVUICLPZ4P%2F20261123%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261123T234500Z&X-Amz-Expires=86400&X-Amz-Signature=6548b5f32b534ca1c91f34c75e86d0c2ff0d610f287f1e0ea17639199cdd6650&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =1166x975")







---

### 🟢 Set Config (Configuration Loading)

This step runs at the start of the process and is responsible for loading the required configuration information.

In this step:

* It is checked whether a config is defined for the process in Orchestrator,
* If the config exists, it is read into the **dictConfig** variable,
* If there is no config, the process continues to run without interruption.

> Using a config is not mandatory; it is optional depending on the needs of the process.
>
> 

#### 🧠 Design Note

To reduce config dependency within the Template:

* Critical control parameters are managed through **arguments**.
* This way, processes can also run without needing external dependencies.

  

### **Data Preparation and Processing Layers**

In PAW Template, the process flow proceeds along two main processing branches:

* **Data Preparation Layer (Add To Process)**
* **Data Processing Layer (Automate Process)**

This structure makes processes more modular, sustainable and manageable.


---

### **📥 Add To Process (Data Preparation)**

The **Add To Process** step on the left branch represents the data preparation layer.

In this step:

* Data to be processed is collected from different sources
* Required data transformations and adjustments are made
* Data is brought into a standard format
* Prepared records are added to the queue structure

The purpose is to make the data ready for processing.


---

### **⚙️ Automate Process (Data Processing)**

The **Automate Process** step on the right branch represents the data processing layer.

In this step:

* A record is taken from the queue
* The relevant business rules are applied
* The required system operations are performed
* The result of the operation is evaluated and logged per record

This stage is the layer where the main workload of the process takes place.


---

### 🔴 End (Process Closing)

This is the closing step that runs after the process is completed.

In this step:

* End-of-process operations are performed
* The required cleanup (reset) operations are done
* Reporting steps are run

  

#### 📊 Content Report Integration

If the developer wants to report at the end of the process:

* They can integrate these reports into the **End** step by filling in the workflows under the `Content Reports` folder

#### 🔄 Reset Mechanism

* Variables used throughout the process are reset,
* The system is made ready for the next run.


---

### 🔁 Flow Summary

* **Set Config →** Configuration is loaded (optional)
* **Add To Process →** Prepares the data and adds it to the queue
* **Automate Process →** Processes the data in the queue
* **End →** Closes the process

### 🎯 Benefits

Thanks to this structure:

* Processes become modular
* Data preparation and processing steps are separated
* Configuration dependency is reduced
* End-of-process operations become standard
* More stable operation is achieved with large data sets


---

### 📌 Development Note

Teams developing processes are advised to observe the following separation:

* Configuration and startup settings → **Set Config**
* Data collection and preparation operations → **Add To Process**
* Business rules and operational tasks → **Automate Process**
* Reporting and cleanup operations → **End**