Barcode scan to trigger a workflow?

Hello!

I am looking for a solution for this case:
After a QR is scanned, a label should be printed.

I made the workflow using PrintNode’s API and with a webhook trigger. We scanned the barcode with an AppSheet app, which calls the webhook.

Everything is working fine, except the fact that there is a huge delay. Appsheet calls the webhook with a 10-20 seconds delay.

We want to use this solution in our manufacturing and packaging department, and for hundreds of items daily the 10-20 seconds are way too high.

Maybe one of you have an idea, how should the webhook be called or which barcode scaning solution should be used, to reduce the printing process under 5 seconds?

Thank you!

Hi @Temco, I don’t think there is much you can do if the webhook from Appsheet arrives with a 10 to 20 second delay I am afraid (as long as using Appsheet is a requirement for you).

On n8n-side you probably want to set EXECUTIONS_PROCESS=main as in the default own mode n8n would spin up a separate process for each trigger it receives (causing a delay of ~1 second). You can find the respective documentation here.

My understanding is that most barcode scanners work like a keyboard (send keystrokes for each character followed by a newline). So perhaps you can use a simple website with nothing but a text box, sending data to n8n directly (or possibly via a lightweight server to avoid CORS issues)?

1 Like

Hey Temco - would you be open to sharing the workflow? We are looking at creating something similar and would love to use yours as a rough starting point and guide?

Hey @yelsew,

as a rough starting point:

  1. You also could use appsmith instead of appsheet. In their free plan you can create an app with only one page containing barcode scanner and a button to print label.
  2. Create a Data source in appsmith containing one API Call. This is pointing to the webhook url configured in n8n to start the workflow. In the body or in the query parameters you need to send the scanned barcode.
  3. Your n8n flow should do something like you can see below. You will need to fill all of the things with your tools. :wink:

This should be a good starting point.

If you need any help in either setting up the workflow or creating the appsmith app for your needs, feel free to contact me.

Cheers.

2 Likes

Thank you so much, mate!!!

1 Like