Automation
Automation Hub: trigger, steps, done
Automation Hub at `/dashboard/automation` is the part of BirrStore that reacts for you while you sleep. A flow has exactly two parts: a trigger (the event that starts it) and steps (what happens next, in order). When the trigger fires, the engine walks through the steps, passing data from one to the next. That is the whole model — everything else is choosing good triggers and steps. ## Know your triggers There are 24 trigger kinds, covering the moments that matter in a store: - **Orders**: `order.placed`, `order.paid`, `order.status_changed`, `order.refunded` - **Products**: `product.created`, `product.updated`, `product.low_stock`, `product.restocked` - **Customers**: `customer.created`, `customer.first_order`, `customer.vip` - **Sales and reviews**: `quote.accepted`, `quote.declined`, `review.received`, `opportunity.stage_changed`, `target.achieved` - **Storefront signals**: `cart.abandoned`, `survey.submitted` - **Platform events**: `seo.issue_found`, `agent.task_completed` - **Time and machines**: `schedule.cron` (recurring interval), `schedule.once` (a specific date and time), `webhook.inbound` (an external system POSTs to your flow URL), `manual.run` (you press the button) ## Build a flow 1. Go to **Automation** → **New Flow** and pick a trigger. Configure it — for example, the low-stock threshold for `product.low_stock`, or the cron interval for `schedule.cron`. 2. Add steps from the step palette. Available step types: **condition** (branch on data), **delay** (wait minutes, hours, or days), **filter** (stop unless criteria match), **loop** (iterate over a list), **create/update record** (write products, customers, and more), **tag** and **note** (annotate customers), **email.send**, **notify.merchant**, **sequence.enroll** (put a contact into a Sales Cloud cadence), **survey.send**, **ai.generate** and **ai.classify** (draft text or sort items with AI), **webhook.out** (call any external URL, HMAC-signed), **http.get** (fetch data), and **task.create** (hand work to an agent or teammate). 3. Reference values from the trigger and earlier steps in later steps, so a flow started by `order.paid` can email the buyer about *that* order. 4. Toggle the flow **live** when you are done. ## Test before you trust it Every flow has a **Test run** button. It injects a realistic sample payload for your trigger type and executes the steps, producing a per-step journal: each step's input, output, duration, and any error, one line at a time. Read the journal bottom-up when something looks wrong — the failing step and the bad value that reached it are usually obvious. Fix, re-test, then go live. ## Webhook triggers with secrets Choose `webhook.inbound` as a trigger and BirrStore generates a flow-specific URL with its own secret. POST JSON to that URL from any external system — a form tool, a warehouse app, a cron job on your own server — and the flow fires with your payload. Treat the URL like a password: anyone holding it can trigger the flow, and you can rotate the secret whenever you need to. ## Start from templates The **Templates** tab ships with proven starting points: abandoned cart reminders, low-stock merchant alerts, VIP tagging when lifetime value climbs, review requests after payment, and restock announcements. Clone one, adjust the wording and delays, and you have a working flow in minutes instead of an hour. ## Runs are durable This matters more than it sounds: a run is not a fragile script that dies the moment something hiccups. Runs persist their state. If a flow hits an error, a long delay, or a temporary outage, the run pauses and resumes where it stopped — it does not restart from the top or skip steps. The run history shows the status of each step, so "where did my customer's flow get to?" always has a precise answer. ## Tips - While you are learning, make **notify.merchant** the first step of new flows. Watching the pings builds trust faster than reading run logs. - Put a **condition** or **filter** before any customer-facing email. Guarding against repeated sends is cheaper than apologizing for them. - Use `schedule.once` for one-off announcements and `schedule.cron` for the weekly stuff like digest emails. ## FAQ **What is the difference between `email.send` and `sequence.enroll`?** `email.send` delivers one message now (or after a delay step). `sequence.enroll` hands the contact to a Sales Cloud sequence, which manages its own multi-step cadence, stop rules, and reply tracking. **Who can build flows for me?** You — and the Automation Builder agent, which can create flows from a goal you describe. Agent-built flows are approval-gated: you review before anything goes live. **Do webhook trigger URLs expire?** No, they stay valid until you rotate the secret or delete the flow.