Files
microsoft--agent-framework/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableMessageEnvelope.cs
T
wehub-resource-sync db620d33df
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:39:25 +08:00

52 lines
1.9 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
namespace Microsoft.Agents.AI.DurableTask.Workflows;
/// <summary>
/// Represents a message envelope for durable workflow message passing.
/// </summary>
/// <remarks>
/// <para>
/// This is the durable equivalent of <c>MessageEnvelope</c> in the in-process runner.
/// Unlike the in-process version which holds native .NET objects, this envelope
/// contains serialized JSON strings suitable for Durable Task activities.
/// </para>
/// </remarks>
internal sealed class DurableMessageEnvelope
{
/// <summary>
/// Gets or sets the serialized JSON message content.
/// </summary>
public required string Message { get; init; }
/// <summary>
/// Gets or sets the full type name of the message for deserialization.
/// </summary>
public string? InputTypeName { get; init; }
/// <summary>
/// Gets or sets the ID of the executor that produced this message.
/// </summary>
/// <remarks>
/// Used for tracing and debugging. Null for initial workflow input.
/// </remarks>
public string? SourceExecutorId { get; init; }
/// <summary>
/// Creates a new message envelope.
/// </summary>
/// <param name="message">The serialized JSON message content.</param>
/// <param name="inputTypeName">The full type name of the message for deserialization.</param>
/// <param name="sourceExecutorId">The ID of the executor that produced this message, or null for initial input.</param>
/// <returns>A new <see cref="DurableMessageEnvelope"/> instance.</returns>
internal static DurableMessageEnvelope Create(string message, string? inputTypeName, string? sourceExecutorId = null)
{
return new DurableMessageEnvelope
{
Message = message,
InputTypeName = inputTypeName,
SourceExecutorId = sourceExecutorId
};
}
}