Überblick
Passinstance stellt im Dashboard (/workflows, /automations und /settings/workspace/integrations) zwei sich ergänzende Automatisierungs-Engines bereit:
-
1
Workflow Engine (
Workflow Engine APIunter/api/v1/workflows): Ereignisgesteuerte DAG-Zustandsautomaten auf Basis von workflow trigger type (29 Auslösertypen), workflow action type (25 Aktionstypen),IF_CONDITIONundDELAY. -
2
Universal Automations (
Automations APIunter/api/v1/automations): Regelbasierte E-Commerce- und PassFlow-Automatisierungen mit Unterstützung fürExistingCardPolicy(REUSE_AND_UPDATE,ISSUE_ADDITIONAL,REPLACE,NO_OPusw.) undConflictResolutionPolicy(ALLOW_ALL,RUN_ALL,HIGHEST_PRIORITY,BEST_OFFER,FIRST_MATCH,EXCLUSIVE,EXCLUSIVE_BY_SCOPE).
Voraussetzungen: Das Erstellen oder Bearbeiten von Workflows über
POST /api/v1/workflowserfordert Berechtigungen zum Bearbeiten von Vorlagen (templates:manage) sowie mindestens eine veröffentlichte Pass-Vorlage. Neu erstellte Workflows starten im StatusDRAFToderINACTIVE, bis sie überPOST /api/v1/workflows/:workflowId/activateaktiviert werden.
Pipeline zur Workflow-Ausführung
Workflows über REST verwalten (Workflow Engine API)
| Methode | Endpunkt | Beschreibung |
|---|---|---|
| GET | /api/v1/workflows | Listet Arbeitsbereich-Workflows auf (filterbar nach status in workflow status: DRAFT, ACTIVE, PAUSED, INACTIVE, ARCHIVED, ERROR). |
| POST | /api/v1/workflows | Erstellt einen neuen Workflow mit request payload (name, trigger, actions, conditions, tags). |
| GET | /api/v1/workflows/:workflowId | Ruft Workflow-Definition, Ausführungsverlauf (/:workflowId/executions) und Protokolle (/:workflowId/logs) ab. |
| PUT | /api/v1/workflows/:workflowId | Aktualisiert Workflow-Auslöser, Bedingungen, Aktionen oder status (request payload). |
| POST | /api/v1/workflows/:workflowId/activate | Aktiviert einen Workflow sofort (deactivate pausiert die Ausführung; trigger startet ihn manuell). |
| DELETE | /api/v1/workflows/:workflowId | Löscht einen Workflow und bricht ausstehende verzögerte Jobs ab. |
Unterstützte Auslöser (workflow trigger type)
Das Passinstance database-Enum workflow trigger type definiert alle 29 kanonischen Workflow-Auslösertypen:
| Auslöser-Kategorie | workflow trigger type-Werte | Wann er ausgelöst wird |
|---|---|---|
| Pass- & Vorlagen-Lebenszyklus | PASS_CREATED, PASS_UPDATED, PASS_SCANNED, PASS_VOIDED, PASS_DELETED, PASS_DOWNLOADED, TEMPLATE_CREATED, TEMPLATE_UPDATED | Sofort, wenn ein Pass oder eine Vorlage erstellt, geändert, gescannt, entwertet, gelöscht oder heruntergeladen wird. |
| Wallet, Mechaniken & Opt-in | PASS_INSTALLED, PASS_REMOVED, USER_OPT_IN, USER_OPT_OUT, POINTS_UPDATED, TIER_CHANGED, BALANCE_CHANGED, EVENT_EXPIRED, PASS_INACTIVE, SCAN_PERFORMED | Wenn sich die Apple-/Google-Wallet-Geräteregistrierung ändert, Marketing-Einwilligungen wechseln oder Punkte-/Stufen-/Guthabenschwellen überschritten werden. |
| Benutzer, Abrechnung & Zeitplan | USER_REGISTERED, USER_LOGIN, USER_PROFILE_UPDATED, SUBSCRIPTION_CHANGED, PAYMENT_RECEIVED, PAYMENT_FAILED, WEBHOOK_RECEIVED, API_CALL, SCHEDULED, MANUAL, CUSTOM_API_EVENT | Bei Benutzer-/Zahlungsereignissen, eingehenden Webhooks (POST /api/v1/workflows/webhook/:customerId/:workflowId), Cron-Zeitplänen (normalisiert auf die Arbeitsbereich-Zeitzone) oder manuellen bzw. API-Aufrufen. |
Beispiel: Folge-Workflow nach Stufenaufstieg erstellen (POST /api/v1/workflows)
request payload akzeptiert ein Top-Level-trigger-Objekt und ein geordnetes actions-Array (IWorkflowActionConfig[]) sowie optionale Felder für conditions, dataMapping, maxRetries (Standard 3) und timeout (Standard 300 Sekunden):
{
"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"]
}
Entdecken Sie alle Aktionstypen unter Automatisierte Pass-Operationen sowie die visuelle Orchestrierung unter /workflow-engine.
