Step 2: Analyze and Add Logic to Your Data
Once you’ve gathered your datasets in Step 1, it’s time to transform raw numbers into strategic guidance—and then layer in the decision-making rules that automate next steps.
2.1 Analyze Data
Action | What It Does | Example Use Case |
Prompt to Python | Converts a natural-language prompt into a Python script for complex or custom computations. | “Calculate cohort retention curves by signup month and output a CSV of 30-, 60-, and 90-day retention rates.” |
Forecasting | Models historical trends to predict future values or seasonality. | “Forecast next quarter’s daily revenue using the past two years of data, accounting for weekly seasonality.” |
MMM (Marketing Mix Modeling) | Quantifies each channel’s incremental impact to optimize spend allocation. | “Determine the spend split across Facebook, Google, and Email that maximizes total conversions given our budget.” |
Computer Vision | Analyzes images or videos—detecting objects, sentiment, or design patterns. | “Review the top performing creative assets on Meta in the last 30 days and correlate with highest CTR and ROAS.” |
How to Use:
Select the analysis action that matches your goal.
Write or refine your prompt, specifying metrics, date ranges, and output format (table, chart, CSV, etc.).
Test with a small sample to validate accuracy, then scale to your full dataset.
2.2 Add Logic
After your data has been processed, embed decision rules to control when and how downstream steps execute:
Action | What It Does | Example Use Case |
Prompt Rule | Defines conditional logic in plain language. | “If the new customers percentage is greater than 10%” |
Formula Rule | Builds classic if-then-else logic using an editor or via SQL. | If |
Run Subworkflow | Executes one or more other Agents in parallel. | After computing key metrics, kick off the ‘Daily Marketing Pulse’ and ‘Daily Flourishing Creative’ Agents simultaneously, before feeding those results into a subsequent analysis. |
Loop | Iterates an Agent step over each item in a list or table. | For each product SKU in my top-50 list, run a forecasting model to generate individual weekly demand projections. |
Close Loop | Feeds results back into an earlier step or external system to complete a cycle. | “After updating customer segments, push the new lists back into our CRM and re-run the retention analysis.” |
Implementation Tips:
Order matters: Place logic steps immediately after the analysis they govern.
Combine rules: Use Prompt and Formula rules together—for instance, a Prompt Rule to check a complex condition, and a Formula Rule to assign labels.
Monitor performance: Loops and subworkflows can increase run time; test on small subsets before full execution.
Bringing It All Together
By combining Analyze Data actions with Add Logic controls, your Agent becomes more than a report builder—it becomes an autonomous decision engine:
Analyze: Forecast next month’s revenue.
Rule: If forecast < target, tag “Underperforming.”
Subworkflow: Trigger a promotional campaign Agent for those tagged.
Loop & Close Loop: Iterate this process per campaign and sync results back to your dashboard.
This layered approach ensures that every run not only uncovers insights but also automatically acts on them—driving continuous optimization without manual intervention.