Show flow message on init


#1

Hello Community,
I am using Botpress Version 10.50.0 with the embedded web-channel and I try to show the messages within the first node of the Startflow defined in the src/index.js

  // Set Mainflow as Startflow
  bp.dialogEngine.onBeforeCreated((ctx, next) => {
      ctx.flowName = 'main.flow.json'
      next()
  })

As soon as there is a new User nothing happens on default.
Is there a way to render the first node of the Startflow without a event or input from the user?

I allready tried this with a event:

  bp.hear({
      type: /showinit/i ,
    }, async (event, next) => {
        const stateId = event.sessionId || event.user.id;
        await bp.dialogEngine.jumpTo(stateId, 'main.flow.json', 'entry' )
        await bp.dialogEngine.processMessage(stateId, event)
      next()
  })

But the User Avatar is shown as first input.

user-avatar-without-input


#2

@safcgehrke, you can try listening for visit event that should be sent once webchat is loaded.