[#triggers]
= Triggers

Sometimes you want to trigger another action after the first one completes. This is mostly useful for updating hidden actions that update entity files, without having to run those updates on a cron job every 10 seconds!

NOTE: OliveTin used to support a single action trigger, but now supports multiple triggers. The field `trigger` was renamed to `triggers` and is now an array of triggers.

[source,yaml]
----
entities:
  - file: /etc/OliveTin/entities/containers.json
    name: container

actions:
  - title: stop {{ container.Names }}
    shell: docker stop {{ container.Names}}
    entity: container
    triggers:
      - update containers

  - title: update containers
    shell: docker ps -a --format=json > /etc/OliveTin/entities/containers.json
    hidden: true
----

