Why test a workflow?
Agent workflows are deceptively easy to break. A prompt tweak that looks harmless can shift a classification, a new tool can widen the output, a schema change upstream can silently reshape inputs. Without tests, you find out when a customer does. MagOneAI lets you capture real-world examples — input plus the output you expect — and replay them any time. Before publishing, before rolling out a prompt change, before a demo, you can run the full suite and see which cases still pass.What a test case looks like
Each test case belongs to a specific use case and captures three things:- Input — the same payload you’d send when executing the workflow normally
- Expected output — what a correct run should produce (optional)
- Assertion mode — how strictly to compare the actual output against the expected output
Assertion modes
Not every workflow should be checked the same way. MagOneAI offers three modes so you can pick the right level of strictness per test case:None
Passes if the workflow runs to completion without error. Use when the output varies (free-form text) but you still want to catch crashes or timeouts.
Contains
Passes if every key in your expected output appears in the actual output with a matching value. Extra keys are fine. Use when only some fields are deterministic.
Exact
Passes only if the actual output deep-equals the expected output. Use for structured outputs where every field is predictable.
Running test cases
Create a test case
Open the use case in Studio, go to Test Cases, and fill in the input and expected output. Pick an assertion mode that matches what you actually want to verify.
Run one, or run the whole suite
Hit Run on a single test case, or Run all to execute every test case in sequence. Each run spawns a real workflow execution against the current workflow.
Review the result
Each test case shows its latest status — Passed, Failed, or Not run — alongside the execution ID so you can drill into logs.
Inspect mismatches on failures
For
Contains and Exact modes, failed tests show exactly which fields didn’t match. Expected vs. actual is displayed side by side.Tests that involve human tasks
If your workflow pauses on a Human Task node, the test run pauses too — just like a real execution. Respond to the task inline from the test panel and the run resumes automatically. This lets you test end-to-end flows without mocking the human step.Generating test cases with AI
Writing test cases by hand can be the slowest part of testing, especially for workflows with rich input schemas. MagOneAI can generate a starter suite for you by reading the workflow definition, the agents it uses, and any existing test cases.Open Generate with AI
From the Test Cases section, open the generation panel and pick which model to use.
Review suggestions
The AI proposes a set of test cases — each with a descriptive name, realistic input matching the START activity’s input schema, and a reasonable expected output.
AI-generated suggestions respect your workflow’s input schema and existing test cases, so they tend to cover edge cases you haven’t written yourself rather than duplicating what’s already there.
How test cases fit into your process
A few ways teams use testing effectively:- Before publishing. Run the full suite against your latest draft. If anything fails, fix before publishing the revision.
- After a prompt change. Re-run tests to see if the change shifted behavior on cases you already captured.
- When bugs are reported. Turn the failing input into a new test case. Once fixed, the test ensures the bug stays fixed.
- For regression reports. Download the latest suite report as evidence that a release meets your quality bar.
Next steps
Versions & publishing
Pair testing with versioning so you never publish a regression
Workflow overview
Back to activities, the canvas, and workflow basics