> For the complete documentation index, see [llms.txt](https://docs.dckapintegrator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dckapintegrator.com/tutorials/workflow-builder-tutorial/3.-hello-system/3.7-lets-configure-variables.md).

# 3.7 🔧 Let's Configure Variables

You can configure workflow variables at different stages within your workflow steps.

#### Where Can You Configure Variables?

* System / API Call Steps
  * Pre-Step
  * Intermediate Step
  * Post-Step
* All Other Steps (except Console, Sleep, and Stop)
  * Pre-Step
  * Post-Step

#### Understanding When Each Stage Executes

**🔹 Pre-Step**

Executes before the step runs

* Used to:
  * Initialize variables
  * Set or update values needed for the step

**🔹 Intermediate Step (only for System / API Call steps)**

Executes after the API call is completed and before checking response conditions (branching)

* Used to:
  * Read API response
  * Update variables based on response data

**🔹 Post-Step**

* Executes after the step is fully completed

*Note: For steps like API Call, Decision and Loop, Post-Step runs only after all internal paths or iterations are completed.*

***

#### **Step 1: Configure API Step with Variables**

* Create a Batch Workflow
* Connect to BigCommerce – Get All Customers API

Under the Variables tab, configure:

**🔹 Pre-Step**

Initialize a variable:

`total = 0 (Number)`

**🔹 Intermediate Step**

`total = {{variables.total.increment()}}` (Number)

This increments the value after API call but before branching

**🔹 Post-Step**

`total = {{variables.total.increment()}}` (Number)

&#x20;This increments the value after all branching is completed

#### Step 2: Add Console in Success Path

* Under Response is Valid (Option A)
* Add a Console step: `{{variables.total}}`

#### Step 3: Add Console After API Step

* Add another Console step after the API step: `{{variables.total}}`

#### Step 4: Run the Workflow

* Enable Console Logs
* Save and click Sync Now&#x20;

**Output**

* Console inside success path → 1
* Console after API step → 2

#### ▶️  Execution Flow Explained

1. Pre-Step executes: `total = 0`
2. API Call executes
3. Intermediate Step executes: `total = 1`
4. Success Path (Option A) executes

   Console prints → 1
5. Post-Step executes

   `total = 2`
6. Next step after API executes

   Console prints → 2

#### 🎉 Ta da!  You have successfully unleashed the power of Workflow Variables

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dckapintegrator.com/tutorials/workflow-builder-tutorial/3.-hello-system/3.7-lets-configure-variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
