Skip to content

Commands

Command Purpose
anvil:workflow:list [--tenant <slug>] workflows and versions; with --tenant their availability in the tenant
anvil:workflow:enable <key> --tenant <slug> makes a workflow available to a tenant
anvil:workflow:disable <key> --tenant <slug> takes it away; records keep their state, transitions stop
anvil:workflow:check validates the definitions, stores new versions, reports records in unknown states; exit code 1 on errors
anvil:workflow:migrate <key> --from <n> [--map a:b,…] [--dry-run] moves records of an older version to the current version, see Versions
anvil:workflow:diagram <key> [--version <n>] Mermaid state diagram
anvil:tick periodic work: overdue steps, forecasts, cases at risk or overdue, task reminders, retention of documents; every minute

Run it after every change of a definition and on every deployment; a failing check (exit code 1) should stop the deployment. It reports, among others:

  • not exactly one initial state,
  • unknown states in transitions, tasks or deadlines,
  • unknown building blocks or resolvers,
  • transitions without actors (except automatic ones),
  • states that cannot be reached, or that have no transitions without being final,
  • durations, goal, expected path and escalations that do not fit (e.g. a goal that is not final, a path without transitions, an escalation that runs a transition with a form),
  • a changed definition with the same version,
  • records in states the definition does not know.
* * * * * cd /var/www/app && php spark anvil:tick

Several servers can run anvil:tick at the same time; deadlines and reminders are claimed before they are processed.