Skip to content

Webhook

How to log “low stock” alerts in NocoDB using n8n

Section titled “How to log “low stock” alerts in NocoDB using n8n”

This guide shows you how to automatically save every low stock notification from Shopware into a NocoDB table using an n8n automation workflow.

What you need:

  • Low Stock Notification plugin installed and configured in Shopware
  • A running n8n instance (cloud or self-hosted)
  • A running NocoDB instance (cloud or self-hosted)

The plugin provides a ready-made import file. It creates all columns in one step and includes one sample row so you can see the expected data format.

  1. In NocoDB, open your base and click Add new table → Import from file.
  2. Select nocodb-table-template.csv — import it as downloaded, without opening it first.
  3. NocoDB will preview the columns — confirm and import.
  4. Rename the table to Low Stock Notifications (or any name you prefer).

The imported columns and their recommended types are:

Column nameType
Sales ChannelSingle line text
TimestampDate time
Product IDSingle line text
Product NameSingle line text
Product NumberSingle line text
StockNumber

Tip: NocoDB always imports every column as Single line text, regardless of file format (CSV, Excel, or JSON). After the import, open the table, click the Timestamp column header → Edit field and change the type to Date time. Also change Stock to Number. The plugin sends timestamps as ISO 8601 strings (2024-01-15T10:30:00+00:00), which NocoDB’s DateTime field accepts correctly when data arrives via the API.

In NocoDB go to Team & Settings → API Tokens and create a new token. Copy it — you will paste it into the n8n workflow.


  1. Download the file n8n-nocodb-workflow.json.
  2. In n8n, click Add workflow → Import from file and select the downloaded file.
  3. The workflow contains six nodes connected like this:
[Shopware Webhook] → [Secret Valid?] → [Respond 200] → [Prepare Fields] → [Add Row to NocoDB]
↘ [Respond 401]

The workflow responds to Shopware before inserting into NocoDB. This is intentional:

  • Shopware’s webhook action has a 5-second timeout. NocoDB inserts can be slow, especially on cloud instances. By responding immediately after secret validation, Shopware never hits that timeout.
  • n8n sends the HTTP response to Shopware as soon as the “Respond 200” node is reached, then continues executing “Add Row to NocoDB” in the same workflow run.
  • If the NocoDB insert fails after the 200 has already been sent, Shopware does not know about it. You will see the error in n8n’s Executions panel — the run will show a red indicator on the “Add Row to NocoDB” node.
ScenarioHTTP response Shopware receivesShopware log entry
Secret matches200 OKnone
Secret does not match401 Unauthorizederror (logged by Guzzle)
n8n unreachable / timeoutno responseerror (logged by Guzzle)

A 401 or connection error does not stop or retry the Shopware flow — it is logged to var/log/ and the flow continues to any subsequent actions.


Open each node and replace the placeholder values:

Replace YOUR_WEBHOOK_SECRET with the secret token you will enter in Shopware (step 5). Use any long random string — a good token looks like:

You can generate one with a password manager or a tool like 1password.com/password-generator. The same value must be entered in both n8n and the Shopware flow action.

No secret? If you prefer not to use a secret token, delete the “Secret Valid?” and “Respond 401” nodes and connect “Shopware Webhook” directly to “Add Row to NocoDB”.

This Set node flattens the nested webhook payload into flat fields that match your NocoDB column names exactly. The expressions are pre-filled — no changes needed here.

This node uses the native NocoDB n8n integration. Configure the following fields:

FieldValue
Credential to connect withCreate a new NocoDB credential (see below)
ResourceRow
OperationCreate
Workspace Name or IDNo Workspace — only needed for NocoDB Cloud accounts; leave empty for self-hosted
Base Name or IDSelect your base from the dropdown
Table Name or IDSelect your table from the dropdown
Data to SendAuto-Map Input Data to Columns

The Auto-Map mode works here because the “Prepare Fields” node upstream already outputs fields named Event, Timestamp, Product ID, Product Name, Product Number, and Stock — exactly matching the NocoDB column names.

In n8n, go to Credentials → Add credential → NocoDB Token account and enter:

  • Host: your NocoDB URL, e.g. https://nocodb.example.com
  • API Token: the token you created in Step 1

Step 4 — Activate the workflow and copy the webhook URL

Section titled “Step 4 — Activate the workflow and copy the webhook URL”
  1. Save the workflow.
  2. Click Activate (toggle in the top right corner).
  3. Open the “Shopware Webhook” node and copy the Production URL — it looks like: https://your-n8n.example.com/webhook/shopware-low-stock

Keep this URL ready for the next step.


Step 5 — Configure Shopware Flow Builder

Section titled “Step 5 — Configure Shopware Flow Builder”
  1. In the Shopware administration, go to Settings → Flow Builder.
  2. Create a new flow or open an existing one.
  3. As the trigger, select Low Stock Notification (or the specific low stock event you want to capture).
  4. Add the action Send Webhook.
  5. In the action modal:
    • Webhook URL: paste the n8n webhook URL from Step 4.
    • Secret Token: enter the same secret you configured in the n8n workflow (optional but recommended).
  6. Save and activate the flow.

Place a test order in your shop for a product with low stock. Once the order is completed, the flow should fire and a new row should appear in NocoDB.

The plugin includes a Test Notification button in the plugin configuration under Settings → Extensions → Low Stock Notification. Clicking it sends a test notification immediately. If you use the Flow Builder mode, the test will trigger your flow.

In n8n, open Executions for your workflow. Each successful run shows a green tick. Click an execution to inspect the data that was sent and received.


The secret token in the n8n “Secret Valid?” node does not match the token configured in Shopware. Check both for typos or extra spaces.

n8n shows an error on the “Add Row to NocoDB” node

Section titled “n8n shows an error on the “Add Row to NocoDB” node”
  • Double-check the Base ID, Table ID, and API token.
  • Make sure the column names in NocoDB match exactly (including capitalisation).
  • Check that the NocoDB API token has write permission.
  • Make sure the workflow is activated (not just saved).
  • Use the production URL, not the test URL.
  • Check that Shopware’s flow is also activated.

NocoDB row is created but Timestamp is empty or shows an error The column type may have been set to plain text during import. Change it to Date time in NocoDB’s field settings. The plugin sends ISO 8601 timestamps (2024-01-15T10:30:00+00:00), which NocoDB’s DateTime field accepts via API without any additional formatting.


Each low stock event creates one row with the following data:

FieldExample value
Sales ChannelGerman Shop
Timestamp2024-01-15T10:30:00+00:00
Product ID01921abc... (internal Shopware UUID)
Product NameBlue T-Shirt
Product NumberSW10001
Stock3