Preview API data used in Shopify Flow
When you build a workflow, you might often want to use data from your store in conditions and actions. Shopify Flow accesses store data by calling the GraphQL Admin API, which means you have access to nearly all the fields in the API.
As you build a workflow, you will often encounter field names and descriptions based on the API, but you might need to know what data is output by the API. For example, you might want to know the app name for an order that was created from a draft order. In addition, you might want to make sure that your workflow outputs the data that you are expecting, or in the form that you are expecting.
To review the data, you have several options in Shopify Flow.
On this page
Find a field in the Shopify admin
In most cases, you can find data by looking in the Shopify Admin. For example, product.title
is listed on the Product page.
Use the field in a live workflow
You can safely use the fields in a workflow by making use of the Log output action. When you run a workflow, the Log output action will print the output of any variables and text to the Run history page. You can also use notification actions such as Send internal email.
Steps to use Log output:
- Choose a trigger that can be triggered manually.
- Add a Log output action to the workflow and connect it to the trigger.
- In the Log output configuration, click Add a variable to add the variables that you want to inspect to the Output section.
- When done, click Turn on workflow.
- Trigger the workflow, either by running it manually or by causing the trigger to fire. For example, if you're using the Order created trigger, then create a test order.
- After the workflow runs, check the activity log for the variables.
Refer to the resource JSON page
Most resource pages in the Shopify admin, such as the Order, Product, or Customer pages, allow you to view the data that serves the page. This data isn't exactly the same naming and format that Shopify Flow uses, but the values match what is in the GraphQL Admin API. To review the data, add .json
to the URL.
For example, navigate to an order by going in the Shopify admin to the Orders page and clicking an order. In the address of the page in the address bar of your browser, change the address from:
https://https://admin.shopify.com/store/<shopname>/orders/3804849891234
To the following:
https://https://admin.shopify.com/store/<shopname>/orders/3804849891234.json
Use GraphiQL or a third-party API tool
You can directly query the API by using a third-party API tool like Postman or the free Shopify-provided tool, GraphiQL. This option provides the most accurate results, but it does require some familiarity with creating GraphQL queries.
For GraphiQL, Shopify offers both a web-based GraphiQL explorer with generic data and the GraphiQL app. With GraphiQL, you can build a GraphQL query which exactly matches the field names that you see in Shopify Flow. The values also exactly match your store if you use the app.
By using this tool, you can determine exactly what data Shopify Flow uses, with your real shop data. For example, you create the following query:
In the following results, the variable order / app / name
displays the app name for the order. In this case, the order was created from the draft orders app, so the value is Draft Orders
. Channel information is only available for the Point of Sale
app.