What's New with dbt Labs in Jan 2025: Invocation for Debugging
We’re only one month into 2025 and the biggest dbt Labs headline is their acquisition of Luka Dončić. Sorry, I meant SDF Labs. We're excited about dbt Labs' acquisition of SDF Labs, but we’re also excited about some new dbt Labs features from a data engineering perspective.
One feature, in particular, is the new dbt invocation command. Invocation is a nifty new dbt Cloud CLI command that helps analytics engineers debug active running dbt commands such as run and build. This is a helpful feature for identifying long-running nodes when working with the dbt Cloud CLI. We'll dive into this dbt feature and give a quick scenario on adding invocation to your data ops workflow.
dbt Cloud CLI Overview & Installation
As we mentioned, dbt invocation is a dbt Cloud CLI command that lists active running dbt commands. The “active running” part is key — invocation is a real-time, in-the-moment debugging command for your friendly multitasking analytics engineer. Before you can run it, you’ll want to update to the latest version of dbt Cloud CLI. If you already have the Cloud CLI version installed — this is as easy as running brew upgrade dbt.
Once you’ve upgraded your dbt Cloud CLI you can check out the help command for invocation. Presently, when you run dbt invocation help, the only command under invocation is list. If you run the dbt invocation list command while there are no active runs — it will return an empty list.
dbt Labs Debugging in a Real-World Data Engineering Scenario
Here’s a real-world scenario where you’d use dbt invocation:
- Environment — Your dbt project is on dbt Cloud.
- Developer — You have cloned your project locally and are running commands via the dbt Cloud CLI.
- Situation — You are working on multiple workstreams with a fair share of context-switching.
You then run a dbt build and get the Session occupied message:
Your first thought of course is “Oh great - what SQL queries are hanging?” Your second thought is “What other select statements could be running?” Your next thought would be to just close all your terminal windows and delete all your code. Now with the dbt invocation list — you can find that hanging invocation that’s blocking your session.
The results indicate that you have an invocation dbt build --select config.materialized:table+ that's still running in the background. If you decide to stop this invocation — you can run dbt cancel to end the job.
dbt Invocation Benefits & Next Steps
For analytics engineers like me, this is a neat little command. Since I sometimes use the dbt Cloud CLI, I don’t get all the nice UI elements from working with dbt Cloud natively. I can definitely add this to my workflow, but I see room for this feature to grow. Here are two possible paths:
- Instead of just having the Session occupied error appear when an invocation fails, just put the results of the dbt invocation list in the error message. That would remove the burden on engineers to run the invocation command right after.
- dbt Labs expands on the invocation command further to see invocations from other sessions besides your own. I could see analytics engineers using it to find long-running production, CI, or staging queries when they're outside of the dbt Cloud UI.
dbt Cloud CLI vs dbt core: Looking Ahead
dbt invocation is a great way to understand what commands are currently running in your dbt Cloud CLI. This feature is a promising signal for dbt Labs' focus on the user experience and tools for analytics engineers who are used to the dbt core experience. As someone who's used dbt core in the past for data transformations, I’m curious to see how the command evolves in the future and how dbt Labs levels up the dbt Cloud CLI experience as it grows with the modern data stack.
If you’re and data practitioner looking for help with their data platform and are interested in learning more about dbt, we have a team of analytics engineers here at Brooklyn Data who are excited to chat with you about it. Just reach out to start the conversation.
Note: Brooklyn Data did not acquire Luka Dončić (yet) and he's (probably) not the data analytics engineer most companies are after. Though Luka if you're reading, I'd love to have you as an analyst in our data org.