How process variables work in PROCESIO
Published: 2021-09-24 08:09:34

As a developer, many of the features in Procesio like process variables, data types or data models will look pretty familiar to you already. 

Process variables act as placeholders for data that can be accessed throughout the lifecycle of a process. When a process is running, it passes dynamic data between actions. 

A process variable has the following properties:

- **Name**

- **Data type**: can be either a primitive like string, integer, boolean or other, or it can be a custom type that you defined in the data model designer;

- **Default value**: the default process value that will be used at runtime if no other value is set

- **Single value or list flag**: a variable can be treated as a single value (default behavior) or a list of values

- **Set as Input or Output**: the variable value is expected to be set when starting the process, or you can mark it as output if you expect that data to be the result of the process, which will allow you to transfer that data to the client application.

##Creating a process variable

Go to the Process Designer section and open a new or an existing process.

Step 1:  On the process page, click on the Process Variables icon.

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/941d6017b742b08b72ddc665fe76c22f7b13d8e66b4225bfd31e0a3a688f15e71617362072305.png)

Step 2: Click on the “Add variable” button.

Step 3:  Process variable configuration

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/9133cc99c412640fe1c91f2f5c70839dea2b111dfb7062215e58c6b55be27c8fScreenshot%202021-08-05%20at%2016.17.54.png)


##Using Process Variables in process flows

When configuring an action you can insert process variables in inputs by pressing "#" or by clicking on "Add variable". Both will generate the Process Variables selector from where you can select the process variable you want to use.

For each Process Variable you can see:

- name
- type
- attributes (for Data models)
- list tag

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/bd7feda51c6df725481fceba53464c4b36e75fbba362978877ac69420977ca73Screenshot%202021-08-05%20at%2016.23.16.png)

Process Variables can be inserted in process flows in different ways:

1. Input process variable

2. Output process variable

3. Process variable used within process to pass dynamic data between actions

They can be easily identified in the Process Variables list: 

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/70562451f94b57619cf639ecced3a9bb31c86418c35148d2561fd9f3b12a7345Screenshot%202021-08-05%20at%2016.24.46.png)

Whenever you use process variables in a configuration, it is easy to visually differentiate values from process variables. Process variables are outlined in a colored pill, unlike values:

Example 1: CustomerAddress is a process variable sent as QueryParam in the Call API action:

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/92c7a55a8239673cae3542b762438ba4197fa68e1faa636539dccaca7c37a1441617375898598.png)

Example 2: amountValue is a process variable in Email Subject: 

![Process Variables](https://d258lu9myqkejp.cloudfront.net/attachment_images/92c7a55a8239673cae3542b762438ba4197fa68e1faa636539dccaca7c37a1441617375898598.png)

Log in to create or modify your process variables [here](https://procesio.app/).