PAZATOR DOCS
WORKFLOW
FEATURE — v3 · 13 TRIGGERS · 18 ACTIONS · 19 OPERATORS

TASTUR v3
WORKFLOW.

Overview

TASTUR v3 is a complete rewrite of the Pazator workflow engine. 13 trigger types, 18 action types, compound conditions with AND/OR/NOT logic, template variables, sub-workflows, state machines, cron scheduling, data threshold monitoring, execution log with analytics, dry-run mode, import/export, versioning with rollback, and a visual rule builder with inline variable autocomplete. Rules follow the WHEN trigger IF condition THEN action pattern, now supporting multi-action sequences and action pipelines.

Triggers (13)

Events that activate a rule. Each trigger exposes specific event variables usable in conditions and action params via {{event.xxx}}.

tab_switchUser switches tabs. Vars: to.
data_addedNew data saved. Vars: count, store.
threat_detectedHigh-risk entries found. Vars: count, threats.
search_performedAfter a search. Vars: query, results, count.
app_loadOnce on application start. Vars: timestamp.
data_changedAny store mutation. Vars: store, action.
scheduleInterval-based timer. Vars: ruleId, interval. Config: interval (5m, 1h, 1d).
entity_crudEntity created/updated/deleted. Vars: entityId, entityType, crudAction, name, credit, threatLevel, workplace, nationality, tags.
cronFull cron expressions (*/5 * * * *) or @every 5m, @hourly, @daily, @weekly. Vars: ruleId, expression.
data_thresholdAggregate metric crosses threshold. Fires only on transition. Config: metric (totalHumans, totalObjects, highRiskCount, avgCredit, caseCount, threatCount), operator, value.
ai_analysisAI analysis matches a regex pattern. Vars: pattern, analysisType, result, confidence, entityId.
file_uploadFile upload or data import. Vars: fileType, fileName, rowCount, entityId.
webhook_incomingExternal POST to /workflow/trigger/{ruleId}. Vars: body, headers, method, source. Config: secret, bodyPattern.

Actions (18)

What happens when a rule fires. Actions execute in sequence. Each action's params support template variables ({{event.xxx}}, {{rule.name}}).

popupModal alert dialog. Params: message.
notifyFloating notification. Params: message.
toastStyled toast. Params: message, type (info/success/warning/error).
tabSwitch to a tab. Params: target.
webhookCall external URL. Params: url, method (GET/POST/PUT/DELETE), headers (JSON), body.
api_callCall Pazator internal API. Params: endpoint, method, body.
create_entityCreate person/organization. Params: entityType (human/organization), name, properties (JSON).
update_entityUpdate existing entity. Params: entityId, properties (JSON).
delete_entityDelete an entity. Params: entityId.
add_tagTag an entity. Params: entityId, tag.
create_caseCreate a case. Params: title, description, entities (comma-separated IDs), status.
add_relationshipLink entities. Params: sourceId, targetId, type, strength (1-5).
ai_promptSend prompt to Zor/LLM. Params: prompt, systemContext, outputVar (saves result to variable).
branchConditional IF/ELSE. Params: conditionExpr (JSON condition), thenActions (JSON array), elseActions.
loopForEach over array. Params: sourceVar, itemVar, actions (JSON array to repeat).
waitPause execution. Params: duration (5s, 2m), waitUntil (ISO date).
export_reportGenerate and save report. Params: format (json/csv), title, query (store name), saveKey.
call_workflowExecute another rule as sub-workflow. Params: ruleId, params (JSON).
karlineCreate a Karline plan action. Params: title, type (static/dynamic), date, endDate, description, goal.

Conditions

The optional IF clause can be a simple condition or a compound group.

Simple Conditions

Compare an event field against a value using one of 19 operators:

== · != · > · < · >= · <= · contains · regex · in_array · exists · null · between · starts_with · ends_with · before · after · within_last · day_of_week · business_hours

Compound Conditions

Group multiple conditions with AND, OR, or NOT logic. The rule editor provides a visual builder for compound conditions with add/remove sub-conditions.

AND: { "logic": "and", "conditions": [
  { "field": "count", "op": ">", "value": "5" },
  { "field": "to", "op": "==", "value": "threats" }
]}
OR:  { "logic": "or", "conditions": [...] }
NOT: { "logic": "not", "conditions": [{ "field": "count", "op": "==", "value": "0" }] }

Date / Time Conditions

before — event timestamp before a date
after — event timestamp after a date
within_last — within last N (5m, 1h, 7d)
day_of_week — 0 (Sunday) through 6 (Saturday)
business_hours — true Mon-Fri 9-5

Template Variables

