Velaris workflows are directed graphs of stages — each stage holds steps, and stages connect via transitions with guard conditions, triggers, and side effects that enable sequential, parallel, decision, loopback, and terminal flows.
Every stage in a case type has a stage_type attribute that determines how its steps execute and how the stage transitions to the next stage in the workflow.
| Stage Type | Description | Step Execution | Typical Use Case |
|---|---|---|---|
sequential |
The default stage type. Steps execute one at a time in defined order. The next step activates only after the previous one is completed. Stage is complete when all steps are done. | One active step at a time, in order | Data intake, document review, identity verification, any multi-step human workflow |
parallel |
All steps in the stage become active simultaneously. The stage is complete only when all active steps are completed. Enables concurrent human or automated tasks without blocking each other. | All steps active concurrently | Running identity check, credit check, and document extraction simultaneously; multi-team parallel review |
decision |
A routing stage with no steps of its own. When a case reaches a decision stage, all outbound transitions are evaluated immediately. The first transition whose guard condition evaluates to true is taken. Transitions are evaluated in priority order. |
No steps (pure routing) | Approve/reject branching after manager review; routing by case type, amount, jurisdiction, or calculated risk score |
loopback |
A stage that, on completion, can transition back to a previous stage instead of forward. Used for "return for more information" patterns. The target stage of the loopback is configured in the transition's to_stage_id. |
Sequential steps, then backward transition | Returning an application for additional documents; re-review after new information is submitted |
terminal |
The final stage. When a case reaches a terminal stage and all its steps complete, the case status changes to resolved automatically. A case type can have multiple terminal stages (e.g., Approved and Rejected are both terminal). |
Sequential steps, then auto-resolve | Disbursement, rejection notification, archive, closure confirmation |
The step_type defines runtime behavior. Connector-backed step types require a matching connector to be configured and active in the Connector Library.
| Step Type | Connector | Human Action? | Description | Output Written to Case Data |
|---|---|---|---|---|
standard |
None | Yes | Presents a configured form to the assigned agent. Agent fills and submits. Data merged into case JSONB. The most common step type. | All submitted form field values |
payment_request |
Stripe | Customer-facing | Creates a Stripe Checkout session. The customer receives a payment link. Step completes when Stripe fires the checkout.session.completed webhook. |
stripe_session_id, payment_status, amount_paid, currency |
payment_disbursement |
Stripe | No (automated) | Initiates a Stripe Transfer or Payout to the recipient account stored in case data. Records the transfer ID and status. | stripe_transfer_id, disbursement_status, disbursed_at |
identity_verify |
Onfido | No (automated) | Submits an Onfido applicant check using PII from case data. Polls for result (or uses webhook). Records check outcome. | onfido_check_id, identity_check_result (clear/consider/unidentified), identity_check_reason |
esign_send |
DocuSign | Signatory-facing | Creates a DocuSign envelope from a template, populates tabs with case data, sends to signer. Step completes when envelope-completed webhook fires. |
docusign_envelope_id, signing_url, esign_status, signed_at |
crm_sync |
Salesforce | No (automated) | Creates or updates a Salesforce Contact and Case record using OAuth2 Connected App. Maps Velaris case fields to SF object fields via the connector's field mapping config. | sf_contact_id, sf_case_id, crm_sync_status |
invoice_generate |
Xero | No (automated) | Creates a draft invoice in Xero with line items constructed from case data. Approves and sends if configured to do so automatically. | xero_invoice_id, invoice_number, invoice_status |
sms_send |
Twilio | No (automated) | Sends an SMS to a phone number from case data. Message body is a Jinja2 template evaluated against case data. Records delivery status via Twilio status callback. | twilio_message_sid, sms_status |
slack_notify |
Slack | No (automated) | Posts a message to a configured Slack channel using Incoming Webhooks. Message is a Jinja2 template. Supports Block Kit JSON for rich formatting. | slack_message_ts (timestamp), slack_channel |
doc_extract |
Docling / S3 | No (automated) | Downloads a document from S3 (URL from case data), runs Docling OCR extraction, stores structured key-value results back into case data. | extracted_fields (object with OCR results), doc_extract_status |
doc_store |
S3 | No (automated) | Uploads a document attached to the case (or generated by a previous step) to S3. Generates a presigned URL valid for 7 days and stores it in case data. | s3_object_key, s3_presigned_url, doc_store_status |
custom_http |
Custom HTTP Connector | Optional | Makes an outbound HTTP request to any REST API. Method, URL, headers, and body are Jinja2 templates evaluated against case data. Response fields are mapped to case data via JSONPath response mapping. | Configurable via response mapping in the connector definition |
Transitions connect stages. Each transition record in the stage_transitions table has the following configurable properties:
| Field | Type | Description | Example |
|---|---|---|---|
from_stage_id |
UUID | The stage this transition departs from | — |
to_stage_id |
UUID | The stage this transition leads to | — |
guard_condition |
string (JS expression) | Boolean expression evaluated against case.data. If false, transition is skipped. If null, transition is unconditional. |
data.credit_score >= 650 |
trigger_type |
enum | auto: fires immediately when all steps complete and guard passes. manual: requires agent/manager to explicitly click "Advance Stage". |
auto |
priority |
integer | Evaluation order for decision stages. Lower number = evaluated first. First passing guard wins. | 1 |
side_effects |
array | List of actions to execute when this transition fires. Options: send_notification, set_field, trigger_webhook. |
[{"type": "set_field", "key": "stage_approved", "value": true}] |
label |
string | Human-readable label shown on the stage graph in Studio | "Approve", "Reject", "Return for Info" |
The Case Type Editor in Studio provides a visual canvas for building the stage graph. Follow these steps to add a new stage and configure its transitions.
Navigate to Studio > Case Types. Click the case type you want to edit, then select the Stages tab. The stage graph canvas loads with existing stages shown as nodes.
Click + Add Stage in the top-right corner. Enter a name (e.g., Manager Review), select the Stage Type from the dropdown (sequential, parallel, decision, loopback, terminal), and click Create.
The new stage node appears on the canvas. Drag it to position it in the workflow. Click and drag from the edge of one stage node to another to create a transition arrow between them.
Click the transition arrow to open the Transition Editor. Set the Guard Condition (leave blank for unconditional), Trigger Type (auto or manual), Priority, and optional Side Effects.
Click the stage node to open the Stage Editor. Under the Steps tab, click + Add Step. Name the step, select the Step Type, assign a form (for standard steps), or select a connector (for connector-backed step types).
Repeat for each step in the stage. Drag steps in the list to reorder them (sequential stages only — order determines execution sequence).
Click Save & Publish to make the updated workflow live. Running cases on older versions are not automatically migrated — they continue on the version they were created on unless explicitly migrated via HxMigrate.
In a parallel stage, all steps become active simultaneously. Each step is independently assignable and completable. The stage does not complete — and the case does not advance — until every step in the stage is marked complete.
┌────────────────────────────────────────────────────┐
│ Stage: Parallel Verification [parallel] │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Step: Identity │ │ Step: Document │ │
│ │ [identity_verify│ │ [doc_extract] │ │
│ │ > Onfido] │ │ > S3/Docling] │ │
│ │ │ │ │ │
│ │ Status: ✓ Done │ │ Status: ⏳ Pending│ │
│ └──────────────────┘ └──────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Step: Credit Check [custom_http > Credit API] │ │
│ │ │ │
│ │ Status: ✓ Done │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ Stage complete when ALL 3 steps are done │
│ Currently: 2/3 complete — WAITING on Document │
└────────────────────────────────────────────────────┘
Guard conditions are evaluated as JavaScript boolean expressions against a context object containing the case's data JSONB, the current user's role, and several helper functions.
| Example Expression | What It Tests |
|---|---|
data.credit_score >= 650 |
A numeric field in case data meets a threshold |
data.loan_amount > 50000 && data.employment_status === "employed" |
Compound condition on two fields |
data.identity_check_result === "clear" |
An automated step result matches expected value |
data.id_type === "passport" || data.id_type === "national_id" |
Field matches one of several allowed values |
Number(data.invoice_total) > 0 |
Explicit type coercion for numeric comparison |
!!data.manager_approval_date |
Field is non-null / non-empty (has been set) |
true |
Unconditional — transition always fires (useful as the "else" case in decision stages) |
data context object. Keep expressions simple and deterministic — avoid date arithmetic without using the provided daysBetween() helper.
guard_condition: true) at the lowest priority as a fallback catch-all. Without a fallback, a decision stage with no passing guard will deadlock the case.