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)
Step 1 — Create the NocoDB table
Section titled “Step 1 — Create the NocoDB table”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.
- In NocoDB, open your base and click Add new table → Import from file.
- Select
nocodb-table-template.csv— import it as downloaded, without opening it first. - NocoDB will preview the columns — confirm and import.
- Rename the table to
Low Stock Notifications(or any name you prefer).
The imported columns and their recommended types are:
| Column name | Type |
|---|---|
| Sales Channel | Single line text |
| Timestamp | Date time |
| Product ID | Single line text |
| Product Name | Single line text |
| Product Number | Single line text |
| Stock | Number |
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.
Create an API token
Section titled “Create an API token”In NocoDB go to Team & Settings → API Tokens and create a new token. Copy it — you will paste it into the n8n workflow.
Step 2 — Import the n8n workflow
Section titled “Step 2 — Import the n8n workflow”- Download the file
n8n-nocodb-workflow.json. - In n8n, click Add workflow → Import from file and select the downloaded file.
- The workflow contains six nodes connected like this:
[Shopware Webhook] → [Secret Valid?] → [Respond 200] → [Prepare Fields] → [Add Row to NocoDB] ↘ [Respond 401]How the response flow works
Section titled “How the response flow works”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.
What Shopware sees
Section titled “What Shopware sees”| Scenario | HTTP response Shopware receives | Shopware log entry |
|---|---|---|
| Secret matches | 200 OK | none |
| Secret does not match | 401 Unauthorized | error (logged by Guzzle) |
| n8n unreachable / timeout | no response | error (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.
Step 3 — Configure the workflow
Section titled “Step 3 — Configure the workflow”Open each node and replace the placeholder values:
“Secret Valid?” node
Section titled ““Secret Valid?” node”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”.
”Prepare Fields” node
Section titled “”Prepare Fields” node”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.
”Add Row to NocoDB” node
Section titled “”Add Row to NocoDB” node”This node uses the native NocoDB n8n integration. Configure the following fields:
| Field | Value |
|---|---|
| Credential to connect with | Create a new NocoDB credential (see below) |
| Resource | Row |
| Operation | Create |
| Workspace Name or ID | No Workspace — only needed for NocoDB Cloud accounts; leave empty for self-hosted |
| Base Name or ID | Select your base from the dropdown |
| Table Name or ID | Select your table from the dropdown |
| Data to Send | Auto-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.
Creating the NocoDB credential
Section titled “Creating the NocoDB credential”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”- Save the workflow.
- Click Activate (toggle in the top right corner).
- 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”- In the Shopware administration, go to Settings → Flow Builder.
- Create a new flow or open an existing one.
- As the trigger, select Low Stock Notification (or the specific low stock event you want to capture).
- Add the action Send Webhook.
- 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).
- Save and activate the flow.
Step 6 — Test the setup
Section titled “Step 6 — Test the setup”Option A — Trigger a real order
Section titled “Option A — Trigger a real order”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.
Option B — Use the test button
Section titled “Option B — Use the test button”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.
Check n8n execution history
Section titled “Check n8n execution history”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.
Troubleshooting
Section titled “Troubleshooting”n8n shows a 401 response
Section titled “n8n shows a 401 response”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.
No executions appear in n8n
Section titled “No executions appear in n8n”- 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.
What gets saved
Section titled “What gets saved”Each low stock event creates one row with the following data:
| Field | Example value |
|---|---|
| Sales Channel | German Shop |
| Timestamp | 2024-01-15T10:30:00+00:00 |
| Product ID | 01921abc... (internal Shopware UUID) |
| Product Name | Blue T-Shirt |
| Product Number | SW10001 |
| Stock | 3 |