How I Tested an AI Agent That Creates Real CRM Data
A practical QA case study about testing an AI-agent workflow that collects user input, shows a preview, waits for confirmation, calls external tools, and creates real records in a CRM-like system.
How I Tested an AI Agent That Creates Real CRM Data
AI tools are no longer just chatbots. They are starting to perform real actions: filling forms, calling APIs, creating requests, updating CRM records, and triggering business workflows. From the user’s point of view, this can feel almost magical: you describe what you need in a chat, confirm the action, and somewhere in the system a new entity appears.
But from a QA perspective, this is no longer about checking whether a bot gives a nice answer. This is full integration testing, where AI becomes part of a production-like workflow.
Recently, I tested a similar scenario: an AI assistant in a desktop application had to collect user input, show a preview, wait for explicit confirmation, and only then send the data to an external system. On the CRM side, after submission, several related records had to be created: a contact, a request, and additional fields needed for further processing.
It sounds simple. In practice, it was much more interesting.
What needed to be tested
The main flow looked like this:
A user writes in chat that they need a specialist. The assistant asks clarifying questions, collects the required fields, shows a preview, waits for confirmation, calls a tool/API, and creates records in the CRM.
At first glance, it looks like a regular form, just without traditional UI inputs. But there is one important difference: the user is not filling in strict fields. The user writes like a human.
They may forget an email. They may change their mind after the preview. They may refuse to answer some questions. They may write “send it now” even when the assistant does not yet have all the required data.
So I tested not only the happy path, but also the behavior around it:
- submit only after explicit confirmation
- preview before submit
- editing data after preview
- cancel flow
- incomplete data
- invalid email
- user’s refusal to provide a required field
- record creation in the CRM
- correct source/imported fields
- correct owner assignment
- fallback behavior when the backend/API fails
Why was the preview critical
In an AI-agent workflow, preview is not just a cosmetic step. It is a safety step.
If an assistant can call an external tool that creates real data, it should not do that based on assumptions. The user must see exactly what will be sent and explicitly confirm the action.
One positive case confirmed that the logic worked correctly: the user provided a description, the assistant collected the fields, showed a summary, the user changed the list of skills, the assistant updated the preview, and only after a separate “send it” message did it call submit.
This is important. Without this behavior, an AI agent can easily become a generator of garbage data inside a CRM.
Happy path is only the beginning
The basic scenario passed successfully. The assistant collected the data, showed a preview, waited for confirmation, called submit, and the required related records appeared in the CRM.
But the happy path rarely reveals the real problems. The most interesting bugs usually appear when the user behaves imperfectly.
For example, in one case, the user refused to provide an additional field. The assistant correctly set it as n/a, showed the preview, and submitted the data. For that specific field, this behavior was acceptable, and the entire chain worked.
But a similar email scenario broke the logic.
Bug #1: the prompt allowed n/a, but the schema required a valid email
The assistant instructions had a rule: if the user refuses to provide a field, use n/a and continue.
From a UX point of view, this sounds reasonable. Do not block the user, do not pressure them, and do not loop around one question forever.
But at the tool schema level, email was required and had to pass email validation.
So we had a conflict:
Instruction: if the user refuses, use n/a.
Schema: email must be a valid email address.
What happened during the test:
The user said they did not want to share an email. The assistant showed a preview with Email: n/a and suggested submitting the request.
That is a bug. This preview looked ready to submit, even though the actual submission could not pass validation.
The correct behavior should be different: the assistant must explain that an email is required for contact purposes and should not show a sendable preview until a valid email is provided. Alternatively, the product should explicitly support another contact channel.
This is a good example of a bug at the intersection of prompt engineering and backend validation. Each part may look reasonable in isolation, but together they create an invalid flow.
Bug #2: records were created, but owners were not assigned
The second bug was not about the conversation. It was about CRM side effects.
Submit worked. The contact was created. The request was created. The description was correctly stored in the CRM. Source fields also looked correct.
But the owner fields were empty.
For the business, this is not a minor issue. If a record is created but not assigned to anyone, it can easily get lost. This is especially risky when the CRM is the main working tool for a sales or operations team.
Expected behavior:
Contact owner = assigned responsible person
Request owner = assigned responsible person
Actual behavior:
Contact owner = No owner
Request owner = No owner
This bug is important because the happy path looks successful from the outside. The user sees a success message. The records exist. But the operational process after that may not work.
Error fallback was harder to test than expected
Another interesting part was testing fallback behavior when the backend fails.
The idea was simple: break the API URL, restart the assistant, submit the form, and check that the user receives a clear message like “something went wrong, please submit the request manually.”
But in practice, the desktop application continued using an already running MCP/tool process with the old environment. Changing .env did not affect the active session, and submit still worked successfully.
So the case had to be marked as inconclusive, not pass or fail.
This was also a useful finding: when testing AI tool integrations, it is important to understand the lifecycle of the process. It is not enough to change a config file. You need to verify that the exact process calling the tool was actually restarted and is using the new values.
What I learned from this testing
The main takeaway: an AI-agent workflow should be tested as a real integration, not as a chat.
There is UI logic, validation, API behavior, side effects, CRM fields, permissions, error handling, and human behavior. The assistant may sound confident, but that does not mean it is sending the correct data.
For QA, I would highlight several rules for testing systems like this:
- always check the preview before action
- verify that tools are called only after explicit confirmation
- test edit-after-preview flow
- test cancel flow
- compare prompt instructions with schema validation
- check not only the success message, but also the real data in the target system
- verify side effects: owner, source, status, associations
- test error fallback separately
- mark a case as inconclusive if the environment does not allow honest verification
Why this matters
AI agents are already moving beyond isolated conversations. They do not just answer questions. They move real processes forward: creating leads, updating CRM records, sending emails, scheduling meetings, and triggering automations.
And the more power they have, the higher the cost of a mistake.
A regular chatbot bug is a bad answer.
An AI-agent bug is an incorrect CRM record, a lost lead, a wrongly assigned task, or an action the user did not actually want.
That is why QA for these systems has to look beyond the response text. We need to check what actions were actually performed behind the scenes.
And as this case showed, the most valuable bugs are not usually found in the happy path. They appear at the boundary between human behavior, model instructions, and strict backend rules.
