WhatChanged

Detects changes in incoming content as a whole or in a specific field

Overview

This node, named "WhatChanged," is designed to detect changes in incoming data. It can either compare the entire content of each input item or focus on a specific field within the data. This functionality is useful in workflows where you want to trigger actions only when data has changed since the last execution, such as monitoring updates in records, filtering out unchanged data, or triggering notifications based on modifications.

For example, if you have a stream of user profile data and want to process only those profiles that have been updated since the last run, this node can help by comparing current data with previously stored data and outputting only the changed items.

Properties

Name Meaning
Watch Fields Whether to enable or disable watching for specific fields during comparison (boolean).
Field to Watch The specific field name to compare in the data when "Watch Fields" is enabled (string).

Output

The node outputs two separate streams:

  • True output: Contains items where changes were detected. If watching a specific field, these are items where that field's value has changed compared to the previous execution. If watching the whole content, these are items whose entire JSON content differs from before.
  • False output: Contains items where no changes were detected according to the selected mode.

Each output item retains the original JSON structure of the input data. There is no binary data output.

Dependencies

  • The node uses static workflow data storage to keep track of previous content or field values between executions.
  • No external services or API keys are required.

Troubleshooting

  • Issue: No items appear in the "true" output even though data seems to change.

    • Cause: The node compares data against what was stored in the previous run. If the workflow was just activated or the static data was cleared, it may not detect changes immediately.
    • Solution: Ensure the workflow runs at least twice with different data to establish a baseline for comparison.
  • Issue: Watching a specific field but changes are not detected.

    • Cause: The specified field name might be incorrect or missing in some input items.
    • Solution: Verify the field name matches exactly and exists in all relevant input items.
  • Error: Unexpected errors related to accessing fields.

    • Cause: Input data might not be consistent or the field path is invalid.
    • Solution: Validate input data structure and ensure the field to watch is present and accessible.

Links and References

Discussion