Skip to content

Lesson 21 ยท Sharing, Performance and Debugging

Testing and Debugging Workflows

Find workflow errors with the Results window, Browse tools and caching, add data checks with Message and Test tools, and build repeatable tests.

A workflow can fail loudly with an error, or it can finish happily with wrong numbers. The second kind is more dangerous. Good debugging means finding the first point where data stops matching your expectation, and good testing means catching that automatically next time.

This lesson gives you a method that works for both.

Read the messages

After a run, open the Results window and filter by errors and warnings. Click a message to find the tool that created it. Common types:

Message type Typical cause
Missing field A column was renamed or removed upstream
Type or conversion Text that cannot become a number or date
Truncation A field size is too small
File or connection Wrong path, permissions or password

Fix the first error before the others. Later errors are often consequences of it.

Divide and conquer

When the result is wrong but nothing fails:

  1. Write down what the output should be for one specific record or total.
  2. Check the data about halfway through the workflow.
  3. If it is already wrong, look earlier. If it is right, look later.
  4. Repeat until you find the single tool where it changes.
flowchart LR
  A["Input<br/>correct"] --> B["Join<br/>check here"]
  B --> C["Summarize<br/>wrong total"]

Check the middle first, then narrow the search.

Click anchors to see data, or add Browse tools where you need a full view and a column profile.

Cache and Run Workflow

When early steps are slow, you can right-click a tool and choose to cache and run the workflow. Designer caches the data up to that tool, so later runs do not repeat the earlier work. The help notes that this is not available for every tool (for example In-DB and Python tools) and that caches are cleared when you close the workflow.

Caching saves time, but remember that you are testing with saved data. Clear the cache when the source changes.

Tools for checks

  • Message (Developer category): write a custom warning or error when a condition is true, for example "negative quantities found".
  • Test (Developer category): check expectations such as record counts.
  • Filter plus a reject output: keep bad rows for review.
  • Control Container and Block Until Done can help control the order of parts of a workflow.

A data check branch counts bad records and raises a message when the count is above zero. Decide for each rule whether it should stop the run or only warn.

Python Stand-in: automated data checks that stop or warn

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Test data that finds bugs

Use Text Input to build small, hand-checked inputs. Cover:

  • Normal rows.
  • Nulls, blanks and zero.
  • Duplicate keys.
  • Keys that exist on only one side of a join.
  • Boundaries, such as exactly 100 when the rule says "100 or more".
  • Unusual text: accents, emoji, very long values and leading zeros.
  • Empty input.

Keep the expected output next to the test, and compare the two. A fast way is to join the actual and expected tables and look at the unmatched rows on both sides.

SQL Stand-in: compare expected and actual outputs

Press Run (or Ctrl + Enter) to see the result here.

An empty result means the tables match. Note that EXCEPT removes duplicate rows, so also compare row counts.

Safe experimenting

  • Turn on the runtime setting that disables tools that write output while debugging.
  • Point connections to a development database.
  • Use a small, safe copy of data.
  • Collapse or disable a Tool Container to skip a branch for a moment.

Isolate a failing step

If one tool behaves oddly, copy it into a new workflow with a Text Input holding the few rows that trigger the problem. A small reproduction is also the best thing to show a colleague. Remove private data before you share it.

What to record when you fix a bug

A fix is complete when the bug cannot return unnoticed. After you solve a problem, spend a few minutes on these notes:

  • Symptom: what the user saw, such as "March revenue was twice as high".
  • Cause: the real reason, such as "the product table contained a repeated SKU".
  • Fix: what you changed in the workflow.
  • Guard: the new check that would catch it, such as a uniqueness test on the SKU that stops the run.
  • Test row: a small example that reproduces the problem, added to your test inputs.

Over time, this list becomes very useful documentation. It shows which assumptions are fragile and which sources need attention.

Practice task

Break a working workflow on purpose in three ways: rename an input column, add a duplicate key to a lookup table and change one date into a different format. Introduce one fault at a time.

For each fault, note whether Designer reports an error, a warning or nothing at all, and which tool shows the first sign of trouble. Add a check that would make the silent faults visible. Then restore the data, run all checks again and confirm that they pass. A check that you have never seen fail may not be testing what you think.

Common mistakes

Do not silence warnings to get a clean run. A warning that you hide today becomes a wrong report next month.

  • Changing several things at once, so you cannot tell what fixed the problem.
  • Testing only on the data that happened to work.
  • Forgetting to remove test-only record limits and filters.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Several errors appear after a run. Which should you fix first?

    Upstream failures often cause downstream errors.
  2. 2. What is a limitation of caching?

    Cached data does not update when the source changes.
  3. 3. Which test input is most likely to find boundary bugs?

    Rules often fail exactly at their thresholds.
  4. 4. What setting protects destinations while you debug?

    It prevents accidental writes while you experiment.

Summary

  • Read messages, fix the first error and narrow down wrong results by halving.
  • Cache slow early steps but remember the cache may be stale.
  • Add automated checks with Message, Test and reject outputs.
  • Keep small test inputs with expected outputs, and protect real data.

Next: Performance and the AMP Engine

Your progress is saved in this browser. No account needed.