Azure / Azure/azure-sdk-for-python

Feature Request: Dynamic Workflow Variable Initialization

Aperta
#44,570 5 commenti 1 reazione 0 assegnatari Vedi su GitHub
customer-reported needs-team-attention question
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g 2h
PR unite (30g)
202

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziare con l'esempio di richiesta di Responses API e l'azione SetVariable nel trigger OnConversationStart; confrontare la gestione documentata di structured_inputs, message.metadata ed extra_body. Il lavoro è completo quando un workflow può ricevere valori CustomerId e AccountId specifici della richiesta per un'esecuzione parametrizzata e la forma della richiesta supportata e le espressioni del workflow sono documentate o testate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, python
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.