title: Can we programmatically set and delete contexts with Dialogflow's Node fulfilment library, without involving the UI?
body: <p>Using Dialogflow's <a href="https://github.com/dialogflow/dialogflow-fulfillment-nodejs" rel="nofollow noreferrer">Node Fulfillment SDK</a>, I thought one could programmatically set and delete contexts, and extract parameters from within them. </p>
  
  <p>I'm trying to collect values for multiple parameters, and they can come in on multiple passes to the same intent. The following code runs within the intent handler:</p>
  
  <pre><code>contextParams = agent.context.get("seek-create-params-context").parameters;
  currentParams = agent.parameters;
  
  // merge will look for required params from both current and context
  newParameters = merge(currentParams, contextParams); 
  
  agent.context.set({
   name: "seek-create-params-context",
   lifespan: 1,
   parameters: newParameters
  });
  </code></pre>
  
  <p>It extracts the params that were passed in on the previous interaction, merges it with the newly available params, and reset the context with the new set of available params. </p>
  
  <p>However, right now, on each pass, "seek-create-params-context" doesn't contain what was sent out in <code>newParameters</code> the previous time. They do resolve to the correct intent based on the context.
  What am I doing wrong? </p>
  
  <p>Do I need to fiddle with Dialogflow's UI at all to send context params?</p>
  
  <p>An example interaction based on real logs (irrelevant params removed):</p>
  
  <pre><code>/* 
    First pass:
    User msg doesn't contain any of params `value` or `product`
  */  
  
  // agent.parameters: 
  {}
  // agent.context.get('seeking-params-expense-create').parameters:
  undefined
  // outgoing 'seeking-params-expense-create' params (lifespan 1)
  { value: '', product: '' }
  
  /*
    Second pass:
    So far, so good.
    Next pass, we receive `value`, but not `product`.
  */
  
  // agent.parameters:
  { value: 50, product: '' }
  // agent.context.get('seeking-params-expense-create').parameters:
  { 
    'value.original': '50',
    'product.original': '', 
     value: 50,
     product: ''  
    }
  // outgoing 'seeking-params-expense-create' params (lifespan 1):
  { value: 50, product: '' }
  
  
  /*     
    Third pass: 
    This time, we want to use `value` from context since we
    stored in last pass and seek `product` from user.
    User only supplies `product` this time.
  */
  
  // agent.parameters:
  { value: '', product: 'MRT' }
  // agent.context.get('seeking-params-expense-create').parameters:
  { 
    'value.original': '', 
    'product.original': '',
     product: 'MRT', 
     value: ''
  }
  // outgoing 'seeking-params-expense-create' params (lifespan 1):
  { value: '', product: 'MRT' }
  </code></pre>