For the complete documentation index, see llms.txt. This page is also available as Markdown.

3.6 📋 Let's Log Details

Sync Products to Shopify with Detailed Logging

Use Detailed Log tool to track successful and failed product syncs to Shopify, so your team can identify and retry failed records.

Step 1: Initialize Product Data

Create a new batch workflow and initialize a variable called products:

JSON

[
  {"title": "Laptop"},
  {"name": "PROD-002"},
  {"title": "Keyboard"}
]

Step 2: Add a Loop

Add a Loop step with the following configuration:

  • Loop Type — Select Loop through values

  • Iterable — Place your cursor in the Iterable field, open the Data Hub, and select variables → products

The syntax will be: {{variables.products}}

Step 3: Connect to Shopify (Inside Loop)

Inside the Loop, add an API Call step to connect to your Shopify store and call the Create a New Product API. In the payload section, configure the following:

{
  "product": {{1.item}}
}

Step 4: Configure Response Validation

In the Response Validation section of the API Call step, you will see two pathways — Valid Response and Else.

By default, the valid response checks for status code 200. Change this to 201 because Shopify returns 201 when a product is created successfully.

Step 5: In the Valid Response Pathway, Add Detailed Log (Success)

Add a Detailed Log tool in the Valid Response pathway and configure it:

  • Status — Success

  • Entity ID — {{2.response.product.id}}

  • Short Message — {{2.response.product.title}} created successfully

  • Update Counters — Check this box

Step 6: In the Else Pathway, Add Detailed Log (Failure)

Add a Detailed Log tool in the Else pathway and configure it:

  • Status — Failure

  • Entity ID — {{2.meta.request_payload.product.title}}

  • Short Message — {{2.meta.request_payload.product.title}} creation failed

  • Update Counters — Check this box

Step 7: Final Settings and Run

  • Enable Show Output for all steps

  • Enable Console Logs for all steps and for the workflow

  • Save the workflow

  • Click Sync Now

Check the logs to see which products were created successfully and which ones failed. The success and failure counters will show you the total count of records processed.

🎉 Good Job! You have successfully used the Detailed Log tool to track your workflow execution!


Last updated

Was this helpful?