Generating Rules with AI

Karl Falconer · Updated

Instead of building a rule by hand, you can describe what you want in plain English and DropStream will generate a starting rule for you. The result drops into the visual editor so you can review, edit, and test it before activating.

Where to find it

Open the new-rule wizard, pick a store and a hook, and click Continue to editor. On the empty canvas, you’ll see the Describe your rule panel:

The Describe your rule panel with example chips

If you don’t see the panel, the AI features may not be enabled on your account. Contact DropStream support to enable them.

How to describe a rule

Type what the rule should do. A few patterns work well:

  • State the trigger and the action. “When the order total is over $100, set shipping to UPS Ground.”
  • Be specific about field names when you know them. “If billing_country is UK, reject the order.”
  • Use plain language for everything else. “Tag wholesale orders so the warehouse knows.”

The example chips in the panel show the kind of phrasing that works:

  • When order total > $100, apply free shipping
  • Tag orders from wholesale customers as “wholesale”
  • If any line item SKU starts with “HAZMAT”, require signature

Click any chip to fill the textarea, then refine it.

Generating

Click Generate rule to edit. DropStream sends your description to the language model and returns a working BGL rule, which loads into the visual editor:

A generated rule shown in the visual editor

The same rule in code form:

The same generated rule in BGL code, with the inactive keyword visible

Notice the inactive keyword on line 2 — generated rules always start inactive so they can’t affect production until you’ve reviewed and activated them.

Reviewing the result

Treat the generated rule as a draft. The model is good at translating intent into BGL, but it doesn’t know your business and it can pick the wrong field name or make assumptions you didn’t intend. Always:

  1. Read the rule. Either the visual blocks or the code — whichever you find easier to follow.
  2. Run it in the Test tab. Load real or generated test data and see what it actually changes.
  3. Edit anything that’s off. Wrong field name, wrong threshold, missing edge case — fix it directly. The generated rule is just a starting point.
  4. Toggle to Active when you’re satisfied — and not before.

When the visual editor can’t render the result

Some advanced BGL features (complex regex captures, certain nested accumulate patterns) don’t have visual blocks yet. If the model generates one of these, the editor will switch to the Code tab automatically. The rule is still valid — you just need to read it as code.

Tips for getting better results

  • Be specific about thresholds. “orders over $100” is better than “large orders”.
  • Name the field if you know it. “set shipping_carrier_name to UPS” is better than “set the carrier to UPS”.
  • One thing at a time, at first. A short focused description usually returns a cleaner rule than a long one. You can always add more once the basics work.
  • Iterate. If the first result isn’t right, edit your description and click Generate again, or just edit the rule directly.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.