Configuration
What it can answer
The insights step runs the same analytics agent that powers insights in chat. It answers aggregate questions over your store’s commerce data: totals, trends, top-N rankings, period-over-period comparisons, cohorts, and funnels across orders, revenue, customers, and products. It applies the correct commerce definitions itself, so you ask in plain language instead of spelling out formulas. The step is read-only. It looks up and analyzes metrics and returns figures.Writing the question
Ask in plain language, the way you would ask an analyst. The agent owns the metric definitions, so you do not need to specify formulas, status breakdowns, or output formatting. Reference trigger and earlier-step data with data access variables, and fold related metrics into a single question rather than splitting them across steps.Output schema
Theoutput_schema defines the structure the agent must return. It must be a valid JSON Schema with either type or properties at the top level:
{{steps.<step_id>.<field>}}. The agent also produces a one-line summary interpreting the result in prose, shown in the run view.
Examples
- Weekly revenue
- Templated question
Ask for a metric, get it back structured.
Result
Each insights step produces:success is true, output is empty, and paused is set with a pause_reason of insufficient_credits.
Verify entities before acting on them
Insights reads from your store’s event history. History can name products or customers that no longer exist in the catalog. Aggregate figures need no verification. Entity references do. When a downstream step features, messages about, or updates entities the insights step named, give that step the matching read tools and tell it to verify each one. Ask insights for a few extra entities (top 8 for a top 5) so skipped ones leave no gap.Use cases
- Weekly digest: an insights step computes
{revenue, order_count, aov}, a downstream action posts it to Slack. - Restock signal: an insights step returns the top-selling products over a window, a map step runs a restock action per item.
- Threshold gate: an insights step returns a metric, a choice step branches when it crosses a threshold.
- Best-sellers page: insights ranks products, AI reasoning writes the copy, a storefront builder step updates the page.
Next steps
- AI reasoning. The general-purpose agent step
- Storefront builder. Turn insights output into a storefront page
- Data access. Reference trigger and step data in the question and output schema