title: Proactive Dialog Bot Framework - Cannot continue the waterfall Dialog
body: <p><strong>Here I am trying to invoke a dialog and push it on the existing dialog stack, idea is to proactively call a Dialog and continue the waterfall structure of the dialog.</strong></p>
  <p>Issue : I can start the dialog, and prompt user with Hero card to select Yes or No choices
  but the Answer given by user does not stay in the same Dialog context.</p>
  <p>Error : <em>Failed to continue dialog. A dialog with continueConversationDialog id could not be found.</em></p>
  <p>Below is the sample code snippet used for invoking the Dialog from controller</p>
  <pre><code>public class ProactiveMessageController : Controller
  {
   private readonly BotFrameworkHttpAdapter _adapter;
   private readonly ConversationState _conversationState;
   private readonly IBot _bot;
   private readonly BotSettings _settings;
   private readonly ILastMessageSent _lastmessagesent;
   private readonly ContinueConversationDialog _dialog;
  
   public ProactiveMessageController (BotFrameworkHttpAdapter adapter, ConversationState conversationState, IBot bot, BotSettings settings, ILastMessageSent lastmessagesent, ContinueConversationDialog dialog)
      {
       _adapter = adapter;
       _conversationState = conversationState;
       _bot = bot;
       _settings = settings;
       _dialog = dialog;
      }
  
  [HttpGet]
  public async Task&lt;IActionResult&gt; Index()
  {
   try
    {
     await _adapter.ContinueConversationAsync(
     _settings.MicrosoftAppId,
     item.conversationReference,
     async (ITurnContext TurnContext, CancellationToken cancellationToken) =&gt;
        {
          var conversationStateAccessors = _conversationState.CreateProperty&lt;DialogState&gt;(nameof(DialogState));
          var dialogSet = new DialogSet(conversationStateAccessors);
          dialogSet.Add(_dialog);
          var dialogContext = await dialogSet.CreateContextAsync(TurnContext, cancellationToken);
          await dialogContext.BeginDialogAsync(_dialog.Id);
          await _conversationState.SaveChangesAsync(TurnContext,false,cancellationToken);
        },
          default(CancellationToken)
           );
      }
      catch (Exception ex)
        {
          Console.WriteLine(ex);
        }
  }
  </code></pre>
  <p>Sample waterfall Dialog code snippet, is as follows</p>
  <pre><code>public class ContinueConversationDialog : ComponentDialog
      {
          private readonly BotServices _services;
          private readonly LocaleTemplateManager _templateManager;
          private readonly IStatePropertyAccessor&lt;UserProfileState&gt; _accessor;
          private readonly IUserManagement _userManagement;
  
          public ContinueConversationDialog(
              IServiceProvider serviceProvider, IUserManagement userManagement)
              : base(nameof(ContinueConversationDialog))
          {
              _templateManager = serviceProvider.GetService&lt;LocaleTemplateManager&gt;();
  
              var userState = serviceProvider.GetService&lt;UserState&gt;();
              _accessor = userState.CreateProperty&lt;UserProfileState&gt;(nameof(UserProfileState));
              _services = serviceProvider.GetService&lt;BotServices&gt;();
  
              var ContinueConversation = new WaterfallStep[]
              {
                  PromptToContinueConversation,
                  FinishDialogAsync,
              };
  
              AddDialog(new WaterfallDialog(nameof(ContinueConversation), ContinueConversation));
              AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
              _userManagement = userManagement;
          }
  
          public async Task&lt;DialogTurnResult&gt; PromptToContinueConversation(WaterfallStepContext sc, CancellationToken cancellationToken)
          {
              return await sc.PromptAsync(nameof(ConfirmPrompt), new PromptOptions
              {
                  Prompt = _templateManager.GenerateActivityForLocale(&quot;ConfirmPrompt&quot;),
                  RetryPrompt = _templateManager.GenerateActivityForLocale(&quot;InvalidOptionPrompt&quot;),
                  Style = ListStyle.HeroCard
              }, cancellationToken);    
              
          }
  
          public async Task&lt;DialogTurnResult&gt; FinishDialogAsync(WaterfallStepContext sc, CancellationToken cancellationToken)
          {
                  bool ContinueConversationresponse = (bool)sc.Result;
  
                  if (ContinueConversationresponse)
                  {
                  //Continue the conversation on main dialog
                  Console.Write(&quot;Selected Yes&quot;);
                  return null;
                  }
                  else
                  {
                      //Ask for feedback and close the conversation
                      return null;
                  }
          }
      }
  </code></pre>
  <p>Part 1 where user is prompted with chocie works well, dialog is invoked without any issue
  But when user submits the response I am not able to get it in same context.
  I apply debugger and breakpoints in dialog to confirm the flow reaching the second step but it never does.</p>
  <p>Can you please suggest how can we continue the conversation in same context after dialog is pushed on the current stack.</p>
  <p>FYI:  I am saving the current dialog state as well but no luck continuing; Dialog classes are registered as Transient, I have tried making it Singleton but does not make a differnce.</p>