Azure / Azure/azure-sdk-for-python
Feature Request: Dynamic Workflow Variable Initialization
- Lenguaje dominante
- Python
- Estrellas
- 5.6k
- Forks
- 3.4k
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 213
Descripción
**Summary**
Enable dynamic initialization of workflow variables from API requests to support parameterized workflow execution.
**Problem Statement**
Currently, workflows can only initialize variables with static values using SetVariable actions in the OnConversationStart trigger. For example:
```yaml
- kind: SetVariable
id: set_customer_id
variable: Local.CustomerId
value: "cust-1" # Hard-coded value
```
This creates challenges for:
- Testing: Cannot parameterize test scenarios with different customer/account IDs
- Reusability: Same workflow cannot be used with different input parameters
- Evaluation: Cannot run automated test suites with varied inputs
**Current Workarounds Attempted**
Metadata in ChatMessage: Tried passing variables in [message.metadata] but they're not accessible in workflow expressions
System.Variables: Attempted =System.Variables.CustomerId, but no mechanism exists to populate this from API requests
extra_body parameters: Explored various [extra_body] configurations but no documented approach works
Option 1: Structured Inputs (Preferred)
Allow passing workflow variables via structured_inputs in the API request:
```python
response = await openai_client.responses.create(
conversation=conversation_id,
input="User message",
extra_body={
"agent": {"name": "workflow-name", "type": "agent_reference"},
"structured_inputs": {
"CustomerId": "cust-3",
"AccountId": "acct-125"
}
}
)
```
Workflow could access these as:
```yaml
- kind: SetVariable
variable: Local.CustomerId
value: =System.StructuredInputs.CustomerId
```
Or automatically make them available without SetVariable:
```yaml
- kind: InvokeAzureAgent
input:
arguments:
CustomerId: =Input.CustomerId
```
**Priority**
High - This is a fundamental requirement for production workflows and automated testing scenarios.
Guía de contribución
Línea de trabajo
Comience con el ejemplo de solicitud de Responses API y la acción SetVariable en el trigger OnConversationStart; compare el manejo documentado de structured_inputs, message.metadata y extra_body. Se considera terminado cuando un workflow puede recibir valores de CustomerId y AccountId específicos de la solicitud para una ejecución parametrizada, y la forma de solicitud admitida y las expresiones del workflow están documentadas o probadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, python
- Área
- api, backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100