Any action parameter or condition value can reference dynamic data using {{...}} syntax. The action editor shows clickable variable chips for the selected trigger and auto-fills smart defaults when you switch action types. Type {{ in any param field for autocomplete.

{{event.to}}              — trigger event field
{{event.count}}            — event count
{{event.name}}             — entity name
{{event.entityId}}         — entity ID
{{event.threatLevel}}      — threat level
{{rule.name}}              — rule name
{{rule.id}}                — rule ID
{{vars.myVar}}             — workflow variable (set by ai_prompt)
{{action.0.result}}        — first action's result

Multi-Action Sequences

Rules can have multiple actions that execute in order. Each action's output is available to subsequent actions via {{action.N.result}}. Actions can be reordered, edited, or removed from the rule editor. If an action fails, subsequent actions are skipped unless continueOnError is set.

Sub-Workflows

The call_workflow action lets one rule invoke another rule by ID or name. Sub-workflows inherit the parent's event context and can receive additional parameters. Maximum call depth is 20 to prevent infinite loops. Each rule also has a daily execution limit and optional execution timeout.

State Machine Mode

Rules can define states with enter/exit actions and transitions. When an event matches a transition's condition, the state machine advances, executing the exit action of the current state and the enter action of the target state. The rule's current state is persisted across sessions.

"stateMachine": {
  "initialState": "monitoring",
  "states": [
    { "name": "monitoring", "enter": [], "exit": [],
      "transitions": [{ "target": "alerting", "condition": { "field": "count", "op": ">", "value": "10" } }] },
    { "name": "alerting", "enter": [{ "id": "popup", "params": { "message": "Threshold exceeded!" } }],
      "transitions": [{ "target": "monitoring", "condition": { "field": "count", "op": "<", "value": "5" } }] }
  ]
}

Scheduling

Two schedule trigger types:

Schedule — simple interval shorthand: 30s, 5m, 1h, 1d, 7d.
Cron — full 5-field cron (*/5 * * * *) or shortcut (@hourly, @daily, @weekly, @every 10m).

Data Threshold Monitoring

The data_threshold trigger polls aggregate metrics every 30 seconds and fires when a value crosses the configured threshold (only on transition, not continuously). Available metrics: totalHumans, totalObjects, highRiskCount, avgCredit, caseCount, threatCount.

Versioning & Rollback

Every rule save creates a version entry (up to 20 per rule). The rule editor's "Versions" button shows the version history — click any version to rollback to that state. Version snapshots are stored in localStorage under pazator_workflow_versions.

Dry-Run Mode

Toggle dry-run from the view toolbar or sidebar. When active, all actions log their intended execution but do not fire. Use the Test button in the rule editor for a single-rule dry-run with a custom mock payload — results show which conditions matched and which actions would execute.

Execution Log & Analytics

The workflow tab has three views accessible from the toolbar:

Rules — Rule list with toggle, category filter, search, and per-rule stats (fire count, last result).
Log — Execution history showing rule name, status (success/error/ skipped/timeout), details, and timestamp. Supports batch loading for large logs. Cleared via the trash button.
Analytics — Dashboard with stat cards (total rules, fires, success/error rates), trigger distribution bar chart, and 14-day daily activity chart.

Quick Palette

Press Ctrl+Shift+K anywhere to open the Quick Palette. Search through existing rules, built-in templates, trigger types, and action types. Click a result to edit the rule or create a new one from a template.

Built-In Templates

9 pre-built workflow templates available from the Quick Palette or via the New Rule form:

Notify on High ThreatPopup + notification when threat detected
Auto-Case on ThreatCreate case on threat detection
Entity Create AlertToast on new entity
AI Summary on AddAI summarizes data additions
Daily Backup ReminderToast daily at configured interval
Risk Threshold AlertPopup when avg credit drops below 100
Webhook on ChangePOST webhook on any data change
Tab Change LoggerExport report on tab switch
Weekly CleanupCron-based weekly maintenance

Import / Export

Export all rules as JSON via the toolbar export button or sidebar button. Import rules by pasting JSON — choose between skip (preserve existing) or overwrite for duplicates. Imported rules are created disabled by default.

Plugin Integration

Plugins can register custom triggers via window.__workflowRegisterTrigger({id, label, icon, desc, params}) and custom actions via window.__workflowRegisterAction({id, label, icon, desc, params}). The workflow engine also emits Tastur events: workflow_ready, workflow_fired, workflow_failed — consumable by other components or plugins.

Examples

// Simple: notify on tab switch
WHEN tab_switch IF to=="threats" THEN popup "Security Check"

// Multi-action: create entity + tag it
WHEN entity_crud IF crudAction=="created" THEN
  (1) add_tag entityId="{{event.entityId}}" tag="auto-tagged"
  (2) notify "Entity {{event.name}} tagged"

// Smart data mutation
WHEN threat_detected IF count > 0 THEN
  (1) create_case title="Threat Batch {{event.count}}" entities="{{event.entityId}}"
  (2) webhook url="https://hooks.example.com/alerts" method="POST"

// Cron + AI + Karline
WHEN cron IF expression="0 8 * * *" THEN
  (1) ai_prompt prompt="Summarize current threat landscape" outputVar="summary"
  (2) karline title="Daily Threat Brief" type="dynamic" goal="{{vars.summary}}"

// Compound condition
WHEN data_changed IF (store=="humans" AND action!="deleted") THEN notify "Human data changed"

Usage

Open the Workflow tab from the top menu bar (Tools → Workflow). Click New Rule to open the rule editor. Select a trigger, optionally set a condition (simple or compound), add one or more actions, and fill their parameters (variables chips and autocomplete help fill dynamic values). Save the rule — it activates immediately if enabled. Use the toggle on each rule card to enable/disable. The sidebar shows live stats, quick actions, and a reference card.


Source

app/js/apps/workflow.js — IIFE module, 1785+ lines. Subscribes to Tastur events and pazatorStore events at init. Exposes window.pazatorWorkflow with full CRUD, execution engine, condition evaluator, template resolver, import/export, and UI renderers. Lazy-loaded by js/ui/tabs.js on first tab visit.