From da5e810ece650cb8affc7b35b6e0fab3c22832c1 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Fri, 19 Sep 2025 08:37:33 -0700 Subject: [PATCH 01/10] Checkpoint --- dotnet/Directory.Packages.props | 6 +++--- dotnet/nuget.config | 4 +++- .../Extensions/BotElementExtensions.cs | 1 + .../ObjectModel/AddConversationMessageExecutor.cs | 14 +------------- workflows/DeepResearch.yaml | 10 +++++----- workflows/HumanInLoop.yaml | 6 +++--- workflows/Marketing.yaml | 6 +++--- workflows/MathChat.yaml | 6 +++--- 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 75d67b3165..240d56cbb8 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -87,9 +87,9 @@ - - - + + + diff --git a/dotnet/nuget.config b/dotnet/nuget.config index 538a2f45f1..013f1e2a7c 100644 --- a/dotnet/nuget.config +++ b/dotnet/nuget.config @@ -3,7 +3,9 @@ - + + + diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/Extensions/BotElementExtensions.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/Extensions/BotElementExtensions.cs index 1ae9c48a02..c8f69c710d 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/Extensions/BotElementExtensions.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/Extensions/BotElementExtensions.cs @@ -14,6 +14,7 @@ public static string GetId(this BotElement element) => DialogAction action => action.Id.Value, ConditionItem conditionItem => conditionItem.Id ?? throw new DeclarativeModelException($"Undefined identifier for {nameof(ConditionItem)} that is member of {conditionItem.GetParentId() ?? "(root)"}."), OnActivity activity => activity.Id.Value, + SystemTrigger trigger => trigger.Id.Value, _ => throw new DeclarativeModelException($"Unknown identify for element type: {element.GetType().Name}"), }; } diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs index 558d58ff2c..a202a70cea 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs @@ -20,7 +20,7 @@ internal sealed class AddConversationMessageExecutor(AddConversationMessage mode StringExpression conversationExpression = Throw.IfNull(this.Model.ConversationId, $"{nameof(this.Model)}.{nameof(this.Model.ConversationId)}"); string conversationId = this.State.Evaluator.GetValue(conversationExpression).Value; - ChatMessage newMessage = new(this.GetRole(), [.. this.GetContent()]) { AdditionalProperties = this.GetMetadata() }; + ChatMessage newMessage = new(this.Model.Role.Value.ToChatRole(), [.. this.GetContent()]) { AdditionalProperties = this.GetMetadata() }; await agentProvider.CreateMessageAsync(conversationId, newMessage, cancellationToken).ConfigureAwait(false); @@ -41,18 +41,6 @@ private IEnumerable GetContent() } } - private ChatRole GetRole() - { - if (this.Model.Role is null) - { - return ChatRole.User; - } - - AgentMessageRoleWrapper roleWrapper = this.State.Evaluator.GetValue(this.Model.Role).Value; - - return roleWrapper.Value.ToChatRole(); - } - private AdditionalPropertiesDictionary? GetMetadata() { if (this.Model.Metadata is null) diff --git a/workflows/DeepResearch.yaml b/workflows/DeepResearch.yaml index 9612cc8464..6b61534eac 100644 --- a/workflows/DeepResearch.yaml +++ b/workflows/DeepResearch.yaml @@ -29,13 +29,13 @@ # Enable "Open API" in the agent settings using the wttr.json schema. # See: ./setup/WeatherAgent.yaml # -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity - id: activity_xyz123 - type: Message + kind: OnConversationStart + id: workflow_demo actions: + - kind: SetVariable id: setVariable_aASlmF displayName: List all available agents for this orchestrator diff --git a/workflows/HumanInLoop.yaml b/workflows/HumanInLoop.yaml index 8d2b736cc5..461e2b9c56 100644 --- a/workflows/HumanInLoop.yaml +++ b/workflows/HumanInLoop.yaml @@ -4,10 +4,10 @@ # Any Foundry Agent may be used to provide the response. # See: ./setup/QuestionAgent.yaml # -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_demo actions: diff --git a/workflows/Marketing.yaml b/workflows/Marketing.yaml index 6293a3b616..a45334ede5 100644 --- a/workflows/Marketing.yaml +++ b/workflows/Marketing.yaml @@ -4,10 +4,10 @@ # Any Foundry Agent may be used to provide the response. # See: ./setup/QuestionAgent.yaml # -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_demo actions: diff --git a/workflows/MathChat.yaml b/workflows/MathChat.yaml index 581bc0d5c2..52605d2463 100644 --- a/workflows/MathChat.yaml +++ b/workflows/MathChat.yaml @@ -24,10 +24,10 @@ # If the student has demonstrated comprehension and responded to all of your feedback, # give the student your congraluations by using the word "congratulations". # -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_demo actions: From af665feb1e63f760cb21bc6ccbb43424c8d11b3d Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Fri, 19 Sep 2025 08:42:54 -0700 Subject: [PATCH 02/10] Update test workflows --- .../Workflows/AddMessages.yaml | 14 ++++---------- .../Workflows/GetMessage.yaml | 12 +++--------- .../Workflows/GetMessages.yaml | 12 +++--------- .../Workflows/InvokeAgent.yaml | 6 +++--- .../Workflows/SendActivity.yaml | 11 +++-------- .../Workflows/BadId.yaml | 9 +++++---- .../Workflows/ClearAllVariables.yaml | 9 +++++---- .../Workflows/Condition.yaml | 9 ++++----- .../Workflows/ConditionElse.yaml | 9 ++++----- .../Workflows/EditTable.yaml | 10 ++++++---- .../Workflows/EditTableV2.yaml | 10 ++++++---- .../Workflows/EndConversation.yaml | 8 ++++---- .../Workflows/Goto.yaml | 8 ++++---- .../Workflows/LoopBreak.yaml | 9 +++++---- .../Workflows/LoopContinue.yaml | 9 +++++---- .../Workflows/LoopEach.yaml | 9 +++++---- .../Workflows/ParseValue.yaml | 9 +++++---- .../Workflows/ResetVariable.yaml | 9 +++++---- .../Workflows/SendActivity.yaml | 8 ++++---- .../Workflows/SetTextVariable.yaml | 9 +++++---- .../Workflows/SetVariable.yaml | 9 +++++---- .../Workflows/Single.yaml | 9 +++++---- 22 files changed, 98 insertions(+), 109 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/AddMessages.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/AddMessages.yaml index 5a754c9be3..f957c3fca0 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/AddMessages.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/AddMessages.yaml @@ -1,13 +1,7 @@ -# -# This workflow demonstrates a conversation and message manipulation. -# -# Any Foundry Agent may be used to provide the response. -# See: ./setup/QuestionAgent.yaml -# -kind: AdaptiveDialog -beginDialog: - - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: workflow_test actions: diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessage.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessage.yaml index 94e8ba4d73..72b7ef3eae 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessage.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessage.yaml @@ -1,13 +1,7 @@ -# -# This workflow demonstrates a conversation and message manipulation. -# -# Any Foundry Agent may be used to provide the response. -# See: ./setup/QuestionAgent.yaml -# -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_test actions: diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessages.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessages.yaml index faaabfb1d1..45eb153949 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessages.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/GetMessages.yaml @@ -1,13 +1,7 @@ -# -# This workflow demonstrates a conversation and message manipulation. -# -# Any Foundry Agent may be used to provide the response. -# See: ./setup/QuestionAgent.yaml -# -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_test actions: diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/InvokeAgent.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/InvokeAgent.yaml index ad9a2c3d57..af874bdfce 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/InvokeAgent.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/InvokeAgent.yaml @@ -1,7 +1,7 @@ -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_test actions: diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/SendActivity.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/SendActivity.yaml index 9095fe9655..69095e2a3c 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/SendActivity.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Workflows/SendActivity.yaml @@ -1,12 +1,7 @@ -# -# This workflow provides the most basic example of providing a response that includes the user and environment input. -# -# No agent setup is required to run this workflow. -# -kind: AdaptiveDialog -beginDialog: +kind: Workflow +trigger: - kind: OnActivity + kind: OnConversationStart id: workflow_test actions: diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/BadId.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/BadId.yaml index 1bc2063698..6b50202f0b 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/BadId.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/BadId.yaml @@ -1,7 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity - type: Message +kind: Workflow +trigger: + + kind: OnConversationStart actions: + - kind: EndConversation id: end_all diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ClearAllVariables.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ClearAllVariables.yaml index 0af98b8991..b2785c70e1 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ClearAllVariables.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ClearAllVariables.yaml @@ -1,9 +1,10 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: ClearAllVariables id: clear_all variables: [ConversationScopedVariables] diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Condition.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Condition.yaml index 99fd2f2ea7..34fdd190a0 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Condition.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Condition.yaml @@ -1,9 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: - kind: SetVariable diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ConditionElse.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ConditionElse.yaml index 35026406f6..b69e814ca5 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ConditionElse.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ConditionElse.yaml @@ -1,9 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: - kind: SetVariable diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTable.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTable.yaml index 8f6910a7b5..560a503d6c 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTable.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTable.yaml @@ -1,13 +1,15 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetVariable id: set_var variable: Topic.MyTable value: =[{id: 3}] + - kind: EditTable id: edit_var itemsVariable: Topic.MyTable diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTableV2.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTableV2.yaml index 7ecda64328..9a214fb8c0 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTableV2.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EditTableV2.yaml @@ -1,13 +1,15 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetVariable id: set_var variable: Topic.MyTable value: =[{id: 3}] + - kind: EditTableV2 id: edit_var itemsVariable: Topic.MyTable diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EndConversation.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EndConversation.yaml index 40444cb5cc..27a9482c56 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EndConversation.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/EndConversation.yaml @@ -1,8 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: - kind: EndConversation diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Goto.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Goto.yaml index b2c28be457..f40cd7257d 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Goto.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Goto.yaml @@ -1,8 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: - kind: GotoAction diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopBreak.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopBreak.yaml index 9d7d8db0f9..7eba8fb9ee 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopBreak.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopBreak.yaml @@ -1,9 +1,10 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetVariable id: setVariable_count variable: Topic.Count diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopContinue.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopContinue.yaml index be39550cb8..d9cc78fc93 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopContinue.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopContinue.yaml @@ -1,8 +1,9 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message + actions: - kind: SetVariable id: setVariable_count diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopEach.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopEach.yaml index a18d9ee756..7b3d90ad92 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopEach.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/LoopEach.yaml @@ -1,8 +1,9 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message + actions: - kind: SetVariable id: setVariable_count diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ParseValue.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ParseValue.yaml index e7270ce48c..3a346fd4d9 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ParseValue.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ParseValue.yaml @@ -1,8 +1,9 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message + actions: - kind: ParseValue id: parse_var diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ResetVariable.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ResetVariable.yaml index b9fe367c83..c28d2f11f7 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ResetVariable.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/ResetVariable.yaml @@ -1,9 +1,10 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetVariable id: set_var variable: Topic.MyVar diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SendActivity.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SendActivity.yaml index 1b1e1b8883..a334e85204 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SendActivity.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SendActivity.yaml @@ -1,8 +1,8 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: - kind: SetVariable diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetTextVariable.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetTextVariable.yaml index 8f88186994..103747e7e0 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetTextVariable.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetTextVariable.yaml @@ -1,9 +1,10 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetTextVariable id: set_text variable: Topic.TestVar diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetVariable.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetVariable.yaml index 5f191db2a5..6827830b0e 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetVariable.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/SetVariable.yaml @@ -1,9 +1,10 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: SetVariable id: set_var variable: Topic.TestVar diff --git a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Single.yaml b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Single.yaml index 54097d9e88..6199adcd1b 100644 --- a/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Single.yaml +++ b/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Workflows/Single.yaml @@ -1,8 +1,9 @@ -kind: AdaptiveDialog -beginDialog: - kind: OnActivity +kind: Workflow +trigger: + + kind: OnConversationStart id: my_workflow - type: Message actions: + - kind: EndConversation id: end_all From 4704e7aa357f99161bc14822f1cee104133bc92c Mon Sep 17 00:00:00 2001 From: Chris <66376200+crickman@users.noreply.github.com> Date: Fri, 19 Sep 2025 08:48:16 -0700 Subject: [PATCH 03/10] Update workflows/MathChat.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- workflows/MathChat.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/MathChat.yaml b/workflows/MathChat.yaml index 52605d2463..668e0bfb4b 100644 --- a/workflows/MathChat.yaml +++ b/workflows/MathChat.yaml @@ -22,7 +22,7 @@ # Review and coach the student's approach to solving the given math problem. # Don't repeat the solution or try and solve it. # If the student has demonstrated comprehension and responded to all of your feedback, -# give the student your congraluations by using the word "congratulations". +# give the student your congratulations by using the word "congratulations". # kind: Workflow trigger: From 9f77ea2980753f9f4bf20d4630d691171b4576ff Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Fri, 19 Sep 2025 10:50:37 -0700 Subject: [PATCH 04/10] Update folder --- dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs b/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs index 439ffff7c6..940c6afddf 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs @@ -291,7 +291,7 @@ private static InputResponse HandleExternalRequest(ExternalRequest request) string? repoFolder = GetRepoFolder(); if (repoFolder is not null) { - workflowFile = Path.Combine(repoFolder, "Workflows", workflowFile); + workflowFile = Path.Combine(repoFolder, "workflow-samples", workflowFile); workflowFile = Path.ChangeExtension(workflowFile, ".yaml"); } } From ff811a7864e7d945f7d2d00cee3ee6c84f436ec1 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 21 Sep 2025 15:39:34 -0700 Subject: [PATCH 05/10] Cleanup --- .../DeclarativeWorkflowBuilder.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs index 0affa26d4c..d965f368de 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs @@ -50,10 +50,9 @@ public static Workflow Build( { BotElement rootElement = YamlSerializer.Deserialize(yamlReader) ?? throw new DeclarativeModelException("Workflow undefined."); - // ISSUE #486 - Use "Workflow" element for Foundry. if (rootElement is not AdaptiveDialog workflowElement) { - throw new DeclarativeModelException($"Unsupported root element: {rootElement.GetType().Name}. Expected an {nameof(AdaptiveDialog)}."); + throw new DeclarativeModelException($"Unsupported root element: {rootElement.GetType().Name}. Expected an {nameof(Workflow)}."); } string rootId = WorkflowActionVisitor.Steps.Root(workflowElement.BeginDialog?.Id.Value); From 3435e160d2ab4cedcdb403bbb25f34632a63d920 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 21 Sep 2025 18:54:35 -0700 Subject: [PATCH 06/10] Signed package version --- dotnet/Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 276d7da1be..969bd848bb 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -87,9 +87,9 @@ - - - + + + From bd4af80ca222604f7051f8c5af58c13cd36472f3 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 21 Sep 2025 18:55:29 -0700 Subject: [PATCH 07/10] Rollback nuget.config --- dotnet/nuget.config | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dotnet/nuget.config b/dotnet/nuget.config index 013f1e2a7c..fb491371b5 100644 --- a/dotnet/nuget.config +++ b/dotnet/nuget.config @@ -2,10 +2,8 @@ - - - - + + From d5d20a239e4dc765f262e5e8defc12bf9b883321 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 21 Sep 2025 19:00:26 -0700 Subject: [PATCH 08/10] Cleanup --- dotnet/nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/nuget.config b/dotnet/nuget.config index fb491371b5..538a2f45f1 100644 --- a/dotnet/nuget.config +++ b/dotnet/nuget.config @@ -2,7 +2,7 @@ - + From ba4476cf5bbb9791b2fee90a19ae1440ab3397a3 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Mon, 22 Sep 2025 07:57:16 -0700 Subject: [PATCH 09/10] Set `ProductContext` --- .../DeclarativeWorkflowBuilder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs index d965f368de..90d5ef8db8 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs @@ -48,6 +48,8 @@ public static Workflow Build( Func? inputTransform = null) where TInput : notnull { + ProductContext.SetContext(Product.Foundry); + BotElement rootElement = YamlSerializer.Deserialize(yamlReader) ?? throw new DeclarativeModelException("Workflow undefined."); if (rootElement is not AdaptiveDialog workflowElement) From 31cbae38fbe6d332ced417398d02184e8716d360 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Mon, 22 Sep 2025 19:49:55 -0700 Subject: [PATCH 10/10] Move product initialization. --- .../DeclarativeWorkflowBuilder.cs | 2 -- .../Interpreter/WorkflowElementWalker.cs | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs index 90d5ef8db8..d965f368de 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/DeclarativeWorkflowBuilder.cs @@ -48,8 +48,6 @@ public static Workflow Build( Func? inputTransform = null) where TInput : notnull { - ProductContext.SetContext(Product.Foundry); - BotElement rootElement = YamlSerializer.Deserialize(yamlReader) ?? throw new DeclarativeModelException("Workflow undefined."); if (rootElement is not AdaptiveDialog workflowElement) diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/Interpreter/WorkflowElementWalker.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/Interpreter/WorkflowElementWalker.cs index 26f37f9102..cafb0a5a39 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/Interpreter/WorkflowElementWalker.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/Interpreter/WorkflowElementWalker.cs @@ -6,6 +6,11 @@ namespace Microsoft.Agents.Workflows.Declarative.Interpreter; internal sealed class WorkflowElementWalker : BotElementWalker { + static WorkflowElementWalker() + { + ProductContext.SetContext(Product.Foundry); + } + private readonly DialogActionVisitor _visitor; public WorkflowElementWalker(DialogActionVisitor visitor)