Use of Liquid variables in an IF condition

Topic summary

A user wants to create a Shopify Flow workflow that runs every Monday but only proceeds if the next day (Tuesday) falls within the first week of the month (1st-7th). The default schedule-based triggers lack this level of sophistication.

Problem: The user attempted to use Liquid variables directly in an IF condition but wasn’t sure if this was possible or where to enter the logic.

Solution provided: Liquid cannot be used directly within Flow conditions. Instead, the “Run code” action should be used before the condition to execute Liquid logic and generate variables that can then be evaluated in subsequent IF conditions.

Resources shared:

  • GitHub repository with Flow code examples similar to this use case
  • Official Shopify documentation on the Run code action

Status: The original poster acknowledged the solution and plans to investigate the Run code action approach.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

You can’t use liquid in the condition, but you can before the condition using Run code. In fact there are some examples here that are similar to your use case:

https://github.com/Shopify/flow-code-examples/tree/main/run-code-examples

Which is linked to from this page:

https://help.shopify.com/en/manual/shopify-flow/reference/actions/run-code

2 Likes