Skip to content
HPI — High Tech Professions Institute

Development and Automation

Flow or Apex — an informed decision, not a habit.

Building Salesforce automations and developments with a conscious choice between declarative and code, based on complexity, performance, and maintenance cost — including testing, version control, and technical debt reduction.

Capability Map

What's Included and in What Order

This map illustrates the work layers in this service, from infrastructure to user-facing capabilities.

Development and Automation — Capability Map

  1. Flow

    Declarative automation with clear structure, consistent naming, and documentation.

  2. Apex

    Complex logic, high volumes, and true unit tests.

  3. LWC

    Dedicated interfaces that streamline daily work.

  4. Platform Events

    System decoupling using events instead of direct calls.

  5. Testing and Quality

    Significant, not formal, test coverage, and code review.

  6. Version Control

    Sandboxes, controlled release, and change documentation.

Each layer builds upon the one above it. Skipping an early layer is the most common reason for rework later on.

The Background

What Truly Matters Here

Most technical debt in Salesforce doesn't stem from bad code, but from an abundance of automations built independently on the same object, without anyone seeing the full picture.

The practical rule is simple: what can be declaratively and clearly solved – should be built that way. What requires complex logic, high volume, or precise control over the order of operations – is justified in code, with tests.

Every automation needs an owner and documentation. An automation whose purpose is unknown will remain in the system for years, silently breaking things.

Areas of Work

What we actually do

Flow

Declarative automation with clear structure, consistent naming, and documentation.

Apex

Complex logic, high volumes, and true unit tests.

LWC

Dedicated interfaces that streamline daily work.

Platform Events

System decoupling using events instead of direct calls.

Testing and Quality

Significant, not formal, test coverage, and code review.

Version Control

Sandboxes, controlled release, and change documentation.

Decision Matrix

Decisions that determine the outcome

Field Updates and Conditions

Declarative
Flow
Code
What is Decisive
Simplicity and maintainability

Logic with many exceptions

Declarative
Difficult to maintain
Code
Apex
What is Decisive
Number of conditions and calls

High volume of records

Declarative
May encounter limitations
Code
Optimized Apex
What is Decisive
Scope of processing

Dedicated interface

Declarative
Standard page
Code
LWC
What is Decisive
Interaction complexity

Publishing to multiple systems

Declarative
Direct calls
Code
Platform Events
What is Decisive
Number of consumers and fault tolerance

How We Work

Execution stages

  1. 01

    Mapping existing automations

    What runs on each object and in what order.

  2. 02

    Approach decision

    Declarative or code, with documented reasoning.

  3. 03

    Building

    Naming standard, modularity and prevention of duplication.

  4. 04

    Testing

    Positive and negative scenarios, not just coverage.

  5. 05

    Release

    Sandbox, review, and defined release window.

  6. 06

    Cleansing

    Removing unnecessary automations and reducing debt.

Frequently Asked Questions

Frequently Asked Questions

Is Flow always preferable to Apex?
No. Flow is preferable when the logic is simple and clear, as it is inexpensive to maintain and accessible even to Admins. For complex logic, high volumes, or a need for precise control over the order of operations, Apex with tests is the safer choice.
How many automations are allowed on one object?
The number is less important than transparency. The problem arises when no one knows what is running and in what order. An organized standard and documentation are more important than a rigid rule.
What is considered technical debt in this context?
Duplicate automations, code without tests, unused fields, overly broad permissions, and logic without an owner. All of these increase the risk with any future change.
Do we need a DevOps tool?
When there is more than one developer or a consistent release cadence — yes. In a small environment, an organized Sandbox process and documentation may suffice in the initial stage.

The Next Step

Assessing the Automation Layer

We will map what is currently running, identify redundancies, and define a maintainable standard.