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.

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:

  1. Choose a trigger that can be triggered manually.
  2. Add a Log output action to the workflow and connect it to the trigger.
  3. In the Log output configuration, click Add a variable to add the variables that you want to inspect to the Output section.
  4. When done, click Turn on workflow.
  5. 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.
  6. 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:

{
  orders(first:5, reverse:true) {
    nodes {
      createdAt
      app {
        name
      }
      channelInformation {
        app {
          title
        }
      }
    }
  }
}

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.

{
  "data": {
    "orders": {
      "nodes": [
        {
          "createdAt": "2023-04-10T12:32:41Z",
          "app": {
            "name": "Draft Orders"
          },
          "channelInformation": null
        },
        {
          "createdAt": "2023-04-10T12:29:12Z",
          "app": {
            "name": "Draft Orders"
          },
          "channelInformation": null
        },
        {
          "createdAt": "2023-03-17T20:23:10Z",
          "app": {
            "name": "Draft Orders"
          },
          "channelInformation": null
        },
        {
          "createdAt": "2023-03-17T20:20:53Z",
          "app": {
            "name": "Draft Orders"
          },
          "channelInformation": null
        },
        {
          "createdAt": "2023-03-17T15:45:15Z",
          "app": {
            "name": "Point of Sale"
          },
          "channelInformation": {
            "app": {
              "title": "Point of Sale"
            }
          }
        }
      ]
    }
  }
Ready to start selling with Shopify?Try it free