MitDesk docs
Automations

Dry runs and grants

5 min read Odoo 20.0

Two things decide whether a flow is safe: what it would do, and what it may do without asking a person. A dry run shows the first. An autonomy rule (also called a grant) sets the second.

Who this is for: people who build and publish flows.

You need: Edition: Pro and above (module minddesk_flow). See Editions.

Dry run: test without changing anything

Press Dry run in the builder toolbar. It works on drafts and on live flows. You need edit rights on the flow.

  1. Pick a record and press Run simulation. The flow reads the record as its run-as user. If that user cannot see the record, you cannot test with it.
  2. Read the report. Each step shows one of these results:
Result Meaning
Runs The step would run at once.
Asks a person The step would wait for an approval.
Refused A rule would stop the step. The reason is shown.
Cannot be judged MitDesk could not decide for this step.

What you should see: a report with one result for each step.

What a dry run does and does not do:

  • Everything happens inside a database step that is rolled back at the end, also when the test succeeds. Nothing stays behind.
  • One thing really runs: a read-only tool that the consent gate would allow without asking. This way the report can show real results. Bulk exports and similar data-out reads do not run. A tool that a policy refuses does not run either.
  • AI steps are not started. The report only says which agent would be asked and with what instruction. An AI yes/no question is not asked. The report follows the yes path.
  • A Delay reports how long it would wait. It does not wait.
  • The test stops where a real run would stop. It uses the same limits and says which limit it reached.
  • A dry run writes one flow_dry_run entry to the audit log. This entry stays.

Scheduled and date flows

These flows have no single record. Use Preview current matches to see how many records match the filter now. The test then simulates up to three of them. A flow that runs once for the whole job is shown as one run without a record.

Autonomy rules: what a flow may do alone

By default, a step that changes data asks a person. An autonomy rule lets the run-as user run one tool without asking.

A rule names one tool. You can narrow it to one record type (model) and one operation.

To add one:

  1. Open the flow with Details, and go to the Autonomy Rules tab.
  2. Add a line with the tool, and optionally the model and the operation.
  3. Read the outcome column. execute means the rule can work. Anything else means the rule is blocked, and the next column gives the reason.
  4. Publish the flow.

Adding a line changes nothing yet. The rule takes effect when you publish. Publishing creates one ordinary autonomy rule for the run-as user, named Flow <flow name>: <tool>. You can see it in Configuration ▸ Rules ▸ Autonomy Rules. Use the filter Runs by itself (execute) to list all rules that run alone. See Autonomy policies.

Autonomy Rules: reading contacts runs by itself, changing contacts asks a human

If you publish again, MitDesk withdraws the old rules and creates them again. Rules never pile up. A rule that an administrator wrote by hand is not part of the flow. Publishing, archiving or deleting the flow does not change it.

Who may publish

An Automation Manager can publish flows without rules. As soon as a flow has one rule, only a MitDesk Administrator can publish it. Building a flow and giving it freedom are two separate decisions.

Rules that cannot work

A rule only works if the outcome is execute. It does not work for:

  • a tool that does not exist;
  • a call where the target is not known beforehand;
  • a tool that the product always shows to a person first;
  • a sensitive or financial target, or a MitDesk control record;
  • a tool that always needs explicit consent, or one that deletes data;
  • a tool that works on a target found only at run time;
  • a call shaped as a method call. Every server action is like this, so a Server action step always asks.

Publish stops if a rule would not work. This way no rule looks active when it is not. See How consent works.

When a rule ends

A rule stops working when the flow is no longer live. MitDesk archives the rule. It never deletes it, so the history stays readable. This happens when you:

  • archive the flow, or set it to any state except active;
  • change the run-as user. The new user gets nothing until you publish again;
  • delete the flow;
  • change or delete a line in the Autonomy Rules tab.

The audit log records grant_materialized when you publish and grant_revoked when a flow stops being live.

Limits for each flow

Every flow has its own limits on the Details form, in the group Budgets & kill-switch.

Setting Default What it limits
If a step fails (error policy) Abort Stop the run, or skip the step.
Self trigger max depth 3 How often a flow that starts itself may start again.
Max steps 200 Steps in one run, loop rounds included.
Max wall clock s 60 Seconds for one run, checked before each step.
Max batch records 500 Records one event or one scheduled run may process.
Max direct calls per run 200 Actions and tool calls. 0 means no limit.
Max cost per run (USD) 0 Cost of AI steps in one run. At the limit, the next AI step does not start and the run ends as done. 0 means no limit.
Monthly budget (USD) 0 Cost of AI steps since the first of the month. At the limit, the flow stops starting until the next month, or until you raise the limit and publish again. 0 means no limit.

Spent this month (USD) shows the cost so far. Work given to a digital employee uses the employee's budget, not the flow's.

To stop all flows at once, use Pause / Resume Autopilot. See Automations you can read.

If it does not work

If a run-as account is refused, see Troubleshooting.