Triggers: conversationId for webhook is picked up ...
# 🤝help
a
I'm using triggers + webhooks. From my backend I'm sending:
Copy code
const res = await fetch(
      "https://webhook.botpress.cloud/xxx",
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          conversationId,
          answer,
        }),
      }
    );
If I follow the botpress logs, I get the error:
Copy code
Error sending outgoing message yt [Error]: request/body must have required property 'conversationId'
But if I open the workflow editor and inspect my trigger > discover events, I can clearly see that the
conversationId
is inside the JSON
r
@adamant-policeman-88146 yes, you'll need an action to set the conversationId to your webhook conversationId. Something like
event.conversationId = event.payload.conversationId
a
Cool,, trying now
r
(the reason this happens is because some events like webhooks are non-conversational and have to be binded to an existing conversation to send messages) We will improve the experience of binding
a
Still doesn't work:
r
can you console.log(event) for me after the trigger ?
a
Sure 1 sec
r
ah sorry
my mistake
should be
event.conversationId = event.payload.body.conversationId
when coming from a POST webhook
a
oh damn you're right, i missed that too
let me test a full flow 😄
r
alright ! lmk i'm curious about what you are building 🙂
a
vectorized 30GB of plain text, using a bot to answer that
r
sick !
omg 30GB lol
yeah you'll need an external vectorDB for that lol
a
Haha exactly, I actually asked here before trying to upload so many docs in botpress
But now the bot runs smooth! The langchain agent in supabase can respond between 30 seconds to 15 minutes, depending on the task. Botpress was timing out, so triggers are the way to go
r
keep me up to date with your progress, this is a really cool project. we might just allow external vector DBs in the KB if that's a popular demand
yeah the bot runs in a lambda with a timeout of 60s
a
I actually applied as partner, had the call, reading the agreement etc Ping me if you need help on langchain / vector dbs, been playing with this stuff for a while (also as day to day job)
75 Views