Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xenia.team/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Checklist Workflows enable complex automation logic that evaluates multiple conditions across different checklist items. Unlike Automations which trigger immediately on a single item, workflows execute when a submission is completed and all conditions are evaluated together. Key Characteristics:
  • Multi-condition logic: Combine conditions with AND/OR operators
  • Submission-level scope: Evaluate across multiple items
  • Deferred execution: Trigger on submission completion
  • Complex actions: Create tasks, work orders, and multi-channel alerts

Workflow vs Automation

FeatureAutomationsWorkflows
Trigger timingImmediate on answerOn submission complete
Condition scopeSingle itemMultiple items
Logic operatorsSingle conditionAND/OR combinations
Best forReal-time alerts, follow-upsComplex decision logic

Workflow Actions

ActionDescription
CREATE_TASK_FROM_TEMPLATEAuto-create a task from a predefined template
CREATE_WORK_ORDER_FROM_TEMPLATEAuto-create a work order from template
SEND_ALERTSend notifications via email, SMS, push, or WhatsApp

Create a Workflow

Create a workflow with multiple conditions.
curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Critical Safety Alert",
    "description": "Alert when multiple safety items fail",
    "ChecklistId": "safety-template-uuid",
    "operator": "AND",
    "isActive": true,
    "conditions": [
      {
        "id": "condition-1-uuid",
        "ChecklistItemId": "fire-extinguisher-item-uuid",
        "conditions": {
          "logic": "eq",
          "value": "no"
        }
      },
      {
        "id": "condition-2-uuid",
        "ChecklistItemId": "emergency-exit-item-uuid",
        "conditions": {
          "logic": "eq",
          "value": "no"
        }
      }
    ],
    "actions": [
      {
        "type": "CREATE_TASK_FROM_TEMPLATE",
        "id": "action-1-uuid",
        "data": {
          "taskTemplateId": "safety-corrective-action-uuid",
          "when": "onSubmit"
        }
      },
      {
        "type": "SEND_ALERT",
        "id": "action-2-uuid",
        "data": {
          "email": {
            "when": "onSubmit",
            "enabled": true,
            "recipients": ["safety@example.com"]
          },
          "push": {
            "when": "onSubmit",
            "enabled": true,
            "recipients": ["safety-manager-uuid"]
          }
        }
      }
    ],
    "notification": {
      "roles": ["safety-manager-role-uuid"],
      "teams": [],
      "users": [],
      "emails": ["compliance@example.com"],
      "enable": true,
      "showSubmissionInEmail": true
    }
  }'
Request Body:
FieldTypeRequiredDescription
namestringYesWorkflow name
descriptionstringNoWorkflow description
ChecklistIdstringYesTemplate this workflow applies to
operatorstringNoAND (all conditions) or OR (any condition). Default: AND
isActivebooleanNoEnable/disable workflow. Default: true
conditionsarrayYesArray of conditions (min 1)
actionsarrayYesArray of actions (min 1)
notificationobjectNoAdditional notification settings
Condition Object:
FieldTypeRequiredDescription
idstringYesUnique condition identifier
ChecklistItemIdstringYesItem to evaluate
conditions.logicstringYesOperator: eq, not, lt, lte, gt, gte, btw, nbtw, contains, not_contains, is_empty, is_not_empty
conditions.valueanyYesValue to compare against
conditions.contextstringNoFilter by Locations or LocationGroups
Response:
{
  "status": "success",
  "code": 200,
  "data": {
    "id": "workflow-uuid",
    "name": "Critical Safety Alert",
    "description": "Alert when multiple safety items fail",
    "ChecklistId": "safety-template-uuid",
    "operator": "AND",
    "isActive": true,
    "conditions": [...],
    "actions": [...],
    "notification": {...},
    "createdAt": "2024-12-20T10:00:00Z"
  }
}

Logic Operators

AND Operator

All conditions must match for the workflow to trigger.
{
  "operator": "AND",
  "conditions": [
    {
      "ChecklistItemId": "item-1-uuid",
      "conditions": { "logic": "eq", "value": "fail" }
    },
    {
      "ChecklistItemId": "item-2-uuid",
      "conditions": { "logic": "lt", "value": 70 }
    }
  ]
}
Triggers when: Item 1 = “fail” AND Item 2 < 70

OR Operator

Any condition matching triggers the workflow.
{
  "operator": "OR",
  "conditions": [
    {
      "ChecklistItemId": "critical-item-1-uuid",
      "conditions": { "logic": "eq", "value": "no" }
    },
    {
      "ChecklistItemId": "critical-item-2-uuid",
      "conditions": { "logic": "eq", "value": "no" }
    }
  ]
}
Triggers when: Item 1 = “no” OR Item 2 = “no”

Action Configuration

Create Task from Template

{
  "type": "CREATE_TASK_FROM_TEMPLATE",
  "id": "action-uuid",
  "data": {
    "taskTemplateId": "task-template-uuid",
    "when": "onSubmit"
  }
}

Create Work Order from Template

{
  "type": "CREATE_WORK_ORDER_FROM_TEMPLATE",
  "id": "action-uuid",
  "data": {
    "taskTemplateId": "work-order-template-uuid",
    "when": "onSubmit"
  }
}

Send Alert

