Queued Automations - when are they actually put in the queue?

This might be a daft question but is a queued automation (mode: queued) put in the queue after the conditions are checked or are they always queued and then the conditions are checked when it reaches the front of the queue?

From the docs, I’d say it’s after the conditions are checked.

1 Like

Thanks.
I did try to find it…
It’s not here - Automation Modes - Home Assistant (home-assistant.io)

Where did you find it?

Exactly there, but also from the rest of the docs:

  1. Automations don’t start the actions until after the conditions are passed. The conditions are checked at the time one of the trigger statements becomes true.
  2. That link says when the automation is triggered while the actions are still running from a previous trigger

Without diving through the source, that (to me), strongly points to the conditions being checked and then the actions being queued.

Yes thanks, I think it is a little ambiguous, or at least hard to ascertain for sure from the way the docs are written.

I’ve done some testing though and I think your suggestion is correct.

I might have a go at updating the docs but I suspect it might be more than a simple one line change/update.

As an Admin, would you agree to pnbruckner being tagged in this thread? I believe it was they who added this (brilliant) functionality and I who suspect knows the code better than anyone?

Generally, as mentioned in the pinned message, tagging folks isn’t good :wink:

If you open a PR for the docs then the relevant people will be involved in reviewing it.

Done, and it has been accepted.
Thanks for the shove in the right direction.

I always understood it’s the automation’s action that’s queued because that’s where it “performs work” and might be expending time doing it (even waiting due to the use of delay or wait_template or wait_for_trigger). After all, the concept of mode (single, parallel, queued) applies to scripts and is explained in the Scripts integration. An automation’s action is effectively a script.