title: Initialize Session Entity Types before the first Intent response in Dialogflow with Google Assistant
body: <p>My app currently loads Session Entity Types during the Welcome Intent response. </p>
  
  <p>So, if the user says:</p>
  
  <p><em>Talk to TestPoemApp.</em></p>
  
  <p>My app will respond:</p>
  
  <p><em>Hi. What poem would you like to hear?</em></p>
  
  <p>and also sends webhookResponse.SessionEntityTypes defining Session Entity Types for Entity "PoemType" (<a href="https://cloud.google.com/dialogflow/docs/entities-session#creating_session_entities_with_fulfillment" rel="nofollow noreferrer">fulfillment method</a>). The user can then say:</p>
  
  <p><em>Recite My Custom Poem.</em></p>
  
  <p>where "My Custom Poem" is a Session Entity Type for the Entity "PoemType". The RecitePoem Intent is fired and all works well.</p>
  
  <p>However, if the user says:</p>
  
  <p><em>Tell TestPoemApp to recite My Custom Poem.</em> (a.k.a. UserPhrase2)</p>
  
  <p>it does not work because the RecitePoem Intent is firing directly before the Session Entity Types have been loaded since the Welcome Intent was bypassed. <strong>Is there any way to load Session Entity Types before or during the first response?</strong></p>
  
  <p>NOTE 1: One thing I've tried is to use Events with server-side slot filling. So, when the user says UserPhrase2, the RecitePoem Intent sees that the required PoemType parameter is missing and responds with webhookResponse.SessionEntityTypes defining the Session Entity Types and also raises an Event which basically just retriggers the RecitePoem  Intent. This does not work because I believe the webhookResponse.SessionEntityTypes is not read until the end of the Event chain (i.e. SessionEntityTypes won't be read until the retriggered RecitePoem call responds). I believe this because <a href="https://cloud.google.com/dialogflow/docs/events-custom#webhook" rel="nofollow noreferrer">"When the followupEventInput parameter is set for a WebhookResponse, Dialogflow ignores the fulfillmentText, fulfillmentMessages, and payload fields."</a> That doesn't specifically mention SessionEntityTypes, but I'm guessing those are also ignored.</p>
  
  <p>NOTE 2: I could turn on "Allow automated expansion" for the Entity and sort of get around this, but I'd like to avoid this if possible because I believe actual, defined Session Entity Types will be better.</p>