Lithify / docs PRIVATE BETA
Docs / Workflow rules

Workflow rules

Workflow rules are how Lithify gets opinionated about your briefs without you needing to write any code. Every rule is the same shape — when something happens, if some condition holds, then do this. You build them in the UI from a small list of building blocks; Lithify takes care of running them in the right order.

The shape of a rule

When
Something happens to a brief. The two events you can hook into are a brief enters a state and an agent finishes a run.
If
An optional check. You can compare the brief's type, priority, source, confidence, etc., and combine several checks with AND / OR. Skip the if step entirely when the rule should always fire.
Then
One or more actions, applied together: assign someone, move to a state, or run an agent. If any of them can't run, the whole rule rolls back so the brief never lands in a half-applied state.

What you can react to

EventFires when
A brief enters a stateThe brief just transitioned into Inbox / Ready / Working / Review / Done / Cancelled.
An agent finishesThe flagging, refining, coding or mailer agent just completed a run. You can also filter on whether it succeeded.

What you can do

ActionEffect
AssignHand the brief to a teammate, an agent, or "the right person" (Lithify picks based on type and project role).
Move statePush the brief to a new state, as long as the move is legal from where it currently is.
Run an agentFire an agent right now — most often the mailer, to send a notification in reaction to something happening.

Rules every project starts with

Each new project ships with the rules below. You can edit them, disable them, or add new ones from Project → Workflow.

Auto-promote high-confidence refines

When After the refining agent finishes
If Confidence is at or above 80%
Then Move the brief to Ready

Cancel anything flagged as spam

When After the flagging agent finishes
If Verdict is spam or injection
Then Cancel the brief

Send bugs to the coding agent

When When a brief enters Ready
If Type is bug
Then Assign to the coding agent

Page QA on critical bugs

When When a brief enters Ready
If Type is bug AND priority is critical
Then Send the QA mailer

Hand low-confidence refines to a human

When After the refining agent finishes
If Confidence is below 80%
Then Assign to the project manager

How rules run

  1. Something happens — a state change, or an agent finishing.
  2. Lithify looks at every enabled rule whose when matches.
  3. It tries them in priority order. The first one whose if matches wins.
  4. That rule's actions are applied together. If any one can't run, none of them do.
  5. The brief's timeline shows which rule fired (or that no rule matched), so you can always trace what happened.

Order matters. Only one rule runs per event. If two rules could both fire, put the more specific one above the more general one — that way "critical bugs" get the special treatment before "all bugs" sweeps them up.