Shopify Flow - New Run code action
The Run code action makes it possible to do many things that were not possible before. Common use case include:
- Counting the number of certain types of items in a list
- Computing the value for complex metafields like lists
- Transforming data like dates and numbers so that they can be used in conditions
Your code can leverage any data provided by prior steps in the workflow in order to execute the code. These inputs are specified as a GraphQL query, and are available as JSON objects to your code. Your code will typically return one or more output variables. You can return simple scalars, lists, and objects. So that subsequent actions know what the code can return, you will specify the output as a GraphQL type.