When is productVariant.inventoryItem.updatedAt updated?

I’ve been poking at understanding inventory update performance through Flow, and can’t seem to get productVariant.inventoryItem.updatedAt to change for a given variant.

What will cause it to update? Changing price, inventory quantities or other fields doesn’t seem to update the field.

Or, I may be mis-understanding the field function. Help?

Thanks!


Here’s what I’m logging from a Product variant inventory quantity changed trigger.

{%- assign now_time_epoch = 'now' | date: "%s" -%}
{%- assign update_time_epoch = productVariant.inventoryItem.updatedAt | date: "%s" -%}
{%- assign elapsed_time = now_time_epoch | minus: update_time_epoch -%}
{%- assign time_message = "" -%}
{%- if elapsed_time > 3600 -%}
    {%- assign time_difference = elapsed_time | divided_by: 3600 -%}
    {%- assign time_message = " (" | append: time_difference | append: " hours!)" -%}
{%- endif -%}

Inventory has changed.
Product variant SKU: {{ productVariant.sku }}
Product variant: {{ productVariant.id }}
Variant item ID: {{ productVariant.inventoryItem.id }}
Variant inventory update time: {{ productVariant.inventoryItem.updatedAt }}
Log time: {{ 'now' | date: "%Y-%m-%dT%H:%M:%S" }}
Update/log difference : {{ elapsed_time }} seconds{{ time_message }}
Prior inventory quantity: {{ inventoryQuantityPrior }}
New inventory quantity: {{ productVariant.inventoryQuantity }}

And the output:

Inventory has changed.
Product variant SKU: test-product
Product variant: gid://shopify/ProductVariant/50162399412544
Variant item ID: gid://shopify/InventoryItem/51817452831040
Variant inventory update time: 2025-01-15T15:34:22Z
Log time: 2025-01-17T03:37:58
Update/log difference : 129816 seconds (36 hours!)
Prior inventory quantity: 3
New inventory quantity: 4

Not really a Flow question here but I’d expect that date would update when a field on the item changes, but possibly not the connections like on inventoryLevel or variants.

Thanks, Paul.

I posted here as I’ve been using the Product variant inventory quantity changed trigger from Flow, encountered the issue when I tried to collect timing data based on the productVariant.inventoryItem.updatedAt field. Apologies if I should have posted elsewhere.

My expectation is the same as yours. I gave up, as it doesn’t seem to update on changes to the inventory item, either to the item fields or the inventory levels. I did not explore if the behavior is the same outside of the flow context.

No need to apologize… my comment is just that the Flow team doesn’t know all the fields in the API - no one does. So sometimes its best to try another spot where experts in that area reside.