I want to build a conversational data collection system that automatically extracts and classifies information from chat messages into structured JSON format. When a customer provides information in natural language - for example, “I’m 25 years old, male, and I weigh 75kg” - the system should intelligently parse this response and populate the corresponding database columns (age: 25, gender: “male”, weight: 75.0). The key is that only the mentioned fields get updated while unmentioned fields remain null, allowing information to be collected incrementally across multiple messages. This way, each conversation turn adds new pieces of data to build a complete customer profile without overwriting existing information or requiring customers to fill out rigid forms
Hey @Feramuz Welcome to the n8n community!
What you want to build is very doable in n8n and your approach is the right one.
The common pattern is:
- Use an AI node to extract structured data
Pass the incoming chat message to an AI Agent or Chat Model and ask it to return a strict JSON object with only the fields it can confidently extract, for example:
{
"age": 25,
"gender": "male",
"weight": 75
}
Unmentioned fields should be omitted or set to null.
-
Merge with existing Airtable data
Before updating Airtable, fetch the current record. Then merge the new JSON on top of the existing data so only provided fields overwrite existing values. This prevents wiping fields that were not mentioned in the current message. -
Update Airtable selectively
Use a Set or Code node to build the update payload dynamically, only including keys that exist in the AI output. Airtable will leave all other columns unchanged. -
Repeat across messages
Because each message only updates what is mentioned, the customer profile is gradually completed over multiple conversation turns without forcing a form-like experience.
This incremental enrichment pattern works very well for conversational data collection and is a common use case for AI Agents in n8n. Let me know if this helps! Or if any error comes in the execution of this workflow.
I tried that approach, but it shows the structured output in the chat too. I don’t want users to see that, they should only see natural conversation responses. Is it possible to separate outputs?
Hey @Feramuz , You can mention that output separation inside the system prompt and that would make it work! If you don’t mind you can share your workflow JSON that would help me narrow down the issue.
i changed a bit workflow but if we can do what i mentioned it will be good. Thanks a lot buddy.
deneme1.json (5.6 KB)
Hey @Feramuz , Understood, what you are trying to do is that to let the AI agent define its own columns in the data table and then by more human interaction the more data gets collected and if data is available it will store it else it would set it as null until it gets updated, for this kind of flow, you need to keep somethings in mind, in the AI Agent you need to give tools like
“Read Data” “Update data” “Create Column” “Create Row” “Get Table”
So with these kind of tools the AI Agent will be able to perform this tasks for you, and this will also follow your approach of dynamically letting the AI Assist on user’s query not just get limited to some prefixed columns and sections, this will help you achieve your goal! Let me know if this helps
@Feramuz do you need more assistance with that workflow? Or any specific query related to the AI Agent?
I can’t understand how I’ll map user answers to specific Airtable columns. You know, the user’s answers might differ depending on the question. User reply one or more question. For instance, 45, male and no allergic to anything. it has three answer in other words should be mapped to three column.
if possible can you share an example related to what i want? i am new at n8n as you understand
I got you @Feramuz, You don’t map answers manually to columns.
Instead, you let the AI extract meaning first, then n8n handles storage.
Example:
User says:
“45, male and no allergic to anything”
The AI converts this internally to structured data:
{
age: 45,
gender: "male",
allergy: "none"
}
The user never sees this.
In n8n, you loop over these key value pairs:
-
For each key (age, gender, allergy)
-
Check if the Airtable column exists
-
Create it if it doesn’t
-
Update the row with the value
So one user message can update one, two, or ten columns automatically.
No fixed questions, no manual IF statements per field.
Think of it as:
Conversation stays human, data becomes structured in the background, And a workflow that i can share to give an example of how things would be structured will be like:
will try, thx a lot
Glad you liked it! What i mean is that dont focus on the workflow try understanding the concept of the solution i am trying to convey, there can be 100s of workflows for solving a single problem in many ways, so focus on what you think you understood and try building that, Let me know if you need any help!