{
  "type": "SEND_ALERT",
  "id": "action-uuid",
  "data": {
    "email": {
      "when": "onSubmit",
      "enabled": true,
      "recipients": ["manager@example.com"]
    },
    "sms": {
      "when": "onSubmit",
      "enabled": true,
      "recipients": ["+1234567890"]
    },
    "push": {
      "when": "onSubmit",
      "enabled": true,
      "recipients": ["user-uuid"]
    },
    "whatsapp": {
      "when": "onSubmit",
      "enabled": false,
      "recipients": []
    }
  }
}

List Workflows

Get All Workflows

curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Get Workflows for a Checklist

curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/checklists/{checklistId}/workflows" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Get Items with Workflows

Find which checklist items have workflow conditions attached.
curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/checklists/{checklistId}/items-with-workflow" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Get Single Workflow

curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows/{workflowId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Update Workflow

curl -X PUT "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows/{workflowId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Workflow Name",
    "isActive": false,
    "operator": "OR"
  }'

Bulk Create/Update Workflows

Create or update multiple workflows in a single request.
curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows/bulk" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "workflows": [
      {
        "name": "Workflow 1",
        "ChecklistId": "template-uuid",
        "operator": "AND",
        "conditions": [...],
        "actions": [...]
      },
      {
        "id": "existing-workflow-uuid",
        "name": "Updated Workflow 2",
        "isActive": true
      }
    ]
  }'
Include id to update an existing workflow. Omit id to create a new one.

Delete Workflows

curl -X DELETE "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowIds": ["workflow-uuid-1", "workflow-uuid-2"]
  }'

Conditional Visibility (Item Settings)

Control which checklist items are visible based on answers to other items.

Get Item Settings

curl -X GET "https://api.xenia.team/api/v1/mgt/checklists/{checklistId}/checklist-item-settings" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Query Parameters:
ParameterTypeDescription
itemIdstringFilter by specific item
contextsarrayFilter by context

Create Item Settings

Show or hide items based on conditions.
curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/checklists/{checklistId}/checklist-item-settings" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "contextId": "trigger-item-uuid",
    "context": "checklistItem",
    "action": "show",
    "condition": {
      "logic": "eq",
      "value": "yes"
    },
    "itemIds": ["target-item-1-uuid", "target-item-2-uuid"]
  }'
Request Body:
FieldTypeRequiredDescription
contextIdstringYesItem that triggers the condition
contextstringYesContext type (e.g., checklistItem)
actionstringYesshow or hide
conditionobjectYesCondition logic
itemIdstringNoSingle target item
itemIdsarrayNoMultiple target items
Example Use Case: Show follow-up questions only when “Other” is selected.
{
  "contextId": "primary-question-uuid",
  "context": "checklistItem",
  "action": "show",
  "condition": {
    "logic": "eq",
    "value": "other"
  },
  "itemIds": ["other-details-uuid", "additional-notes-uuid"]
}

Update Item Settings

curl -X PUT "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/checklists/{checklistId}/checklist-item-settings/{settingsId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "hide",
    "condition": {
      "logic": "eq",
      "value": "n/a"
    }
  }'

Delete Item Settings

curl -X DELETE "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/checklists/{checklistId}/checklist-item-settings/{settingsId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Common Workflows

Multi-Failure Alert

Alert when multiple critical items fail in the same inspection.

Location-Based Routing

Route alerts to different teams based on location.
curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/workflows" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "North Region Safety Alert",
    "ChecklistId": "template-uuid",
    "operator": "AND",
    "conditions": [
      {
        "id": "condition-1",
        "ChecklistItemId": "safety-item-uuid",
        "conditions": {
          "logic": "eq",
          "value": "fail",
          "context": "LocationGroups"
        }
      }
    ],
    "actions": [
      {
        "type": "SEND_ALERT",
        "id": "action-1",
        "data": {
          "email": {
            "enabled": true,
            "recipients": ["north-safety@example.com"]
          }
        }
      }
    ]
  }'

Score Threshold Workflow

Trigger actions when overall score falls below threshold.
{
  "name": "Low Score Alert",
  "ChecklistId": "template-uuid",
  "operator": "OR",
  "conditions": [
    {
      "ChecklistItemId": "section-1-score-uuid",
      "conditions": { "logic": "lt", "value": 70 }
    },
    {
      "ChecklistItemId": "section-2-score-uuid",
      "conditions": { "logic": "lt", "value": 70 }
    }
  ],
  "actions": [
    {
      "type": "CREATE_TASK_FROM_TEMPLATE",
      "data": { "taskTemplateId": "improvement-plan-template-uuid" }
    }
  ]
}

Best Practices

When all conditions must be met before taking action, use AND. This prevents false positives from single-item failures.
When any single condition should trigger action, use OR. Good for critical items where any failure is important.
Use Automations for immediate item-level responses (flags, notifications). Use Workflows for submission-level analysis and task creation.
Create test submissions to verify workflow logic triggers correctly. Complex AND/OR combinations can behave unexpectedly.
Workflows with too many conditions become hard to maintain. Consider splitting into multiple focused workflows.
Too many show/hide rules can confuse inspectors. Keep forms as simple as possible while gathering necessary data.

Permissions

ActionRequired Permission
View workflowsCAN_MANAGE_CHECKLIST or CHECKLIST_SUPER_ADMIN
Create/Update workflowsCAN_MANAGE_CHECKLIST or CHECKLIST_SUPER_ADMIN + Active subscription
Delete workflowsCAN_MANAGE_CHECKLIST or CHECKLIST_SUPER_ADMIN