Azure / Azure/azure-sdk-for-python
Feature Request: Dynamic Workflow Variable Initialization
- 主要言語
- Python
- スター
- 5.6k
- フォーク
- 3.4k
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 213
説明
**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.
コントリビューションガイド
調査の方向性
Responses API リクエストの例と、OnConversationStart トリガー内の SetVariable アクションから始め、structured_inputs、message.metadata、extra_body の文書化された処理を比較します。リクエスト固有の CustomerId と AccountId の値をワークフローがパラメーター化された実行のために受け取れるようになり、サポートされるリクエスト形式とワークフロー式が文書化またはテストされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, python
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100