Viindoo AI - Workflow & Heartbeat Routines (P-OPS-3, base)
The Community-functional base of the P-OPS-3 operating-layer adapter. It ships
the recurring heartbeat routines that let the AI operate a controlled cadence
("AI điều hành doanh nghiệp, không chỉ chat") instead of only reacting to chat.
Key model
- AI Work Routine (viin.ai.work.routine) - the heartbeat carrier. Each
routine scans a target model with a safe_eval domain on a cadence, runs an
analytical agent, and records the resulting operational brief as a work item.
A routine READS: it never writes to the records it scanned.
Who a routine runs as
Every routine names a Service User, and the scheduled run is bounded by that
user's own access rights and record rules - an unattended run reaches no record
the nominated user could not have opened by hand. There is no default: an
administrator chooses the principal deliberately when creating the routine, and
an ordinary employee is a fully supported choice.
Shipped routines
None active. The routines a customer sees are the ones they author against their
own data. (Earlier releases shipped eight built-in routines; they are retired -
they scanned, counted, and produced no business record.)
Scheduled Agent UI (Phase 7.2)
- Prompt template (messages_template) - an admin-authored prompt
rendered via the sandboxed mail.render.mixin inline_template engine
(never raw Jinja/eval); empty is byte-identical to the hard-coded default.
- Cron-builder UX - a read-only next_run_preview and a generic
"Run Now" button (action_run_now) over the single shared heartbeat
cron - no per-routine ir.cron is ever created.
- Cost-cap gate - a scheduled run never bypasses the run principal's
daily cost cap; over-cap is a graceful skip, not a failure. The ceiling is
read independently of the run principal's rights; the spend is still charged
to that principal.
- Failure alerting - consecutive_failure_count / last_error and a
throttled bus.bus alert to base.group_system once
viin_ai_workflow.routine_failure_alert_threshold consecutive failures
are reached.
Routine runner discipline
The routine ir.cron relies on the ir.cron row lock for non-concurrency
(NO manual cr.commit); each routine runs inside its own cr.savepoint()
so one routine's failure never poisons the others. Each routine runs
with_company(routine.company_id) so company-scoped provider / BYOK key
resolution is correct in a multi-company database.
Supported Editions
- Community Edition
- Enterprise Edition
This software and associated files (the "Software") may only be
used
(executed, modified, executed after modifications) if you have
purchased a
valid license from the authors, typically via Odoo Apps,
or if you
have
received a written agreement from the authors of the
Software (see the
COPYRIGHT file).
You may develop Odoo modules that use the Software as a library
(typically
by depending on it, importing it and using its
resources), but
without
copying any source code or material from the
Software. You may distribute
those modules under the license of your
choice, provided that this
license
is compatible with the terms of
the Odoo Proprietary License (For
example:
LGPL, MIT, or proprietary
licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell
copies of the
Software or modified copies of the Software.
The above copyright notice and this permission notice must be
included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT
SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.