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

# Start a new workflow session

## Overview

This API allows you to execute workflows programmatically to automate business processes, trigger notifications, route interactions, and integrate with external systems.

## Finding Your Customer Subdomain

Your subdomain is found in your Infinity portal URL. 

**Example:** If your portal URL is:

```
https://core.avaya1234.ec.avayacloud.com/app/core-config-ui/
```

Your subdomain would be: **`avaya1234`**

**To use this API:**

1. **Find your subdomain** from your Infinity portal URL (as shown above)
2. **Get your Bearer token** by following the [Access Token API guide](https://developers.avayacloud.com/avaya-infinity/reference/generateaccesstoken)
3. **In the API explorer on the right:**
   - Click on `{customer-subdomain}` in the URL field and replace it with your actual subdomain
   - Paste your Bearer token in the Credentials section
   - Fill out the Body Parameters to customize the request for your use case

The full endpoint URL structure:
```
POST https://core.{customer-subdomain}.ec.avayacloud.com/api/workflow/v1/workflows/sessions
```

## Important Notes on Fields

**Field Processing:**
- Only fields in the `variables` object are accessible in workflows via `{{variables.key}}`
- Other optional fields (`source`) are processed by the system for routing and context
- These structured fields are NOT available as workflow variables
- Unrecognized fields automatically get added to the `variables` object

## Working with Variables

Variables passed in the `variables` object are accessible in your workflow modules:

**Access in Workflow:**
```
{{customer_name}}  → "John Smith"
{{order_id}}       → "TEST-1984-001"
{{amount}}         → "499.99"
```

**Common Use Cases:**
- Send data to external systems via webhook modules
- Make routing decisions based on variable values (amount, status, priority)
- Update interaction records with custom data
- Process and transform business data

## Additional Information

- Session begins executing immediately upon creation
- Authentication is required for all workflow executions
- This endpoint implements rate limiting and DOS protection

# 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"
        ]
      },
      "WorkflowSessionResponse": {
        "type": "object",
        "properties": {
          "session": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique workflow session identifier (use to query session status)",
                "example": "028d01111220a063d64b039dad"
              },
              "engagementId": {
                "type": "string",
                "description": "Associated engagement ID (if applicable)",
                "example": "d71bbdbf-c840-4de2-a0d9-ef8ade9ab382"
              },
              "workflowId": {
                "type": "string",
                "description": "Workflow that was executed",
                "example": "025d0111114ed33c55731a7cb0"
              },
              "workflowName": {
                "type": "string",
                "description": "Human-readable workflow name",
                "example": "Customer Support Workflow"
              }
            },
            "required": [
              "id"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/api/workflow/v1/workflows/sessions": {
      "post": {
        "summary": "Start a new workflow session",
        "description": "## Overview\n\nThis API allows you to execute workflows programmatically to automate business processes, trigger notifications, route interactions, and integrate with external systems.\n\n## Finding Your Customer Subdomain\n\nYour subdomain is found in your Infinity portal URL. \n\n**Example:** If your portal URL is:\n\n```\nhttps://core.avaya1234.ec.avayacloud.com/app/core-config-ui/\n```\n\nYour subdomain would be: **`avaya1234`**\n\n**To use this API:**\n\n1. **Find your subdomain** from your Infinity portal URL (as shown above)\n2. **Get your Bearer token** by following the [Access Token API guide](https://developers.avayacloud.com/avaya-infinity/reference/generateaccesstoken)\n3. **In the API explorer on the right:**\n   - Click on `{customer-subdomain}` in the URL field and replace it with your actual subdomain\n   - Paste your Bearer token in the Credentials section\n   - Fill out the Body Parameters to customize the request for your use case\n\nThe full endpoint URL structure:\n```\nPOST https://core.{customer-subdomain}.ec.avayacloud.com/api/workflow/v1/workflows/sessions\n```\n\n## Important Notes on Fields\n\n**Field Processing:**\n- Only fields in the `variables` object are accessible in workflows via `{{variables.key}}`\n- Other optional fields (`source`) are processed by the system for routing and context\n- These structured fields are NOT available as workflow variables\n- Unrecognized fields automatically get added to the `variables` object\n\n## Working with Variables\n\nVariables passed in the `variables` object are accessible in your workflow modules:\n\n**Access in Workflow:**\n```\n{{customer_name}}  → \"John Smith\"\n{{order_id}}       → \"TEST-1984-001\"\n{{amount}}         → \"499.99\"\n```\n\n**Common Use Cases:**\n- Send data to external systems via webhook modules\n- Make routing decisions based on variable values (amount, status, priority)\n- Update interaction records with custom data\n- Process and transform business data\n\n## Additional Information\n\n- Session begins executing immediately upon creation\n- Authentication is required for all workflow executions\n- This endpoint implements rate limiting and DOS protection\n",
        "operationId": "startWorkflowSession",
        "tags": [
          "Workflow Sessions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "workflowId"
                ],
                "properties": {
                  "workflowId": {
                    "type": "string",
                    "description": "Unique identifier of workflow to execute (26 characters, starts with `025`)",
                    "example": "025d0111114ed33c55731a7cb0",
                    "pattern": "^025[a-z0-9]{23}$"
                  },
                  "version": {
                    "type": "string",
                    "description": "Workflow version - use \"current\" for latest published version",
                    "example": "current",
                    "default": "current"
                  },
                  "commType": {
                    "type": "string",
                    "enum": [
                      "phone",
                      "messaging",
                      "text"
                    ],
                    "description": "Communication channel type"
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "description": "Initial input or message for the workflow session",
                    "example": "Hello, I need support"
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code for the workflow session",
                    "example": "en-US"
                  },
                  "engagementId": {
                    "type": "string",
                    "description": "Engagement identifier to associate with the session",
                    "example": "d71bbdbf-c840-4de2-a0d9-ef8ade9ab382"
                  },
                  "interactionId": {
                    "type": "string",
                    "description": "Interaction identifier to associate with the session (used for updating interactions)",
                    "example": "004d011111ac653936884420f4"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Custom variables accessible in workflow via {{variables.key}}. Accepts any key-value pairs.",
                    "example": {
                      "customer_name": "John Smith",
                      "order_id": "TEST-1984-001",
                      "amount": "499.99",
                      "status": "pending"
                    }
                  },
                  "source": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Source information about the request origin (channel, phoneNumber, region, etc.)",
                    "example": {
                      "channel": "email",
                      "phoneNumber": "+1234567890",
                      "region": "US"
                    }
                  }
                }
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal Request",
                  "description": "Execute workflow with only required parameters.\n\n// Required: The workflow ID to execute\n// Optional: Version defaults to \"current\" (latest published)\n",
                  "value": {
                    "workflowId": "025d0111114ed33c55731a7cb0",
                    "version": "current"
                  }
                },
                "with_variables": {
                  "summary": "With Custom Variables",
                  "description": "Pass business data to workflow modules for processing, routing, or integration.\n\n// workflowId: Which workflow to execute\n// version: Use \"current\" for latest published version\n// variables: Custom data accessible in workflow via {{variable_name}}\n//            Use these for business logic, routing decisions, webhooks, etc.\n",
                  "value": {
                    "workflowId": "025d0111114ed33c55731a7cb0",
                    "version": "current",
                    "variables": {
                      "customer_name": "John Smith",
                      "order_id": "TEST-1984-001",
                      "amount": "499.99",
                      "status": "pending"
                    }
                  }
                },
                "update_interaction": {
                  "summary": "Update Interaction",
                  "description": "Execute workflow to update an existing interaction with custom data.\n\n// workflowId: The workflow that will process the update\n// interactionId: The existing interaction to update\n// variables: Data that workflow can use to update interaction fields\n//            Access via {{bank_balance}}, {{customer_tier}}, etc.\n",
                  "value": {
                    "workflowId": "025d01111240b672652a2fb343",
                    "version": "current",
                    "interactionId": "004d011111ac653936884420f4",
                    "variables": {
                      "bank_balance": "$25,432.18",
                      "website_visits": "47",
                      "last_purchase_amount": "$299.99",
                      "customer_tier": "premium",
                      "notes": "Customer just made a purchase"
                    }
                  }
                },
                "complete_example": {
                  "summary": "Complete Working Example",
                  "description": "Full authentication and workflow execution flow:\n\n**Step 1 - Get JWT Token:**\n```bash\ncurl -X POST \\\n  https://core.avaya1234.ec.avayacloud.com/auth/realms/avaya/protocol/openid-connect/token \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'grant_type=client_credentials' \\\n  -d 'client_id=your-client-id' \\\n  -d 'client_secret=your-client-secret'\n```\n\n**Step 2 - Execute Workflow:**\n\nUse the access_token from Step 1 in the Authorization header\n",
                  "value": {
                    "workflowId": "025d0111114ed33c55731a7cb0",
                    "version": "current",
                    "variables": {
                      "customer_name": "John Smith",
                      "order_id": "TEST-1984-001",
                      "amount": "499.99"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Workflow session created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSessionResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Successful workflow session creation",
                    "description": "**Response Structure:**\n\nThe response contains a session object with the following key fields:\n\n- `session.id` - Unique workflow session identifier. Use this to query workflow status later via the GET endpoint\n- `session.workflowId` - Confirms which workflow was executed\n- `session.engagementId` - Associated engagement ID (if applicable)\n- `session.workflowName` - Human-readable name of the workflow\n\n**Next Steps:**\n\nSave the `session.id` to query the workflow status and retrieve output variables using:\n```\nGET /api/workflow/v1/workflows/sessions/{session.id}\n```\n",
                    "value": {
                      "session": {
                        "id": "028d01111220a063d64b039dad",
                        "engagementId": "d71bbdbf-c840-4de2-a0d9-ef8ade9ab382",
                        "workflowId": "025d0111114ed33c55731a7cb0",
                        "workflowName": "Customer Support Workflow"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_workflow_id": {
                    "summary": "Missing workflowId",
                    "value": {
                      "error": "workflowId is required",
                      "message": "Missing required workflowId parameter"
                    }
                  },
                  "invalid_version": {
                    "summary": "Invalid workflow version",
                    "value": {
                      "error": "Workflow version not found",
                      "message": "Invalid version or workflow not published"
                    }
                  },
                  "missing_account": {
                    "summary": "Missing account context",
                    "value": {
                      "error": "Missing account context",
                      "message": "Authentication may be required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or expired JWT token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Authentication required",
                    "value": {
                      "error": "Unauthorized",
                      "message": "Invalid or expired JWT token"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions to execute workflow",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "forbidden": {
                    "summary": "Insufficient permissions",
                    "value": {
                      "error": "Forbidden",
                      "message": "Insufficient permissions to execute workflow"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Workflow not found or missing start module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workflow_not_found": {
                    "summary": "Workflow doesn't exist",
                    "value": {
                      "error": "Workflow not found",
                      "message": "Workflow with specified ID doesn't exist"
                    }
                  },
                  "no_start_item": {
                    "summary": "Workflow missing start module",
                    "value": {
                      "error": "Workflow version does not have a start item",
                      "message": "Workflow missing start module"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity - Workflow validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unsupported_commtype": {
                    "summary": "Communication type not supported",
                    "value": {
                      "error": "Workflow version does not support messaging",
                      "message": "Communication type not supported by workflow"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "internal_error": {
                    "summary": "Server error",
                    "value": {
                      "error": "Internal server error",
                      "message": "Unexpected server error during processing"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
````