Skip to main content

Hands-on lab: Agentic Data Quality

· 6 min read
Jenny
Chief of Staff @ Ascend
Ayush
Field Data Engineer @ Ascend

Add data quality tests and agentic email alerting with Otto.

The plan

In this lab, we will:

  1. Sign up for Ascend
  2. Go through onboarding and build your first pipeline with Otto
  3. Add data quality tests using a prompt to Otto
  4. Set up agentic alerting so that when a Flow fails due to a data quality issue, Otto sends you an email

Step 1: Sign up for Ascend

Go to https://app.ascend.io/ and click Start Your Free Trial.

Sign up

tip

Your free trial lasts for 14 days or 100 Ascend Credits, whichever comes first. To continue using Ascend beyond these limits, you can select a plan to subscribe to.

Sign up with Google, LinkedIn, Microsoft, or GitHub or use your email address.

Sign up form

If you sign up with an email address and password, check your email for a verification message from support@ascend.io. Click to accept the invite and create a password or sign in with Google SSO.

Step 2: Complete onboarding

Once signed in, you'll see the onboarding experience. Follow the prompts to let Otto build your first data pipeline.

Onboarding

When asked how would you like to get started, select Start with Otto's Expeditions.

Onboarding

tip

If you've already started a trial of Ascend, you can skip the steps above and navigate to your Workspace.

Step 3: Add data quality tests with Otto

Now we'll add data quality tests to the pipeline so that bad data is caught before it propagates. Start a new thread in the Otto chat and paste the following prompt:

Add data quality tests to the Sales Flow. For each Transform Component that outputs data we care about, add tests that make sense for the schema. Run the Flow after adding the tests and make sure everything passes.

Otto will add test Components to your Flow, run it, and confirm the tests pass.

tip

Otto may iterate a few times. If something fails, Otto will usually try to fix it. If it gets stuck, give it a nudge in chat!

Step 4: Set up agentic email alerting

When a Flow fails, for example because a data quality test failed, you want to know right away. We'll create an Automation that triggers on Flow run errors and sends an email with Otto's explanation of what went wrong.

Ask Otto to create the Automation:

Please create an Automation YAML file for the Sales flow that triggers on Flow run errors and sends an email with an explanation of what went wrong and a proposed fix. If it is related to a data quality test failure, evaluate the affected data and determine if the test should be updated or if the data was correctly blocked by the test.

Manual setup

Alternatively, you can create the Automation manually:

  1. In the Build panel, find the Automations section and click + to create a new Automation (or use the Files panel and create a new file under automations/).

Automations

  1. Configure the Automation:

    • Name: e.g. failure-alert
    • Set enabled to true by checking the box.
    • Triggers: Add an Event trigger for FlowRunError (so any Flow failure triggers it, including data quality test failures). Select the Sales Flow from the dropdown.
    • Action: Set the action type to Email alert.
    • Recipients: Add your email. Recipients must be users on your Ascend instance.
    • Include Otto summary: Check this box so the email contains Otto's explanation of the failure.
    • Prompt: Add the following prompt:
    The sales flow has failed. Please perform a comprehensive diagnostic analysis:

    1. **Error Analysis**:
    - Examine the run details to identify which component(s) failed
    - Extract error messages and stack traces
    - Determine the root cause (connection issue, schema change, data quality, logic error)

    2. **Test Failure Evaluation** (if the failure is due to a data quality test):
    a. Query the affected data to understand what triggered the test failure
    b. Analyze sample failing records to determine if:
    - The data is genuinely problematic (upstream data issue)
    - The test threshold is too strict (test configuration issue)
    c. Provide specific examples of failing records with context
    d. Recommend ONE of the following actions:
    - Fix the upstream data source (if data is invalid)
    - Adjust the test parameters with specific new values (if threshold is wrong)
    - Change test severity from "error" to "warn" (if failures are acceptable)
    - Add data transformation logic to handle the edge case (if data needs cleaning)

    3. **Component-Specific Analysis**:
    - Read components: Check connection status, file availability, schema evolution
    - Transform components: Check SQL/Python logic, upstream data changes, partition issues
    - Task components: Check external dependencies, API availability, credentials

    4. **Proposed Fix**:
    - Provide specific, actionable steps to resolve the issue
    - Include exact code changes with file paths and line numbers
    - Show before/after code snippets for clarity
    - Prioritize fixes: quick wins first, then structural changes

    5. **Prevention Strategy**:
    - Suggest monitoring improvements to catch similar issues earlier
    - Recommend additional tests or validation logic
    - Identify patterns that could prevent future failures

    Format your response as a clear, actionable diagnostic report. Use markdown formatting with:
    - Clear section headers
    - Code blocks with syntax highlighting
    - Bullet points for action items
    - Tables for data comparisons when relevant

    Be specific and technical - this is for a data engineer who needs to fix the issue quickly.

When a Flow run fails (e.g. due to a data quality test), the Automation will fire and you'll receive an email with Otto's analysis of the failure.

tip

To test it, you can temporarily break something in the Flow (e.g. change a test to make it fail) and run the Flow. You should get an email with Otto's summary of the error.

Wrap up

You've set up:

  • Data quality tests on your pipeline, added by Otto from a single prompt
  • Agentic alerting so that when a Flow fails (including from data quality issues), Otto sends you an email explaining what happened

Resources

Questions? Reach out: