For the complete documentation index, see llms.txt. This page is also available as Markdown.

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)

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

  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

Last updated

Was this helpful?