to select ↑↓ to navigate
Frappe Framework

Frappe Framework

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Workflows

Workflows

A Workflow turns a DocType into a state machine — document moves between named states through allowed transitions, each requiring specific roles. Use when business rules say "this document must be approved by X before Y".

Anatomy

Concept Example
State Draft, Pending Approval, Approved, Rejected
Action "Approve", "Reject", "Send Back"
Transition From state → action → to state, allowed for which roles

Setting up

  1. DocType has a state field — by default, Frappe creates workflow_state (Link to Workflow State).
  2. Workflow State — define the states with a colour (Success/Warning/Danger).
  3. Workflow Action — the buttons users see ("Approve", "Reject").
  4. Workflow — the rules: from state X, action Y, allowed for role Z, moves to state W.

The workflow replaces the standard Save/Submit/Cancel buttons with the configured action buttons.

Example: Purchase Order approval

Draft → (Submit for Approval, role: Buyer) → Pending Manager
Pending Manager → (Approve, role: Purchase Manager) → Approved
Pending Manager → (Reject, role: Purchase Manager) → Rejected
Approved → (Cancel, role: Purchase Manager) → Cancelled

Notifications

Combine with the Notifications feature to email someone when a document enters a state ("PO awaiting your approval").

Limits

  • Workflows are per-DocType; you can't share one across DocTypes.
  • Only one active Workflow per DocType per Company.
  • The transition role is checked at click-time; ensure roles match real responsibilities.
Last updated 3 days ago
Was this helpful?
Thanks!