Overview
Passinstance provides two complementary automation engines inside the Dashboard (/workflows, /automations, and /settings/workspace/integrations):
-
1
Workflow Engine (
Workflow Engine APIat/api/v1/workflows): Event-driven DAG state machines backed by workflow trigger type (29 trigger types), workflow action type (25 action types),IF_CONDITION, andDELAY. -
2
Universal Automations (
Automations APIat/api/v1/automations): Policy-driven e-commerce and PassFlow rules supportingExistingCardPolicy(REUSE_AND_UPDATE,ISSUE_ADDITIONAL,REPLACE,NO_OP, etc.) andConflictResolutionPolicy(ALLOW_ALL,RUN_ALL,HIGHEST_PRIORITY,BEST_OFFER,FIRST_MATCH,EXCLUSIVE,EXCLUSIVE_BY_SCOPE).
Prerequisites: Creating or modifying workflows via
POST /api/v1/workflowsrequires edit-template permissions (templates:manage) and at least one published Pass Template. Newly created workflows start inDRAFTorINACTIVEuntil activated viaPOST /api/v1/workflows/:workflowId/activate.
Workflow Execution Pipeline
Managing Workflows via REST (Workflow Engine API)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/workflows | Lists workspace workflows (filterable by status in workflow status: DRAFT, ACTIVE, PAUSED, INACTIVE, ARCHIVED, ERROR). |
| POST | /api/v1/workflows | Creates a new workflow using request payload (name, trigger, actions, conditions, tags). |
| GET | /api/v1/workflows/:workflowId | Retrieves workflow definition, execution history (/:workflowId/executions), and logs (/:workflowId/logs). |
| PUT | /api/v1/workflows/:workflowId | Updates workflow triggers, conditions, actions, or status (request payload). |
| POST | /api/v1/workflows/:workflowId/activate | Activates a workflow immediately (deactivate pauses execution; trigger runs manually). |
| DELETE | /api/v1/workflows/:workflowId | Deletes a workflow and cancels pending delayed jobs. |
Supported Triggers (workflow trigger type)
The workflow trigger type supported enum defines all 29 canonical workflow trigger types:
| Trigger Category | workflow trigger type Values | When It Fires |
|---|---|---|
| Pass & Template Lifecycle | PASS_CREATED, PASS_UPDATED, PASS_SCANNED, PASS_VOIDED, PASS_DELETED, PASS_DOWNLOADED, TEMPLATE_CREATED, TEMPLATE_UPDATED | Immediately when a pass or template is created, modified, scanned, voided, deleted, or downloaded. |
| Wallet, Mechanics & Opt-In | PASS_INSTALLED, PASS_REMOVED, USER_OPT_IN, USER_OPT_OUT, POINTS_UPDATED, TIER_CHANGED, BALANCE_CHANGED, EVENT_EXPIRED, PASS_INACTIVE, SCAN_PERFORMED | When Apple/Google Wallet device registration changes, marketing consent toggles, or points/tier/balance thresholds cross. |
| User, Billing & Schedule | USER_REGISTERED, USER_LOGIN, USER_PROFILE_UPDATED, SUBSCRIPTION_CHANGED, PAYMENT_RECEIVED, PAYMENT_FAILED, WEBHOOK_RECEIVED, API_CALL, SCHEDULED, MANUAL, CUSTOM_API_EVENT | On user/payment events, inbound webhook receipts (POST /api/v1/workflows/webhook/:customerId/:workflowId), cron schedules (normalized to workspace timezone), or manual/API runs. |
Example: Creating a Tier Upgrade Follow-Up Workflow (POST /api/v1/workflows)
request payload accepts a top-level trigger object and an ordered actions array (IWorkflowActionConfig[]), alongside optional conditions, dataMapping, maxRetries (default 3), and timeout (default 300 seconds):
{
"name": "Gold Tier Upgrade Celebration & Companion Voucher",
"description": "Sends congratulatory push and waits 1 hour before issuing bonus drink voucher",
"trigger": {
"type": "TIER_CHANGED",
"filters": {
"templateId": "tmpl_loyalty_01"
}
},
"conditions": {
"field": "pass.tier",
"operator": "EQUALS",
"value": "GOLD"
},
"actions": [
{
"type": "SEND_PUSH_NOTIFICATION",
"name": "Gold Upgrade Alert",
"config": {
"message": "Welcome to Gold Tier! Enjoy 2x points on every visit."
}
},
{
"type": "DELAY",
"name": "Wait 60 Minutes",
"config": {
"durationMinutes": 60
}
},
{
"type": "GENERATE_ADDITIONAL_PASS",
"name": "Issue Companion Voucher",
"config": {
"targetTemplateId": "tmpl_gold_welcome_drink",
"linkToParentPass": true
}
}
],
"tags": ["loyalty", "gold-tier"]
}
Explore all action types in Automated Pass Operations and visual orchestration at /workflow-engine.
