Azure / Azure/azure-sdk-for-python
Feature Request: Dynamic Workflow Variable Initialization
- Vorherrschende Sprache
- Python
- Sterne
- 5.6k
- Forks
- 3.4k
- Ø Merge
- 2 T.
- Gemergte PRs (30 T.)
- 217
Beschreibung
**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.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit dem Beispiel für eine Responses API-Anfrage und der SetVariable-Aktion im OnConversationStart-Trigger; vergleichen Sie die dokumentierte Verarbeitung von structured_inputs, message.metadata und extra_body. Als abgeschlossen gilt, wenn ein Workflow anfragespezifische CustomerId- und AccountId-Werte für eine parametrisierte Ausführung empfangen kann und die unterstützte Anfrageform sowie die Workflow-Ausdrücke dokumentiert oder getestet sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure, python
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100