Skip to content

How the pieces fit together to make a complete application ​

What this page is for ​

Spark ERP gives you separate tools: entities, pages, rules, workflows, jobs, notifications, integrations, permissions, AI. A real application uses most of them at once. This page shows what each tool is responsible for, how they hand work to each other, and how one business action, a leave request, travels through all of them.

The shape of the platform ​

text
 Person ── Page (blocks, forms)
              │  reads and writes through
              ▼
        Data services / data views / entity API ── permissions checked on every call
              │
              ▼
        Entity engine  ──►  Rule engine ──► Action engine ──► (set a value, reject, call a service, notify, start a workflow)
              │                                                   │
              │ record changed (event)                            ▼
              ├──────────────► Workflow engine ◄── triggers: record change, schedule, API, webhook
              │                      │ human tasks, timers, service nodes
              │                      ├──► Notifications (in-app, e-mail, SMS, Slack, Teams)
              │                      ├──► Integrations (connectors and flows to other systems)
              │                      ├──► AI nodes (prompts, knowledge, agents)
              │                      └──► Records again (create, update)
              ├──────────────► Audit trail
              └──────────────► Jobs (scheduled sweeps over records)

Everything is JSON you design in Studio. Nothing needs a program to be written for the usual cases, and everything you design is packaged in a plugin so another environment can install it.

What each tool is for ​

ToolResponsible forDoes not do
EntityThe record type: fields, types, keys, indexes. Creating one gives you a database table and a full create, read, update, delete APIBusiness decisions
Data provider, view and serviceNamed, permission-filtered reads and writes that pages use, instead of raw tablesScreens
Query enginePaging, filtering and sorting for any grid or KPI, with no codeChanging data
ValidationRefusing a bad value, reused by forms and entitiesMulti-step processes
RuleOne moment in a record's life (before or after create, update, delete): reject, set a value, start a workflow, run a serviceWaiting for people
ActionThe verbs rules and pages use: set, notify, start a workflow, execute a service, recompute a balanceDeciding when to run
WorkflowA process over days across people: approvals, deadlines, escalation, parallel work, waitsShowing screens
JobWork on a clock over many records: remind, expire, generate, sweepReacting to a single save
NotificationTelling someone through a channelDeciding who and when
IntegrationTalking to other systems with stored connections and secretsBusiness rules
Page, form, blockWhat people see and click, bound to dataStoring or enforcing anything
PermissionWho may see or do each thing, checked on the serverHiding by itself
PluginPackaging all of the above to install in any environmentRunning logic
AIDrafting, answering, classifying, acting through tools you allowBypassing permissions

A rule of thumb for choosing: pages show, entities store, rules react to a save, workflows wait for people, jobs wait for the clock, integrations talk outside, permissions decide who.

One action, end to end: a leave request ​

Anna submits two days of leave.

  1. Page and form. A form bound to the leave_request entity. Required fields and dropdowns come from the entity; the form can also hide or lock fields by role (field permissions).
  2. Permission. Anna holds create on leave_request. A record permission means she only sees her own requests later in the grid.
  3. Validation and rule, before save. A validation checks the dates are in order. A rule BEFORE_CREATE rejects the request if she has less balance than days asked, with a clear message. The save is refused before anything is stored.
  4. Entity engine stores the record. An audit entry is written (who, what, when).
  5. Rule, after save. An AFTER_CREATE rule raises the pending days on her leave balance (a ledger recompute) and starts the leave-request workflow.
  6. Workflow. Stage manager: a human task for the manager named in the request's data (${context.managerEmail}), with a two-day SLA that escalates to HR. If the total is more than three days, the next stage hr also applies (a conditional transition).
  7. Notification. On entering each stage, an in-app notification node tells the approver. If the SLA lapses, the escalation reassigns the task.
  8. Decision. The manager approves in the inbox. The workflow moves on and, at the end, a record node posts a LEAVE_USED ledger entry; that recomputes her balance (pending down, used up).
  9. Integration. A Run integration node tells the payroll system, using a stored connection with its secret held by the platform.
  10. Job. A nightly status-date sweep marks requests as completed after their end date; a reminder sweep nudges approvers who have waited too long.
  11. Events and audit. Every step is in the workflow history and the audit trail. Another plugin can subscribe to the same events.
  12. Page again. Anna's grid, filtered by her record permission, now shows the request as approved, and a KPI card on her dashboard shows her new balance.

No step needed code. Each is a JSON artifact you made in a designer.

The balance, workflow and sweep steps are how the HCM Leave application is built. The payroll call in step 9 is an example of what you would add.

The seams between tools ​

These are the places where one tool hands work to another. Knowing them tells you where to look when something does not happen.

FromToThroughIf it does not happen, check
PageDataA binding to a data service, view or the entity APIThe binding scope and name; the person's permission
SaveRuleThe rule's trigger (BEFORE_CREATE, AFTER_UPDATE...) and conditionsThe entity name, trigger, and condition values
RuleWorkflowThe start workflow actionThe workflow is published; the actor holds submit on it
Record changeWorkflowA record trigger in the workflow's metadataThe trigger's entity, event and filter; the loop guard (changes made by the workflow engine itself do not start workflows)
WorkflowRecordsrecord.* nodesThe node's entity and id; the configured actor's permission
WorkflowPeopleHuman tasks, candidate approvers (role, ${context.x}, ${rule.x})The approver value resolved (a missing context key stays as literal text)
WorkflowOther systemsintegration.run, notification nodes through connectorsThe connector exists and its secret is set
ClockRecordsA job (sweep) or a workflow schedule triggerThe job's config row; the schedule's cron and time zone
AnythingAuditPlatform eventsNothing to set up; it is automatic
DesignAnother environmentA plugin packageThe artifact is in the plugin and published

Where each piece lives in Studio ​

PieceStudio screenReference
Entities and fieldsData modelData Model
Providers, views, servicesDataData providers, views, services
Pages, forms, blocksPage Designer, Form Designer, BlocksHow a screen is built, Block catalog
Rules, validationsRules, ValidationsWorkflows, rules and validations
WorkflowsWorkflowsHow workflows work
JobsJobsJobs and scheduler
NotificationsCommunicationsEvents and automation
IntegrationsIntegrationsIntegrations and connectors
PermissionsSecurityPermissions
AIAI StudioAI guides
PackagingPlugin DesignerPlugin Designer

Build order that works ​

  1. Entities first: the nouns of the application.
  2. Security: roles and permissions, because "no rule" means allowed.
  3. Screens: grids, forms and detail pages bound to the data.
  4. Behaviour: validations, rules and workflows.
  5. Insight: dashboards and reports.
  6. Quality: test cases, simulate workflows, check as each role.
  7. Ship: package as a plugin and install in the next environment.

The Build a complete application chapters walk through exactly this order with a worked example.

Where next ​