Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
da5e810
Checkpoint
crickman Sep 19, 2025
af665fe
Update test workflows
crickman Sep 19, 2025
4704e7a
Update workflows/MathChat.yaml
crickman Sep 19, 2025
2ca5922
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 19, 2025
e1eeffb
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 19, 2025
9f77ea2
Update folder
crickman Sep 19, 2025
ca62871
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 21, 2025
ff811a7
Cleanup
crickman Sep 21, 2025
1207ace
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 22, 2025
3435e16
Signed package version
crickman Sep 22, 2025
1f48590
Merge branch 'crickman/feature-workflows-declarative-aliasing' of htt…
crickman Sep 22, 2025
bd4af80
Rollback nuget.config
crickman Sep 22, 2025
d5d20a2
Cleanup
crickman Sep 22, 2025
ba4476c
Set `ProductContext`
crickman Sep 22, 2025
2668c36
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 22, 2025
445c045
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 22, 2025
31cbae3
Move product initialization.
crickman Sep 23, 2025
6c00e08
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 23, 2025
b4a699f
Merge branch 'crickman/feature-workflows-declarative-aliasing' of htt…
crickman Sep 23, 2025
d79052b
Merge branch 'main' into crickman/feature-workflows-declarative-aliasing
crickman Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
<!-- Identity -->
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.77.0" />
<!-- Workflows -->
<PackageVersion Include="Microsoft.Bot.ObjectModel" Version="1.2025.915-1" />
<PackageVersion Include="Microsoft.Bot.ObjectModel.Json" Version="1.2025.915-1" />
<PackageVersion Include="Microsoft.Bot.ObjectModel.PowerFx" Version="1.2025.915-1" />
<PackageVersion Include="Microsoft.Bot.ObjectModel" Version="1.2025.922-1" />
<PackageVersion Include="Microsoft.Bot.ObjectModel.Json" Version="1.2025.922-1" />
<PackageVersion Include="Microsoft.Bot.ObjectModel.PowerFx" Version="1.2025.922-1" />
<PackageVersion Include="Microsoft.PowerFx.Interpreter" Version="1.4.0-build.20250821-1001" />
<!-- Test -->
<PackageVersion Include="FluentAssertions" Version="8.6.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public static Workflow<TInput> Build<TInput>(
{
BotElement rootElement = YamlSerializer.Deserialize<BotElement>(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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() };
Comment thread
crickman marked this conversation as resolved.

await agentProvider.CreateMessageAsync(conversationId, newMessage, cancellationToken).ConfigureAwait(false);

Expand All @@ -41,18 +41,6 @@ private IEnumerable<AIContent> 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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kind: AdaptiveDialog
beginDialog:
kind: Workflow
trigger:

kind: OnActivity
kind: OnConversationStart
id: workflow_test
actions:

Expand Down
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
type: Message
kind: Workflow
trigger:

kind: OnConversationStart
actions:

- kind: EndConversation
id: end_all
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
kind: Workflow
trigger:

kind: OnConversationStart
id: my_workflow
type: Message
actions:

- kind: SetVariable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
kind: Workflow
trigger:

kind: OnConversationStart
id: my_workflow
type: Message
actions:

- kind: SetVariable
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
kind: Workflow
trigger:

kind: OnConversationStart
id: my_workflow
type: Message
actions:

- kind: EndConversation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
kind: Workflow
trigger:

kind: OnConversationStart
id: my_workflow
type: Message
actions:

- kind: GotoAction
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
kind: Workflow
trigger:

kind: OnConversationStart
id: my_workflow
type: Message
actions:

- kind: SetVariable
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Loading