About workflows and approvals ​

A workflow adds approval steps to a document. For example, a sales user creates a Quotation, a sales manager approves it, and a regional manager gives the final approval. The workflow decides who can move the document to the next step.

The default document flow ​

Without a workflow, a submittable document, such as a Sales Order, has three states. Each state has a document status (docstatus):

StateDocstatusMeaning
Draft0Saved. You can still change it. It has no effect on the ledgers or stock.
Submitted1Final. It posts to the ledgers and stock. You cannot change it.
Cancelled2Reversed. To change it, amend it into a new draft.

What a workflow adds ​

A workflow replaces the Save and Submit buttons with your own steps.

  • Workflow states are the steps, for example "Draft", "Pending Approval", "Approved", and "Rejected". Each state maps to a docstatus. A state also has a Style, which sets its color in the list and the form: Success (green), Danger (red), Warning (orange), Primary (dark blue), Info (light blue), or Inverse (black).
  • Workflow actions are the buttons that move a document between states, for example "Approve" and "Reject".
  • Transitions are the rules: from which state, with which action, to which state, and which role is allowed to do it. A transition can have a condition, for example "only when the grand total is above 100,000".

The workflow stores the current state in a field of the document, by default Workflow State. The list shows this state as the document's status.

When to use a workflow, and when not to ​

Use a workflow when a document needs one or more approvals by other people before it takes effect.

Other tools can be simpler:

  • To stop a role from submitting a document at all, remove the Submit permission of the role in the Role Permission Manager.
  • To require a manager's approval only above a value or a discount, use an Authorization Rule.
  • To share out documents among users without an approval, use an Assignment Rule.