Search FlexiRule docs

Recent
Pinned

Press Esc to close. Use arrow keys and Enter inside results. Searches are remembered locally.

FlexiRule Docs

Which Action Should I Use?

Choose the right FlexiRule action for common business tasks, from decisions and data lookup to document changes and repetition.

Improve this page

Which Action Should I Use?#

Choose an action by the business outcome you want—not just by the name of a control. The guides below use the current action terminology. The controls, operations, and supported behavior can vary by installed FlexiRule version.

Find an action by task#

Common business taskUseWhy / what to check
Continue one way when a yes/no rule is true, and another way when falseConditionCreates True and False execution paths.
Choose among several known cases, such as status = Draft, Submitted, or CancelledSwitchBetter for multiple configured cases than chaining many Condition blocks.
Set a value or calculate a value for later stepsAssignmentAssigns a value to a supported current-document field or rule variable.
Read a list of records matching filtersQuery Records → Fetch RecordsA newer Query Builder-backed mode. Verify filters, permissions, and returned row shape.
Keep an existing list-style record queryQuery Records → Query ListLegacy mode with a different implementation/contract from Fetch Records.
Read one documentQuery Records → Query DocCheck how the configured result is exposed to later steps.
Test whether a matching record existsQuery Records → Exist RecordUse an existence result rather than retrieving a full list just to test presence.
Count or aggregate matching dataQuery RecordsSelect the supported Count, Sum, Average, Min, Max, or Group By mode that matches the result you need.
Create a new documentDocument Action → Create NewMaps fields and optional child-table rows, then inserts the target document.
Update an existing documentDocument Action → Update ExistingRequires a target DocType and record name; mapped fields are saved.
Delete a documentDocument Action → Delete RecordDestructive operation for one explicitly resolved record.
Create a user task linked to the current documentDocument Action → Create ToDoRequires an assignee and description; links the ToDo to the current context document.
Add a timeline comment to the current documentDocument Action → Add CommentRequires comment text; links the Comment to the current context document.
Run the same steps for each row in a child table or each item in a listLoopThe iterator must resolve to a list/tuple; configure an item alias for the current item.
Send a notificationNotifyUse the supported notification configuration.
Reuse logic from another visual ruleSub-RuleThe target rule must be configured for the supported callable/reusable use case.
Run a registered business process operationProcessThe operation must exist in the installed Process registry.
Pause supported executionWaitCheck execution-mode and lifecycle restrictions for the intended trigger.
Finish a path or deliberately raise an errorStop / ErrorA normal stop and a failed execution have different meanings.

Quick decision guide#

Condition or Switch?#

Use Condition for one logical yes/no decision. Use Switch when a value should select among several configured cases. For example, “total exceeds approval threshold?” is a Condition; “route by document status” is often a Switch.

Assignment or Document Action?#

Use Assignment to set or transform a supported root-level field on the document that triggered the rule, or to update a rule variable. Use Document Action when the task is to create, update, or delete a separate target document, or to create a linked ToDo or Comment.

Query Records or Document Action?#

Use Query Records to read information for later steps. Use Document Action to change data. A query does not itself create, update, or delete a document.

Fetch Records or Query List?#

Both are modes of Query Records, but they are not interchangeable implementations. Fetch Records uses the Frappe Query Builder compatibility path and has its own configuration and result contract. Query List is a legacy mode. Keep existing configurations unless you have verified that a migration preserves their behavior.

Query Records or Loop?#

Use Query Records to retrieve data. Add Loop when you need to perform steps for each returned item. Avoid running the same database lookup inside every loop iteration when one query before the loop can provide the collection.

Condition or Loop?#

Use Condition to decide which path to take. Use Loop to repeat a body of actions for each item in a list. A Condition does not iterate through a collection by itself.

Sub-Rule or Process?#

Use Sub-Rule to reuse visual rule logic. Use Process to execute a registered Process operation. They serve different extension points.

Stop or Error?#

Use a normal stop when the current path should finish intentionally. Use an error when the outcome should be treated as a failure. Check the Stop / Error guide and test the relevant trigger lifecycle.

A safe workflow for choosing#

  1. Describe the outcome in plain language: decide, read, change, repeat, notify, reuse, wait, or stop.
  2. Choose the smallest fitting action and its specific operation or mode.
  3. Check its inputs and output shape, especially when later actions consume a value or collection.
  4. Review permissions and side effects before enabling document changes or permission bypasses.
  5. Test the normal, alternate, empty-result, and error paths in Debug before activation.

→ Actions catalog
→ Document Action and all modes
→ Query Records modes
→ Condition Builder
→ Smart Value System

Last updated Oct 9, 2026