Skip to main content

[Workflow Builder - GCW] Understanding Workflow Context and its Impact on Activity Configuration

Anastasiia Zbrozhek avatar
Written by Anastasiia Zbrozhek
Updated yesterday

This article explains why context is essential when building a workflow and how the structure of your workflow, particularly the use of batching, affects how activities should be configured. It focuses on how adding a batch activity early on will change the context for all subsequent steps, influencing how you define values and access payload data throughout your flow. Understanding this upfront can help you avoid misconfigurations and ensure smooth workflow execution.


Understanding Context in Workflow Configuration

When setting up a workflow, each activity you add operates within a certain context — this determines how data is accessed and passed between activities. If you're not considering the correct context while configuring your workflow, it can lead to confusion or errors later on.

Let’s break this down:

  • Without batching, each activity receives the input payload directly — for example:

    • payload.facility.country might be a typical reference for data early in the workflow.

  • With batching, the input changes — now your activities reference values from flow.batch.items, such as:

    • flow.batch.items.productUID

This shift in structure is what we mean by “context.” Once a batch activity is added, especially at the beginning of your flow, the data for subsequent steps must be accessed using batch-specific paths.


When and Why to Use a Batch Activity

If you're planning to group or process multiple items together (e.g., batching orders before building plates), it's best to add the Batch activity at the very beginning of your workflow. Doing this helps you:

  • Define a consistent data structure from the start.

  • Prevent configuration errors that happen when switching from non-batch to batch contexts midway through the setup.

  • Ensure all subsequent activities expect and use batched data properly.

Once batching is in place, your payload references will shift — so always configure your activities based on that batched structure.


Key Tip for Workflow Design

To maintain clarity and prevent issues:

  • Always start with a batch activity if your workflow involves grouped processing.

  • Remember that every activity after the batch will operate in a new context.

  • Configure each step accordingly by referencing the batched structure (e.g., flow.batch.items).


FAQ

Why does adding a batch activity change the payload structure?
Batching groups multiple items into a collection, which alters how individual data points are accessed in later steps. Instead of referencing a single item, you're now working within an array or grouped context.

What happens if I configure steps before batching?
If you configure steps before adding the batch and then introduce a batch later, you may need to revisit and adjust those steps. They might be pointing to outdated data paths.

Can I add a batch activity later in the workflow?
Technically yes, but it's not recommended. Adding it later can lead to inconsistent context and require more reconfiguration. For clarity and maintainability, it's best to start with batching if you know you’ll need it.


📝 Not what you needed?

Help us improve this article, send us an email to [email protected] — please include the article title.

Did this answer your question?