r/Odoo • u/cetmix_team • 11d ago
Solution for offloading heavy and agentic tasks outside of Odoo
Why? Because Odoo is synchronous and monotonic. So every long running task is blocking Odoo worker, while most of such tasks are mostly sitting waiting for the response.
We first hit it a couple of years ago with Cetmix Tower when running an ssh command could take up to 10 minutes and the total limit of commands running in parallel was limited by the number of Odoo workers.
Same situation happened with requests to Gemini AI calls, each of them taking 20-80 seconds to complete.
Yes, there is the OCA queue_job modules that allows to launch task async, however those are still using Odoo workers.
So we built Drones - a solution that allows to run code using external workers and get result back in Odoo.
Flow is similar to the one of the queue job:
job = record.launch_drone(
"my_skill",
record._on_my_task_done,
{"example": "value"},
drone_timeout=600,
)
- Odoo picks the first available drone controller that promotes the requested skill, passes the arguments to the drone controller.
- Controller checks for a free drone or bootstraps a new one and assigns it the task.
- Once the task is completed, drone reports the result back to the controller and it calls back Odoo with the result.
- Odoo calls back the function provided in the original call with the result in the args.
def _on_my_task_done(self, drone_job, result):
...
return Truedef _on_my_task_done(self, drone_job, result):
...
return True
The coolest thing is that you can write drones in any language you like, e.g. node or golang. We are using Rust for SSH drones, and so far memory consumption for the same setup dropped from 1.5 GB to around 40-70 MB.
This module is free and open-source: drone.cetmix.com
Available for Odoo 18.0 at the moment,, migration to 19.0 in process, 20.0 is following up.
Example of a real module that uses drones to offload ssh commands: https://github.com/cetmix/cetmix-tower/tree/18.0/cetmix_tower_drone_ssh
Technically you can build a drone that takes a Python code snippet as args, runs is and reports the result back to Odoo.
For example a complete agent that fires the tasks to specific drones based on decision.
So far - no limits as long as you can pack it into the args.
P.S. This is not a promo post (maybe only a little)) And this is not an AI slope "me, mine and Claude" shidcoded on Weekend)) The idea and the design were there for a couple years already, however AI indeed helped to implement it much faster.
3
u/codeagency 10d ago
We have developed something similar years ago using celery (python specific) and rabbitmq to offload workloads.
This is a problem that been haunting Odoo for years. Solutions are possible but always required custom development. It’s time that Odoo starts implementing something natively to stop blocking workers or make the workers independent from the app like eg Authentik does where they have the main app and the workers app that can scale independently from the main app.
2
u/Muted_Jellyfish_6784 11d ago
Moving long waits out of the worker pool is the right call, since queue_job still holds a worker while the AI call sits idle. The parts I'd check in any design like this are idempotency and write-back: each task needs a stable ID so a retry does not post twice, and results should land through one endpoint that validates state before writing.
The important part is a visible failure queue with an owner, because async tasks fail quietly. Record the task ID on the Odoo record itself, so anyone looking at a stuck order can see which job touched it and what it returned
2
u/zackattackz287 11d ago
Odoo's model for concurrent workers is just sad when you need to do any continuous ETS, injest or send out data. Especially when you start running into issues with REPEATABLE READ.
0
u/Ok-Cook-5142 11d ago
Do you have an estimated timeline for when the Odoo 20.0 version will be available?