← Back to directory
E-commerce Quick to set up Automation Detect & Flag Anomaly

Magento 2 Low Stock Alert via Slack And Gmail

Source reviewed Updated 2026-07-07

Daily cron checks Magento 2 inventory per source and sends low-stock alerts via HTML email and Slack for configurable items.

What it does

You receive daily low-stock alerts for your configurable Magento 2 items before they run out of inventory. This workflow checks stock levels per source, filters non-physical products, and instantly notifies you via HTML email or Slack when SKUs drop below your customizable thresholds.

Step by step

  1. Configure the HTTP Request node to call the Magento 2 inventory REST endpoint with valid OAuth credentials.
  2. Set up the Code node to parse the JSON response and filter for items where quantity is below the defined threshold.
  3. Connect the output of the processing step to both the Gmail send email action and the Slack post message action.

Where the LLM does the work

  • Generate the HTML body template for the low stock email that includes product names, SKUs, and current quantities in a readable table format.
  • Draft the Slack message text to ensure it is concise and highlights critical items without truncating important details.
  • Create error handling logic in the Code node to gracefully manage API failures or missing inventory data.

Watch out for

Slack message length limits can truncate long product descriptions, so ensure the Code node truncates text safely before sending.
Incorrect SKU filtering might send false positives for virtual products, so explicitly exclude non-physical item types in your query parameters.

Tools that fit

HTTP Request API Fetch Magento 2 inventory data via REST API
Code LLM Process stock levels and filter products
Gmail Service Send HTML formatted low stock reports
Slack Service Post formatted text notifications

The agent brief

Everything your agent needs, including the gotchas. Copy it and go.
agent-brief.md
You are helping me build the following AI agent workflow.

## Goal
Magento 2 Low Stock Alert via Slack And Gmail: Daily cron checks Magento 2 inventory per source and sends low-stock alerts via HTML email and Slack for configurable items.

## Specification
- What it does: You receive daily low-stock alerts for your configurable Magento 2 items before they run out of inventory. This workflow checks stock levels per source, filters non-physical products, and instantly notifies you via HTML email or Slack when SKUs drop below your customizable thresholds.
- Trigger: On a schedule (Scheduled ยท daily 08:50)
- Autonomy: Fully hands-off
- Expected setup effort: under an hour
- Tools/services involved:
  - HTTP Request: Fetch Magento 2 inventory data via REST API
  - Code: Process stock levels and filter products
  - Gmail: Send HTML formatted low stock reports
  - Slack: Post formatted text notifications

## Known pitfalls, handle each one explicitly in your implementation
1. Slack message length limits can truncate long product descriptions, so ensure the Code node truncates text safely before sending.
2. Incorrect SKU filtering might send false positives for virtual products, so explicitly exclude non-physical item types in your query parameters.

## Reference implementation
https://n8n.io/workflows/6471 (workflow template)
Fetch and inspect this before building. If it matches my stack, adapt it;
if not, rebuild the pattern with my tools.

## Process requirements
1. Before building: ask me which of the listed tools I actually use and
   what my platform is (n8n / Make / code / other). Do not assume.
2. Adapt the pattern to my answers; do not force the reference stack.
3. Address every pitfall above; tell me how you handled each.
4. Provide a test plan I can run before letting this touch real data.
5. Ask before any step that sends messages, modifies data, or spends money.

Source: https://usecasesforagents.com/use-case/magento-2-low-stock-alert-via-slack-and-gmail/ via usecasesforagents.com

Frequently asked questions

Can I use a different Email than Gmail?

Yes. Gmail is only the example email in this recipe. The same flow works with Brevo, KlickTipp, Lemlist and Mailchimp. Swap the email connection and keep the rest of the setup as written.

Want this running in your business?

This is what I do. I design and build AI agents like this one, and keep them running. If you want it set up for your team instead of doing it yourself, get in touch.
Get in touch →

Who it's for

Also fits E-commerce Operator.

Seen in the wild

← Back to directory