dbt/SQL to DPL conversion with Maia
Many data teams struggle with complex dbt projects characterized by tangled DAGs, endless YAML files, and brittle Jinja macros that are difficult to govern or refactor. Maia solves this by using autonomous AI agents to instantly untangle and optimize these projects, converting them into clean, native, and visual low-code/no-code pipelines in minutes.
dbt promises agile data modelling, but most teams hit a wall of tangled DAG sprawl, endless YAML, and brittle Jinja macros that are a nightmare to govern or refactor. Maia changes the operating model entirely, and our autonomous AI agents instantly untangle and optimize your complex dbt projects into clean native pipelines in minutes. Let's go.
So here's one of these pipelines that I've just converted. I wanna show you what we're going for here with a mixture of three different tables that writes to one fact table at the end. Here is my existing dbt project. I've got different models, intermediate, marts, and staging, and you can see I've got the SQL and the YAML here as well.
So what I'm gonna go ahead and do is come here to the plus, go to convert workloads and select my dbt conversion. Now I can either upload them manually from my desktop or I can use my external GitHub repository, which I'm using here. I'm gonna click continue, and I'm just gonna simply select the variety of different YAML files that we have available to us inside of this dbt projects. I'm gonna find my marts, select those. I'm gonna find my other staging tables as well. So I've got my dbt project here, my intermediate, and lastly, my staging two.
So this is searching for all of my dot SQL and dot YAML files, is why all of my other pipelines are appearing here in this browser. I'm just gonna simply select these pipelines for conversion. I can add additional context if I need, like I can say data already available in the Snowflake target, optimize the pipelines upon conversion. So I'm gonna hit submit here. Maia is now gonna go through and read all of those SQL YAML files related to that particular dbt project, understand how all of them hang together, and then start presenting a plan back to the end user.
We can either automatically accept the plan that Maia presents and just have Maia continue building, or you can actually store that plan as a markdown file in the project as well and have Maia go back through and use it as a springboard to start converting more of these pipelines with any additional rules, skills, or additional config files that you wanna add in. And we've also recently released a Snowflake native app, so it runs inside of a container directly in your Snowflake two.
So Maia has completed the analysis of all of these different facts and dimensions, schemas, as well as the existing SQL and YAML files. And I'm gonna ask Maia to plan this conversion. So let's go ahead and click submit. So Maia has now generated me this folder called conversions, generic dbt conversion guide guidance between the different styles in which users create dbt models today, as well as the user guidance here that I've added in, so optimizing the pipelines upon the conversion.
So the pipeline conversion guide is now gonna go ahead and read through all of the sort of approach, the notes, the ways in which we can optimize this for pushing down inside of Snowflake and perhaps a more performing manner. And Maia's gonna go ahead and actually start the rebuild of all of these pipelines inside of this new environment. And as Maia does this, the Maia team here, you can see its thoughts, you can expand on them, you can read how the Maia team is going about approaching this task, and you can see all of the assumptions that it's made.
It's gonna currently build this up into a plan for us, so we'll be able to actually see how Maia intends about doing both the optimization and the conversion. And you can see it's capturing everything like the business logic, the output that's required, its downstream usage, and perhaps any of the components that it's already gonna think about using to convert some of this logic across into our drag and drop pipeline format.
So now we've got a nice model here that we can expand on and see. So I'm gonna get mine to just hover over here. You can see we've got this sort of existing testing, the intermediate layer analytics tables, the ultimately the clinical reporting and analysis, as well as where the source data is coming from and where that staging layer is currently generated as well. Fantastic. So let's see what Maia comes back with for a plan in a second.
So we've got different agents all operating here under the hood. Some of them are focused on, you know, data quality, validation, some of them are focused on the in particular, this migration agent focused on how to convert these effectively. And then, of course, there's this data engineer agent that's doing the actual thinking and building of all of this out. You can control all of that through skills and rules that you set up here at the config level. So you've got a different set of rules, skills, and configs available, and the Maia team is then sort of using those as and when it sees fit.
So you can see here it's issued four or five concurrent sort of tasks. You can actually expand on the thoughts as well and track that glass box of how the Maia team is thinking about approaching this problem. And then you can see here the task that Maia is currently working on, which is generating those test cases for us to use as well to ensure that the converted pipelines are in fact converting correctly.
Once it's got all of these different it's completed all of these tasks, it's gonna present us up with a plan that we as the converter can then approve or decline with comments as well, and then we can start putting Maia to work on converting these across. Let's see how mine's getting on. It's still just performing that analysis step here, so it's going into a significant amount of detail for each of the existing staging layers and business rules, data quality steps, and also analyzing that downstream usage too.
So now Maia's having a look at the recommendations based off of how the dbt logic and structure looks in comparison to the Maia Foundation logic, and it's now gonna surface back up some dependencies to the end user as well just to think about. So it's not just converting the logic across, but it's also converting the workload and what does that actually mean when it's in operation inside of the Maia Foundation platform and what other downstream impacts are there to be had once we perform this conversion correctly.
So we'll let Maia go through and think about all of this, and we'll check back in a moment's time, see when it's finished its analysis preparation. Okay. So Maia has now checked all of the data sources are available. It's performed queries on our source database and it's worked out that it needs to be querying the Snowflake. So it's checked to all of the Snowflake data is available, and now it's gonna present a full plan back to us here.
So let's have a walk through of what the plan is. So converting eight dbt models for staging to intermediate and to marts into Matillion transformation pipelines, plus an orchestration pipeline to run them in order. So the data already exists in Snowflake, and they're already populated with tables. Here's the dependency graph that it's mapped together for us. Here are the pipelines that it's going to go ahead and create, and then here is detailed steps in each of those pipelines as well.
It's got naming conventions in here too, so you can choose to bring your own through skills or through using the rules file, and then there's also some considerations in here for us to take into account. Fantastic. So I'm gonna go ahead and click accept, and now Maia is gonna go and start performing this conversion for us. So I'm gonna just close all of these down and actually we can watch Maia perform this conversion here on the right hand side.
So we've got our orchestration and transformation pipeline. So Maia started off by building these three transformation pipelines, patients, diagnoses, and encounters. And in each of these, it can work simultaneously, concurrently creating the relevant Data Pipeline Language transformation files that we'll see being visually built here on the canvas. Maia is gonna go through and validate, check sample, test, document, execute, and then push these pipelines out as well into our repository for us. So we really don't need to do anything manually at this stage.
So you can see here it's there we go. Firing through all four of them quite quickly. We've got some load. We've got some filters. So now I've got a patient ID filter that I can see is not equal to a particular value that it's gonna populate for us in a second. And I can also see the standardization and enrichment as well. So all of these expressions that were previously nested in that SQL, I can then see here and I can manually go through and check and edit them. You can see here that it's currently changed that patient ID to not null to match the logic.
There we go. So it's worked out what it needed to do with that filter. All four pipelines are valid, and we're gonna sample to verify. So it's asking permission to run a quick sample just to check and see what the row count is on each four of these different transformation pipelines as well. So we've got four patients, diagnoses, encounters, and results.
So now that the samples come back correct, we can have a look here and visually see that sample just by clicking on a component, hitting validate, and then we can select a component that we'd like to sample off of. And then once we've got this green tick, we're able to then actually visually inspect that sample data here as well. This looks about right. We've got our ID fields here at the start, our encounter date. This is the staging encounters table, as well as the classifying enrichment categories that we wanted to add in here and that is correct. Fantastic.
So we've now got the ability Maia's done all of that checking of the sample for us. It's validated the code, and now it's running on into building these intermediary layers as well where we're joining some of these staging tables together. It also asked us to execute these pipelines, you can actually see here the successful execution time stamps as well of when those pipelines were ran, when these intermediary tables were created. And now we can see where we sorry, where we had that stage encounters table created.
And now we can see that Maia is also validating some of the other pipelines and actually executing some of the intermediary layers here. You can see we've got those ints and it's quite four seconds to execute. We can actually see the row count as well from the task history too. So that's this intermediary patients and intermediary diagnosis summary that's been successfully ran.
Now, if at any point I wanna sort of visually notate the pipelines as well, can do. So if I wanna just add a notation onto the canvas, I simply select those components and Maia actually then visually documents this using human readable summary for us. So I can add that in to the canvas here, so that when I come back, I can quickly scan this and just see what's going on with inside of that pipeline.
So now Maia is working on our fact readmissions table. So it's creating our facts and dimensions. So here's a slightly more complex patients table where we're loading in from three different staging tables, creating some aggregates, joining those together, creating a classifying risk, and then writing out to our dim patients table. And you can see here on the left that Maia is now working on checking and validating that.
And it's worked out that it needs to add additional column in there as well, make sure that it's the right data type, so integer before aggregating. So now it's adding those in to the pipeline for us. Now if at any point we wanna see what that converted SQL looks like, we can always select the component as well. You click validate here. And what we're able to do is then actually toggle this preview SQL preview sequel button on here at the top right. And we can actually then visually inspect what the SnowSequel looks like inside of that environment. So we've got those select froms and group bys in there. That all looks good. Fantastic.
So last but not least, Maia is gonna create that orchestration pipeline that hang that runs our clinical analytics workflow together. So it's gonna create this blue orchestration pipeline. You can see that denoted here by the o, and it's gonna then set up how all of that staging and intermediary layers look like inside of Matillion. Fantastic.
And if we wanted to add any kind of failure notifications or alerting or business logic, we can do that as well by simply clicking on the plus here and specifying, you know, on failure, go and send an SNS message or perhaps go and send a webhook somewhere or simply just to go ahead and output that into the error logs. And you can also use the variables that occur throughout the pipeline. So how many rows were loaded from this particular one becomes a post processing variable that you can then use dynamically to sequence further events in the pipeline as well.
Okay. So we've got our row count coming through here from all of our staging intermediary factor dimension tables. We've got no SQL scripts to use the tools, which all using our visual low code, no code components like aggregate here, which allows us to visually see there is a count of encounter, a sum of inpatient integer, and the average length of stay. And we can then go in and manually change those nice and easily using the UI of the Maia Foundation, or we can have Maia do that for us as well.
Fantastic. All of this looks great. What I'm gonna do, I'm gonna ask Maia to commit and push these changes. I can do that manually here, looking at all of the changes that we see here, generating that commit message with Maia. And then simply review pipelines against the rules that we've got preset within the project, and I can also trigger Maia to review them here as well. So I can say where those review results are, so where we need to have additional end components or perhaps a number of components that reaches the limit that we'd like with inside of our pipeline rules, and you can edit those rules here as well.
So Maia's passed all of the rule checks that we'd like it to do. We've committed those changes, gonna push them out to my remote repository so that all of my other colleagues can start using and working with this and set new pipelines. And in the next video, we're gonna go ahead and schedule one of these. And thanks for watching.
We have successfully converted all of our dbt projects across, ten successful conversions into our Maia Foundation pipelines of orchestration, which orchestrates all of our subsequent staging, intermediary, and fact tables that are created inside of this existing dbt project. And now I can schedule these to run on an hourly or five minute or daily basis depending on how frequently you'll have those tables refreshed, and I can trigger them via the API as well.
You might also like
Our latest resources


Matillion, the company behind Maia, has been named a Visionary in the 2026 Gartner® Magic Quadrant™ for Data Integration Tools.
Data management
