// Copyright (c) Microsoft. All rights reserved. namespace Microsoft.Agents.AI.DurableTask.Workflows; /// /// Represents a message envelope for durable workflow message passing. /// /// /// /// This is the durable equivalent of MessageEnvelope 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. /// /// internal sealed class DurableMessageEnvelope { /// /// Gets or sets the serialized JSON message content. /// public required string Message { get; init; } /// /// Gets or sets the full type name of the message for deserialization. /// public string? InputTypeName { get; init; } /// /// Gets or sets the ID of the executor that produced this message. /// /// /// Used for tracing and debugging. Null for initial workflow input. /// public string? SourceExecutorId { get; init; } /// /// Creates a new message envelope. /// /// The serialized JSON message content. /// The full type name of the message for deserialization. /// The ID of the executor that produced this message, or null for initial input. /// A new instance. internal static DurableMessageEnvelope Create(string message, string? inputTypeName, string? sourceExecutorId = null) { return new DurableMessageEnvelope { Message = message, InputTypeName = inputTypeName, SourceExecutorId = sourceExecutorId }; } }