Workflow Sessions
Overview
The Workflow Sessions API provides a secure REST API for third-party systems to trigger Avaya Infinity workflows, pass input variables, and receive execution status and outputs. It enables external systems to initiate workflows by ID or version, pass dynamic input variables, and receive completion status and outputs.
Before You Begin
Refer to How to Authenticate with Avaya Infinity™ APIs required to invoke Workflow APIs.
Summary of Prerequisites and Limitations:
- You must have valid OAuth2 credentials (client ID and secret).
- Only authorized users can create or query private workflow sessions.
- Always follow documented security practices to protect sensitive data and session identifiers.
Start a new workflow session
Start new workflow sessions with configurable parameters. This allows you to initiate a new workflow session for a given workflow and version. This endpoint creates a new execution context for the specified workflow and begins processing
from the workflow's start module.
- Workflow ID - A workflow has a unique generated ID used across the entire solution. Set to the unique identifier of the workflow to execute.
- Version - A workflow can have multiple executable versions. Set to the version of the workflow to execute. If no version is specified will default to 'current'.
- Inputs - Variables can be passed to the workflow through inputs.
- Data - Data context can be provided for the workflow
POST {protocol}://{server}{basePath}/api/workflow/v1/workflows/sessions
curl -X POST \
https://dev.local/api/workflow/v1/workflows/sessions \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer " \
-d '{
"workflowId": "025d010819f98dbc75776be9666",
"version": "current",
"variables": {
"page": "payment_failed",
"amount": "$80,988.00",
"transaction_id": "TXN-2024-AV-891234567",
"error": "PAYMENT_DECLINED_INSUFFICIENT_FUNDS",
"user_id": "[email protected]",
"account": "ENTERPRISE-1234-9876"
}
}'
HTTP 201 Workflow session created successfully
{
schema:
$ref: '#/components/schemas/WorkflowSessionResponse'
examples:
success:
summary: Successful workflow session creation
value:
session:
id: "wfs_abc123def456"
engagementId: "eng_789xyz012"
workflowId: "025d010627e3314fa905c5484c"
workflowName: "Customer Support Flow"
}
Security Guidelines
- Never expose service JWT tokens or Avaya session IDs to client applications.
- Validate and sanitize all input parameters before making API calls.
- Use your own session/request IDs instead of exposing Avaya session IDs to clients.
Get workflow session status
Retrieves the current status and details of a workflow session, including its execution state, current module, and output variables.
- Workflow Session ID - A workflow has a unique generated ID used across the entire solution. Set to the unique identifier of the workflow to execute.
GET {protocol}://{server}{basePath}/api/workflow/v1/workflows/sessions/{WorkflowSessionId}
curl -X GET \
https://dev.local/api/workflow/v1/workflows/sessions/025d010819f98dbc75776be9666/status \
-H "Accept: application/json" \
-H "Authorization: Bearer "
HTTP 200 Workflow session status retreived successfully
Status Values:
- RUNNING: Session is actively executing
- COMPLETED: Session has finished execution
{
schema:
$ref: '#/components/schemas/WorkflowSessionStatus'
examples:
running:
summary: Running workflow session
value:
workflowSessionId: "wfs_abc123def456"
isRunning: true
status: "RUNNING"
currentModule: "mod_sayCollect_001"
outputVariables:
customerName: "John Doe"
currentStep: "gathering_info"
completed:
summary: Completed workflow session
value:
workflowSessionId: "wfs_abc123def456"
isRunning: false
status: "COMPLETED"
currentModule: null
outputVariables:
customerName: "John Doe"
supportTicketId: "TKT-12345"
resolution: "Issue
}
- currentModule shows the ID of the module currently being executed (null if completed).
- outputVariables contains variables set during workflow execution
Security Guidelines
- Output variables may contain sensitive workflow data; handle with appropriate care.
- Do not expose workflow session IDs directly to end users in client applications.
- Implement proper access controls to ensure users can only query their own sessions
Initial Variables per Channel (Session Context)
These are available in the workflow session context and can be accessed in the workflow.
Voice Example
{
"source": {
"phoneNumber": "+19089536000",
"phoneNumberFormatted": { ... }
},
"details": {},
"routing": { ... },
"linkedIds": {},
"variables": { ... }
}
Messaging Example
{
"data": {
"source": { ... },
"details": {},
"routing": { ... },
"linkedIds": {},
"variables": {}
}
}
The documentation provides examples but does not enumerate every possible field
Security Guidelines
- Never expose service JWT tokens or Avaya session IDs to client applications.
- Validate and sanitize all input parameters before making API calls.
- Output variables may contain sensitive workflow data; handle with appropriate care.
Updated 12 days ago