Skip to main content

Tutorials

These tutorials walk you through building real-world AI agents on the Datafi platform. Each tutorial creates a complete, production-ready agent that you can customize for your own data.


Who Are These For?​

These tutorials are designed for business users -- Sales Operations, RevOps, Customer Success, and other teams who want to automate data-driven workflows. No programming experience is required, though the tutorials include full technical details for those who want to understand what's happening under the hood.


Prerequisites​

Before starting any tutorial, make sure you have:

  • Datafi account -- An active account with access to the Agent Studio. See Account Registration if you need to sign up.
  • Connected data source -- At least one data source configured with customer or transaction data. See Connecting Datasets.
  • Email service -- Email notifications configured for your workspace (required for tutorials that send reports). See Events & Notifications.

Available Tutorials​

Building a Customer Churn Agent​

Build an agent that analyzes customer transaction patterns to detect churn risk. The agent queries your database, identifies customers with declining revenue (>20% drop), generates AI-powered retention recommendations formatted as HTML, and emails a weekly report to your sales team.

What you'll learn:

  • Using the conversational builder to scaffold a workflow
  • Refining workflows in the visual editor (JQ expressions, HTML formatting, variable substitution)
  • Configuring scheduled execution with cron expressions
  • Working with the query, array, json, regression, llm, markdown_table_formatter, and email tools

Time estimate: 30-45 minutes


Building a Customer Health Agent​

Build an agent that monitors overall customer health using statistical regression analysis. The agent fetches transaction data, performs trend analysis per customer, filters for at-risk accounts, generates retention recommendations, and sends a formatted report.

What you'll learn:

  • Designing workflows with regression analysis
  • Grouping and transforming data with JSON operations
  • Configuring guard rails and resource limits
  • Setting up retry policies for production reliability

Time estimate: 30-45 minutes


Tutorial Pattern​

Both tutorials follow the same fundamental pattern that applies to most business automation agents:

Query Data → Transform → Analyze → Decide → Generate → Act
  1. Query -- Fetch data from your connected sources using PRQL
  2. Transform -- Group, filter, and reshape the data
  3. Analyze -- Apply statistical analysis or AI reasoning
  4. Decide -- Branch based on conditions (any results found?)
  5. Generate -- Use LLM to create recommendations or reports
  6. Act -- Send emails, update systems, or trigger downstream workflows

Once you understand this pattern, you can apply it to any business automation scenario.


After the Tutorials​

After completing the tutorials, explore these resources: