mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Adding support for events & shared state in durable workflows. * PR feedback fixes * PR feedback fixes. * Add YieldOutputAsync calls to 05_WorkflowEvents sample executors The integration test asserts that WorkflowOutputEvent is found in the stream, but the sample executors only used AddEventAsync for custom events and never called YieldOutputAsync. Since WorkflowOutputEvent is only emitted via explicit YieldOutputAsync calls, the assertion would fail. Added YieldOutputAsync to each executor to match the test expectation and demonstrate the API in the sample. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix deserialization to use shared serializer options. * PR feedback updates. * Sample cleanup * PR feedback fixes * Addressing PR review feedback for DurableStreamingWorkflowRun - Use -1 instead of 0 for taskId in TaskFailedException when task ID is not relevant. - Add [NotNullWhen(true)] to TryParseWorkflowResult out parameter following .NET TryXXX conventions. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
25 lines
888 B
C#
25 lines
888 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
namespace Microsoft.Agents.AI.DurableTask.Workflows;
|
|
|
|
/// <summary>
|
|
/// Wraps the orchestration output to include both the workflow result and accumulated events.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The Durable Task framework clears <c>SerializedCustomStatus</c> when an orchestration
|
|
/// completes. To ensure streaming clients can retrieve events even after completion,
|
|
/// the accumulated events are embedded in the orchestration output alongside the result.
|
|
/// </remarks>
|
|
internal sealed class DurableWorkflowResult
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the serialized result of the workflow execution.
|
|
/// </summary>
|
|
public string? Result { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the serialized workflow events emitted during execution.
|
|
/// </summary>
|
|
public List<string> Events { get; set; } = [];
|
|
}
|