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)
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
Output
- Console inside success path → 1
- Console after API step → 2
▶️ Execution Flow Explained
- Pre-Step executes:
total = 0 - API Call executes
- Intermediate Step executes:
total = 1 -
Success Path (Option A) executes
Console prints → 1
5. Post-Step executestotal = 2
6. Next step after API executesConsole prints → 2