In both Bot Builder V4 and V3, the DialogStack is stored in state. You are correct that V3 serialized and deserialized dialog fields. However, this 'magic' was often times problematic. The V3 binary serialization method would only allow the sdk to target netframework, and the entire dialog stack was more fragile. The V4 dialog stack was re-architected, and feedback from V3 was incorporated. State is now less automatic, and more 'in the hands of the developer'.
Here is an example of ConversationState containing a DialogStack:
"document": {
"$type": "System.Collections.Concurrent.ConcurrentDictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Collections.Concurrent",
"DialogState": {
"$type": "Microsoft.Bot.Builder.Dialogs.DialogState, Microsoft.Bot.Builder.Dialogs",
"DialogStack": {
"$type": "System.Collections.Generic.List`1[[Microsoft.Bot.Builder.Dialogs.DialogInstance, Microsoft.Bot.Builder.Dialogs]], System.Private.CoreLib",
"$values": [
{
"$type": "Microsoft.Bot.Builder.Dialogs.DialogInstance, Microsoft.Bot.Builder.Dialogs",
"Id": "GreetingDialog",
"State": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib",
"dialogs": {
"$type": "Microsoft.Bot.Builder.Dialogs.DialogState, Microsoft.Bot.Builder.Dialogs",
"DialogStack": {
"$type": "System.Collections.Generic.List`1[[Microsoft.Bot.Builder.Dialogs.DialogInstance, Microsoft.Bot.Builder.Dialogs]], System.Private.CoreLib",
"$values": [
{
"$type": "Microsoft.Bot.Builder.Dialogs.DialogInstance, Microsoft.Bot.Builder.Dialogs",
"Id": "namePrompt",
"State": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib",
"options": {
"$type": "Microsoft.Bot.Builder.Dialogs.PromptOptions, Microsoft.Bot.Builder.Dialogs",
"Prompt": {
"$type": "Microsoft.Bot.Schema.Activity, Microsoft.Bot.Schema",
"type": "message",
"id": "3Md4r2ECwdEJnnPshesDe1-g|0000009",
"timestamp": null,
"localTimestamp": null,
"localTimezone": null,
"serviceUrl": "https://webchat.botframework.com/",
"channelId": "webchat",
"from": {
"$type": "Microsoft.Bot.Schema.ChannelAccount, Microsoft.Bot.Schema",
"id": "BotHealthTest@6hiZPWXn5jc",
"name": "BotHealthTest",
"aadObjectId": null,
"role": null
},
"conversation": {
"$type": "Microsoft.Bot.Schema.ConversationAccount, Microsoft.Bot.Schema",
"isGroup": null,
"conversationType": null,
"id": "3Md4r2ECwdEJnnPshesDe1-g",
"name": null,
"aadObjectId": null,
"role": null,
"tenantId": null
},
"recipient": {
"$type": "Microsoft.Bot.Schema.ChannelAccount, Microsoft.Bot.Schema",
"id": "EGnHowki8Se",
"name": "You",
"aadObjectId": null,
"role": null
},
"textFormat": null,
"attachmentLayout": null,
"membersAdded": null,
"membersRemoved": null,
"reactionsAdded": null,
"reactionsRemoved": null,
"topicName": null,
"historyDisclosed": null,
"locale": null,
"text": "What is your name?",
"speak": null,
"inputHint": "expectingInput",
"summary": null,
"suggestedActions": null,
"attachments": null,
"entities": null,
"channelData": null,
"action": null,
"replyToId": "3Md4r2ECwdEJnnPshesDe1-g|0000007",
"label": null,
"valueType": null,
"value": null,
"name": null,
"relatesTo": null,
"code": null,
"expiration": null,
"importance": null,
"deliveryMode": null,
"listenFor": null,
"textHighlights": null,
"semanticAction": null
},
"RetryPrompt": null,
"Choices": null,
"Validations": null
},
"state": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib"
}
}
},
{
"$type": "Microsoft.Bot.Builder.Dialogs.DialogInstance, Microsoft.Bot.Builder.Dialogs",
"Id": "profileDialog",
"State": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib",
"options": null,
"values": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib"
},
"instanceId": "9b48b35f-3fa5-431d-bb4d-9a512491aca4",
"stepIndex": 1
}
}
]
}
}
}
}
]
}
}
}
That said, Bot Builder Adaptive Dialog follows a model more closely resembling the V3 implementation. Preview bits can be found in this branch: 4.Future Please check it out, and provide feedback on the Github repository.