Skip to main content

Logic Blocks

What is a Logic Block?

A Logic Block is a function that accepts input and produces one or more outputs. Logic Blocks are immutable functions—they do not change the state of the system. The purpose of a Logic Block is to calculate one or more values in the form of output.

Think of a Logic Block like a mathematical function: given the same inputs, it always produces the same outputs. It reads data but never writes data. It calculates but never modifies. This immutability makes Logic Blocks predictable, testable, and safe to use anywhere in your logic.

Anatomy of a Logic Block

Every Logic Block has:

  • Name: A unique identifier for the block
  • Description: Documentation of what the block does
  • Inputs: Zero or more typed parameters the block receives
  • Outputs: One or more typed values the block produces
  • Logic: The computation that transforms inputs into outputs

Input and Output

Every input and output has a name and a type. The name identifies the parameter, while the type specifies what kind of data it holds.

Inputs can be:

  • Required (must be provided when invoking the block)
  • Optional (may be omitted, using a default value)

Outputs are always produced when the block executes successfully.

Invoking a Logic Block

Invoking a Logic Block means calling it with the required inputs and receiving its outputs. When you invoke a Logic Block:

  1. You provide values for the required inputs
  2. The block performs its computation
  3. The block returns its outputs
  4. You use the outputs in subsequent logic

A Logic Block may also retrieve data from Dynamics 365 during computation. For example, a pricing block might look up the customer's discount tier from their Account record. This data retrieval is read-only—the block never modifies the data it reads.

Types of Logic Blocks

FlowOn Logic provides five types of Logic Blocks, each designed for different scenarios:

Block TypeOutputsBest For
FormulaSingle outputCalculations, transformations, lookups
Decision TableMultiple outputsStructured business rules with conditions
Decision TreeMultiple outputsFlowchart-style decision making
ValidationBoolean (true/false)Single validation rule
Validation SetBoolean (true/false)Multiple validation rules evaluated together

Choosing the Right Logic Block

Need to calculate a single value?
└── Use a Formula

Need to evaluate conditions and return multiple outputs?
└── Is the logic tabular (rows of conditions)?
└── Yes: Use a Decision Table
└── No: Is it hierarchical/branching?
└── Yes: Use a Decision Tree

Need to validate data?
└── Single rule?
└── Use a Validation
└── Multiple related rules?
└── Use a Validation Set

Logic Blocks vs Logic Flows

Logic Blocks and Logic Flows serve different purposes:

AspectLogic BlockLogic Flow
PurposeCalculate valuesOrchestrate processes
StateImmutable (read-only)Can modify data
OutputsReturns calculated valuesPerforms actions
ComplexitySingle computationMulti-step workflow
Use Case"What is the discount?""Process the order"

Logic Blocks are often used within Logic Flows. A flow might use a Formula to calculate a value, then use that value in subsequent steps.