Build Synthetic Records That Exercise Real Workflow Decisions
Prepared with AI assistance by Alactic Editorial. Examples identified as hypothetical are illustrative, not customer results.
A test contact can have a convincing name, company, and conversation history yet tell you almost nothing about whether an automation makes the right decision. If every record is complete, eligible, and new, every run may follow the same successful path.
Build synthetic data for business automation testing from the decisions backward: list the conditions that change an outcome, construct records that isolate those conditions, and specify both the expected action and the actions that must not happen. Give every record a known starting state so that a result can be explained rather than guessed.
The fictional worked example below provides a filled test pack for an inbound-request routing workflow. It uses invented identifiers and deliberately sparse records. Its purpose is to test routing, state transitions, and duplicate prevention—not to simulate a complete customer database.
1. Define the decision contract before inventing records
Start with a short, ordered description of what the workflow should do. Without an agreed rule order, two testers can interpret the same record differently and both believe their expected result is correct.
Fictional worked example: a business receives inbound service requests. An authorised workflow may create one internal follow-up task and route it to a queue. It does not contact a customer. The following rules, values, and thresholds are hypothetical design choices, not product defaults.
- Check execution authority. If the test actor lacks permission to run this workflow against the request, deny execution. Make no changes to the request or its tasks.
- Check request state. Only requests in
receivedstate enter routing. Other states produce a no-op. - Validate the decision fields.
service_codemust bestandardorspecialist.estimated_valuemust be a non-negative whole number or an explicit null. Invalid values move the request toneeds_correctionwithout creating a task. - Check for an existing follow-up. If a task already exists for this request and workflow purpose, do not create another. Move the request to
routed_existingand preserve the existing task. - Route missing estimates. A null estimate creates a task in
triage. - Route specialist work. A specialist request with a known estimate creates a task in
specialist_review. - Apply the value threshold. A standard request with an estimate of at least 5000 creates a task in
priority_review. A lower estimate creates one instandard_review.
Successful task creation changes the request state to routed. These rules deliberately put missing information ahead of specialist routing, and specialist routing ahead of value routing. That precedence is part of the testable contract.
If the business wants a different order, change the contract first. Do not quietly change a record's expected result to match whatever the workflow currently does.
2. Keep only fields that can explain the result
The pack needs a small schema, not a realistic customer profile. Use the following fields consistently across every fixture:
case_label: the stable label used in test reports.request_id: a fictional object identifier.actor_allowed: the test fixture's expected permission result, backed by a corresponding test identity or mocked permission response.request_state: the request's state before execution.service_codeandestimated_value: the business decision inputs.existing_followup: eithernoneor a task identifier plus its queue.
Do not implement actor_allowed as a user-editable production field that grants permission. Here it describes a test precondition. The test runner must arrange the actual execution context separately.
For this hypothetical workflow, a duplicate means an existing task linked to the same request_id and the purpose inbound_followup. A matching company name or similar description is not enough. Make that relationship explicit when seeding tasks.
Keep null distinct from zero. In this contract, null means the estimate is unknown; zero is a known, valid estimate below the threshold. A blank string is invalid unless the workflow explicitly normalises it before this decision point.
3. Use this filled synthetic-data pack
All records and expected outcomes below are fictional. Each case is independent unless a replay instruction says otherwise. Seed each case from its stated starting conditions, not from the result of another test.
Shared defaults are actor_allowed=true, request_state=received, and existing_followup=none. Every record below inherits those defaults unless it explicitly overrides them. All created tasks use purpose inbound_followup.
Value routes and boundaries
- S01 — Ordinary standard request.
request_id=SYN-001; service_code=standard; estimated_value=1200. Expected branch: standard routing. Expected result: one new task instandard_review; request becomesrouted. No priority or triage task. - S02 — Just below the threshold.
request_id=SYN-002; service_code=standard; estimated_value=4999. Expected branch: standard routing. Expected result: one new task instandard_review; request becomesrouted. - S03 — Exactly on the threshold.
request_id=SYN-003; service_code=standard; estimated_value=5000. Expected branch: priority routing. Expected result: one new task inpriority_review; request becomesrouted. This distinguishes>=from>. - S04 — Known zero estimate.
request_id=SYN-004; service_code=standard; estimated_value=0. Expected branch: standard routing, not missing-information routing. Expected result: one new task instandard_review; request becomesrouted.
Competing conditions
- S05 — Specialist and high value.
request_id=SYN-005; service_code=specialist; estimated_value=8000. Expected branch: specialist routing takes precedence over value. Expected result: one new task inspecialist_review; request becomesrouted. No priority task. - S06 — Specialist with an unknown estimate.
request_id=SYN-006; service_code=specialist; estimated_value=null. Expected branch: missing estimate takes precedence over service. Expected result: one new task intriage; request becomesrouted. No specialist task.
Invalid inputs
- S07 — Unsupported service.
request_id=SYN-007; service_code=unlisted; estimated_value=1200. Expected branch: validation failure. Expected result: request becomesneeds_correction; task count remains zero. The recorded reason identifies the unsupported service value. - S08 — Negative estimate.
request_id=SYN-008; service_code=standard; estimated_value=-1. Expected branch: validation failure. Expected result: request becomesneeds_correction; task count remains zero. The recorded reason identifies the invalid estimate.
Existing state and execution controls
- S09 — Existing task overrides a new route.
request_id=SYN-009; service_code=specialist; estimated_value=8000; existing_followup=TASK-SYN-009 in standard_review. Expected branch: existing follow-up. Expected result: request becomesrouted_existing; the same task remains instandard_review. No new task and no reassignment. - S10 — Invalid input with an existing task.
request_id=SYN-010; service_code=unlisted; estimated_value=1200; existing_followup=TASK-SYN-010 in standard_review. Expected branch: validation failure precedes duplicate handling. Expected result: request becomesneeds_correction; the existing task remains unchanged; no new task. - S11 — Request already closed.
request_id=SYN-011; request_state=closed; service_code=standard; estimated_value=8000. Expected branch: state no-op. Expected result: state remainsclosed; task count remains zero. - S12 — Actor not authorised.
request_id=SYN-012; actor_allowed=false; service_code=standard; estimated_value=8000. Expected branch: execution denied. Expected result: request remainsreceived; task count remains zero. Verify this using an independent authorised observer rather than granting the denied actor extra access.
This pack is intentionally small. S01 establishes an ordinary baseline; the other cases isolate boundaries, precedence, bad inputs, or state. It is a starting suite, not proof that every possible combination is covered.
4. Map records to decisions, not just outcomes
Two records reaching different queues do not prove that every earlier decision worked. Maintain a compact coverage ledger beside the fixtures:
- Authority: S12 exercises denial; S01 exercises an allowed run.
- Starting state: S11 exercises rejection of a non-received state.
- Validation: S07 and S08 exercise separate invalid fields; S04 confirms that zero is valid.
- Existing task: S09 exercises preservation; S10 tests its precedence relative to validation.
- Missing estimate: S06 exercises null and its precedence over service.
- Service routing: S05 exercises specialist precedence over a high estimate.
- Threshold: S02 and S03 distinguish the two sides of the boundary.
A branch expectation is stronger when it includes a forbidden action. S05 must create a specialist task, but it must also avoid creating a priority task. Otherwise, a workflow that fires two independent rules could appear to pass.
This is targeted branch and precedence coverage, not exhaustive path coverage. Add cases when another condition can independently change the result. If region later affects queue selection, introduce region-specific contrasts rather than generating hundreds of arbitrary profiles.
5. Omit realism that cannot change a decision
The pack intentionally excludes customer names, phone numbers, email addresses, street addresses, employer histories, and conversation transcripts. None affects this routing contract. Omitting them reduces fixture maintenance and avoids copying customer records merely to make a test look convincing.
Free-text descriptions are also absent. Adding a fictional paragraph to every request would make the pack harder to scan without improving these assertions. If a later workflow classifies text, create a separate text-classification fixture set with explicit expected labels and ambiguous cases.
Realism becomes useful when representation affects execution. For example, if a form supplies the estimate as text, add adapter tests for "5000", an empty string, and malformed input. Keep those distinct from the routing tests, where the estimate is already a typed number or null.
If a system requires display fields, use plainly synthetic labels such as Synthetic Request S03. Do not introduce plausible contact destinations that an accidental outbound step could use.
6. Run from known states and capture observable evidence
Use an isolated test environment or another explicitly authorised setup with external actions disabled or replaced by test doubles. Confirm the setup before loading fixtures. Do not assume that a test label prevents real execution.
- Seed and inspect. Load the request, any existing task, and the intended test identity. Read them back to confirm the actual starting state.
- Execute once. Trigger the workflow through the entry point being tested. Record the case label, run identifier, and workflow version.
- Compare results. Inspect request state, matching task count, queue, and task identity. Where decision traces exist, compare the reported reason too.
- Check absence. Confirm that forbidden extra tasks, queue changes, and outbound actions did not occur.
- Reset explicitly. Restore the fixture before another independent test. Do not rely on remembering what a previous run changed.
For each case, the result log should hold expected versus actual state, task-count change, queue, preserved task identifier where relevant, and a pass or fail decision. A successful execution response alone does not establish a correct business outcome.
7. Test replay and recover without hiding failures
After S03 passes, run it again without resetting. Its request is now routed, so the second execution should take the state no-op branch and leave the single task unchanged. Record this as a replay check linked to S03, not as a fresh run of its original fixture.
That replay does not prove safe handling of two simultaneous executions. If concurrency matters, test it separately with controlled overlapping runs and an explicit expectation of one matching task.
For failure recovery, add a controlled fault after task creation but before the request-state update, if the test environment supports it. Inspect the resulting state rather than assuming a particular transaction model. If the request remains received and the task exists, retrying should follow the existing-task branch and avoid a duplicate.
If that retry creates another task, preserve the evidence before cleanup. Investigate the duplicate lookup, relationship key, and timing. Do not delete the extra task and mark the run successful. If fault injection is unavailable, document this recovery path as untested.
8. Make the next test cycle measurable
Start with the twelve fixtures above and the replay check. Before execution, have the workflow owner approve the rule order, threshold, and expected state changes. Then report passed assertions, failed assertions, and cases not run separately.
A useful completion target for this hypothetical pack is that every listed case has an observed result, every mismatch has a reproducible starting fixture, and no unexpected task creation remains unexplained. A coverage ledger with only successful paths is not complete simply because all executed tests passed.
When a defect appears, retain the smallest synthetic record that reproduces it and add that case to the pack. The resulting dataset should grow because it captures a newly understood decision—not because more realistic-looking records seem more convincing.
Put the next conversation to work.
Explore Alactic Communications for WhatsApp conversations, campaigns and AI-assisted workflows. Choose the product and plan that fit your team.
Explore Communications