---
updatedAt: 2026-02-10T11:28:23.000Z
---

# Query workflow session status

Retrieves the current status and output variables of a workflow session.

## Use Cases

- Check if workflow is still running or has completed
- Retrieve output variables set during workflow execution
- Monitor workflow progress

## Response Details

- `isRunning`: Boolean indicating if workflow is still executing
- `status`: Current status (RUNNING or COMPLETED)
- `currentModule`: ID of current module being executed (null if completed)
- `outputVariables`: All variables set during workflow execution

## Security Considerations

- Validate session ID belongs to the requesting client
- Filter sensitive data from outputVariables before exposing to end users
- Implement proper access controls

# OpenAPI definition

````json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Workflow Execution API",
    "version": "1.0.0",
    "description": "## Overview\n\nExecute Infinity workflows programmatically to automate business processes, trigger notifications, route interactions, and integrate with external systems.\n\n## Base URL Structure\n\n```\nhttps://core.{customer-subdomain}.ec.avayacloud.com\n```\n\n**Finding Your Subdomain:**  \nYour subdomain can be found in your Infinity admin or agent portal URL. For example, if your portal URL is:\n\n```\nhttps://core.avaya1234.ec.avayacloud.com/app/core-config-ui/\n```\n\nYour subdomain is: `avaya1234`\n\n## Authentication\n\nAll API requests require a JWT Bearer token. To obtain a token:\n\n**Token Endpoint:**\n```\nPOST https://core.{customer-subdomain}.ec.avayacloud.com/auth/realms/avaya/protocol/openid-connect/token\n```\n\n**Headers:**\n```\nContent-Type: application/x-www-form-urlencoded\n```\n\n**Body (form-urlencoded):**\n```\ngrant_type=client_credentials\nclient_id={your-client-id}\nclient_secret={your-client-secret}\n```\n\n**Response:**\n```json\n{\n  \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"expires_in\": 900,\n  \"token_type\": \"Bearer\"\n}\n```\n\n**Token Lifetime:**\n- Tokens typically expire in 900 seconds (15 minutes)\n- Request a new token when expired\n- Use the `access_token` value in the `Authorization: Bearer {token}` header\n\n## Security Guidelines\n\n⚠️ **CRITICAL SECURITY REQUIREMENTS:**\n\n**1. Token Management:**\n- **NEVER expose service JWT tokens to end users or client applications**\n- Service tokens must remain secure on your backend server only\n- Tokens should never be included in client-side code, logs, or error messages\n\n**2. ID and Resource Protection:**\n- **Do not expose internal Avaya service IDs to end users**\n- This includes: workflow session IDs, engagement IDs, interaction IDs\n- Use your own mapping/proxy IDs in client-facing APIs\n- Implement proper access controls and session validation\n\n**3. Sensitive Data Protection:**\n- **Review all output variables before exposing to clients**\n- Workflow output variables may contain sensitive information\n- Implement data filtering/sanitization before returning data to clients\n\n**4. Input Validation:**\n- Validate and sanitize all input parameters before making API calls\n- Implement proper error handling to avoid exposing internal system details\n",
    "contact": {
      "name": "Avaya API Team",
      "url": "https://developers.avayacloud.com/onecloud-ccaas",
      "email": "apiteam@avaya.com"
    },
    "license": {
      "name": "Avaya Software Development Kit (SDK) Software License Terms",
      "url": "http://support.avaya.com/css/P8/documents/101038288"
    }
  },
  "servers": [
    {
      "url": "https://core.{customer-subdomain}.ec.avayacloud.com",
      "description": "Avaya Infinity Platform",
      "variables": {
        "customer-subdomain": {
          "default": "avaya1234",
          "description": "Your Infinity instance subdomain (e.g., avaya1234, acme-corp-prod)"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT Bearer token authentication. Obtain your token from the authentication endpoint:\n```\nPOST https://core.{customer-subdomain}.ec.avayacloud.com/auth/realms/avaya/protocol/openid-connect/token\n```\n"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A brief description of the error",
            "example": "workflowId is required"
          },
          "message": {
            "type": "string",
            "description": "Detailed error message",
            "example": "No published version found for the specified workflow"
          }
        },
        "required": [
          "error"
        ]
      },
      "WorkflowSessionStatus": {
        "type": "object",
        "properties": {
          "workflowSessionId": {
            "type": "string",
            "description": "The workflow session identifier",
            "example": "028d01111220a063d64b039dad"
          },
          "isRunning": {
            "type": "boolean",
            "description": "Whether the workflow session is currently running",
            "example": true
          },
          "status": {
            "type": "string",
            "enum": [
              "RUNNING",
              "COMPLETED"
            ],
            "description": "Current status of the workflow session",
            "example": "RUNNING"
          },
          "currentModule": {
            "type": "string",
            "nullable": true,
            "description": "ID of the current workflow module being executed (null if completed)",
            "example": "mod_sayCollect_001"
          },
          "outputVariables": {
            "type": "object",
            "additionalProperties": true,
            "description": "Variables set during workflow execution",
            "example": {
              "customer_name": "John Smith",
              "order_id": "TEST-1984-001"
            }
          }
        },
        "required": [
          "workflowSessionId",
          "isRunning",
          "status",
          "currentModule",
          "outputVariables"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/api/workflow/v1/workflows/sessions/{sessionId}": {
      "get": {
        "summary": "Query workflow session status",
        "description": "Retrieves the current status and output variables of a workflow session.\n\n## Use Cases\n\n- Check if workflow is still running or has completed\n- Retrieve output variables set during workflow execution\n- Monitor workflow progress\n\n## Response Details\n\n- `isRunning`: Boolean indicating if workflow is still executing\n- `status`: Current status (RUNNING or COMPLETED)\n- `currentModule`: ID of current module being executed (null if completed)\n- `outputVariables`: All variables set during workflow execution\n\n## Security Considerations\n\n- Validate session ID belongs to the requesting client\n- Filter sensitive data from outputVariables before exposing to end users\n- Implement proper access controls\n",
        "operationId": "getWorkflowSessionStatus",
        "tags": [
          "Workflow Sessions"
        ],
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "Unique identifier of the workflow session",
            "schema": {
              "type": "string",
              "example": "028d01111220a063d64b039dad"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved workflow session status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSessionStatus"
                },
                "examples": {
                  "running": {
                    "summary": "Running workflow session",
                    "value": {
                      "workflowSessionId": "028d01111220a063d64b039dad",
                      "isRunning": true,
                      "status": "RUNNING",
                      "currentModule": "mod_sayCollect_001",
                      "outputVariables": {
                        "customer_name": "John Smith",
                        "currentStep": "gathering_info"
                      }
                    }
                  },
                  "completed": {
                    "summary": "Completed workflow session",
                    "value": {
                      "workflowSessionId": "028d01111220a063d64b039dad",
                      "isRunning": false,
                      "status": "COMPLETED",
                      "currentModule": null,
                      "outputVariables": {
                        "customer_name": "John Smith",
                        "order_id": "TEST-1984-001",
                        "resolution": "Order processed successfully"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid session ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_format": {
                    "summary": "Invalid session ID format",
                    "value": {
                      "error": "Invalid session ID format",
                      "message": "Session ID must be a valid workflow session identifier"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Authentication required",
                    "value": {
                      "error": "Unauthorized",
                      "message": "Valid authentication credentials required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "forbidden": {
                    "summary": "Insufficient permissions",
                    "value": {
                      "error": "Forbidden",
                      "message": "Insufficient permissions to access this workflow session"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Workflow session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Session not found",
                    "value": {
                      "error": "Workflow session not found",
                      "message": "No workflow session found with the specified ID"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Server processing error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "internal_error": {
                    "summary": "Internal server error",
                    "value": {
                      "error": "Failed to get workflow status",
                      "message": "An unexpected error occurred while retrieving session status"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
````