Detect Changes Node in Pathways
The Detect Changes node is used to monitor specific variables or expressions within a workflow and detect if any changes occur after executing a series of tasks. This node helps identify dynamic changes in data during the workflow's runtime, enabling more responsive and adaptive process handling.
Configuration Fields
- Name:
- Description: The unique name of the "Detect Changes" node.
- Requirement: Optional but recommended for clarity in workflows.
- Tracked Expression:
- Description: Defines the variable or expression to monitor for changes during workflow execution.
- Options:
- Script: Use a script-based expression for complex logic and evaluations.
- Handlebars Template: Use a Handlebars-based template for straightforward dynamic evaluations.
- Requirement: Mandatory. You must specify the tracked expression.
- Output Flag Variable Name:
- Description: The name of the output variable that will store a flag indicating whether a change was detected.
- Values:
- The output variable will be assigned a boolean value:
- true: If a change in the tracked expression is detected.
- false: If no change is detected.
- The output variable will be assigned a boolean value:
- Requirement: Mandatory.
Usage Example
- Scenario:
- Monitor the status of a database query result during a workflow. If the result changes (e.g., a new record is added), trigger a subsequent task to process the updated data.
- Setup:
- Set Tracked Expression to evaluate the database query output.
- Specify an output flag variable name like isChanged.
- Use a conditional node later in the workflow to check the isChanged flag and decide the next steps.
Key Features
- Dynamic Monitoring: Tracks changes to expressions or variables in real time.
- Customizable Expressions: Supports both script-based and Handlebars Template logic.
- Change Detection Output: Provides a boolean flag for conditional logic downstream in the workflow.
This node is essential for workflows that depend on detecting changes in state or data to trigger dynamic actions.