Inventory management and linking with Shopify

Hello Baserow super people,

I want to create an inventory table that I will use to create vendor PO’s. One element I am wondering about is can I link the table directly to Shopify to know current inventory levels. If not automatic, is there a way to make it super easy to update? I can export inventory CSV levels out of Shopify. Not sure, importing them would be the only solution. If so, how to streamline the process?

Thanks:)

Alpha Omega Artisan

Hey @Alpha,

People often use Baserow in combination with a workflow automation tool like: n8n, make or Zapier.

This use case sounds like something that could be achieved with workflow automation!

We have an n8n engineer in our community @joffcom maybe he can give some advice on this matter :slight_smile:

Hey Hey,

So @Alex is spot on there, You could use something like Zapier / Make or n8n to handle this. How you do it would depend on your process a bit but a first step could be to have a schedule that runs every hour or daily to get all your Shopify products then take the quantity and add them to a Baserow Table.

If there is a bit more to it like maybe a processed order is put into Baserow and you wanted to validate it you could call out to an automation platform using a webhook that could then check the stock level and update the table in Baserow and maybe send an email to your order team so they know there is something that needs to be changed.

A quick n8n workflow that would take the data from Shopify and Baserow then update the Quantity would look something like this…

This is based on a table that looks like this

image

Workflow JSON
{
  "meta": {
    "instanceId": "8c8c5237b8e37b006a7adce87f4369350c58e41f3ca9de16196d3197f69eabcd"
  },
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "id": "9bf175ef-0cc3-40d0-81e5-bb1674a33a73",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        840,
        420
      ]
    },
    {
      "parameters": {
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "additionalFields": {}
      },
      "id": "f6cd7dcb-67e6-42cb-9b10-68478a46284c",
      "name": "Shopify",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        1040,
        420
      ],
      "credentials": {
        "shopifyApi": {
          "id": "138",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "productTitle",
              "value": "={{ $json.title }}"
            }
          ],
          "number": [
            {
              "name": "productId",
              "value": "={{ $json.id }}"
            },
            {
              "name": "stockQty",
              "value": "={{ $json.variants[0].inventory_quantity }}"
            }
          ]
        },
        "options": {}
      },
      "id": "1e847ee9-2ffe-4c9e-9611-1dd28000e6a2",
      "name": "Extract only the fields needed",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1240,
        420
      ]
    },
    {
      "parameters": {
        "databaseId": 50813,
        "tableId": 138992,
        "returnAll": true,
        "additionalOptions": {}
      },
      "id": "a5af3ee8-dad7-4a57-9c93-1c805b7edd17",
      "name": "Baserow",
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        1040,
        620
      ],
      "credentials": {
        "baserowApi": {
          "id": "31",
          "name": "[hosted] 86-88"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "number": [
            {
              "name": "rowId",
              "value": "={{ $json.id }}"
            },
            {
              "name": "productId",
              "value": "={{ Number($json.productId) }}"
            }
          ]
        },
        "options": {}
      },
      "id": "66dd69bc-da62-4091-9152-faba20b0e5bb",
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1240,
        620
      ]
    },
    {
      "parameters": {
        "mode": "combine",
        "mergeByFields": {
          "values": [
            {
              "field1": "productId",
              "field2": "productId"
            }
          ]
        },
        "joinMode": "keepEverything",
        "options": {}
      },
      "id": "a6ca88fd-44fe-48cc-bdce-a56dd275d89e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2,
      "position": [
        1480,
        520
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "databaseId": 50813,
        "tableId": 138992,
        "rowId": "={{ $json.rowId }}",
        "dataToSend": "autoMapInputData",
        "inputsToIgnore": "rowId"
      },
      "id": "32466538-43de-4cce-97ff-7e4f0d8be3a5",
      "name": "Update Qty",
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        1700,
        520
      ],
      "credentials": {
        "baserowApi": {
          "id": "31",
          "name": "[hosted] 86-88"
        }
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify": {
      "main": [
        [
          {
            "node": "Extract only the fields needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract only the fields needed": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Baserow": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Update Qty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

The good thing with automation tools is there could be many ways you can do this, Another idea is if you have the CSV file anyway you could put that into Google Drive or email it and have a process that picks it up from there to then do the update.

1 Like

Thanks so much for the advice. So, I’m not a programmer and the store we are creating is a social business (alphaomegaartisan.com) with a goal to help people in 3rd world countries to be paid a living wage for the products they produce. Also, all of our time is volunteer. I say all this because as cool as the n8n solution sounds, funds are limited for our startup endeavor. Would a n8n solution be expensive? Are there any ongoing expenses for this type of solution? I looked into a CSV solution where the file is put into Google Drive. Since I’m only on Shopify’s basic plan I do not have access to report scheduling and only a few basic reports. For $10/mo I have found a few reporting apps that provide scheduling to Google Drive. I’m not opposed to this solution if it ends up being an easier and less costly solution. Again, Thanks so much

Tim

1 Like

n8n cloud is 20€.
It could be self-hosted for free, it all depends if you think somebody could manage such a thing: Installation - n8n Documentation
A YouTube tutorial may help. :open_hands:t2:

1 Like

Hey Tim,

Firstly, love the mission behind AOA. Not sure what your set up is, but my opinion is that the least technical (and cost-effective) option in the situation you’re describing is to self-host n8n via Cloudron. You can actually self-host Baserow through Cloudron too.

It’s super simple—has a one-click install. It’s like installing a native mobile app. Cloudron handles the more technical stuff behind the scenes, and you don’t need to run commands through your terminal or anything like that.

The costs associated would depend on your server. DigitalOcean has docs on deploying a Cloudron-specific droplet.

Cloudron’s free plan allows 2 apps, so I think this could work very well for your use case.

Hope this helps.

Thanks everyone for the suggestions. I greatly appreciate the help:).

In your workflow example you show data being extracted directly from Shopify. If I proceed with a n8n solution, would I be able to extract the data directly from Shopify? How? Thanks

You suggest "the least technical (and cost-effective) option for my situation is to self-host n8n via Cloudron]. You also suggest the option to also self-host Baserow through Cloudron. Can you provide any additional pros and cons with using n8n on Baserow vs Cloudron. Thanks so much for the support.

Not many cons I can think of, especially from a non-technical perspective. Cloudron’s free plan allows 2 apps, so having both Baserow and n8n self-hosted seems like a great way to go for your use case.

with using n8n on Baserow vs Cloudron

Just to be clear, Cloudron is what allows you to self-host both Baserow and n8n… these all work together in a complementary way, it’s not a matter using n8n on Baserow vs. n8n on Cloudron. You’d spin up Cloudron, then install both n8n and Baserow from Cloudron’s app store.

Hey @Alpha,

You should be able to I was extracting the data from Shopify, What I would suggest just to get started is spend some time playing with n8n desktop which will let you get the hang of it and see if you can do what you are after with no cost (other than time).

When it comes to Cloudron I personally wouldn’t use it as I have seen users having issues with it but it could be a good starting point if you are not comfortable with Docker.