Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook block not listening to events when Typebot out of focus #1950

Open
vica-admin opened this issue Jan 9, 2025 · 9 comments
Open

Webhook block not listening to events when Typebot out of focus #1950

vica-admin opened this issue Jan 9, 2025 · 9 comments

Comments

@vica-admin
Copy link

vica-admin commented Jan 9, 2025

Hi @baptisteArno,

We’ve been testing the Webhook block extensively, and it works great as long as the Typebot window is in focus.

However, we noticed an issue when switching browser windows during the webhook listening phase. If we switch away and then back, it doesn’t seem to pick up the event sent by the third-party system to continue the flow.

For example:

  • When Typebot is in focus, the "Commencer" button shows up correctly:
    Screenshot
  • If we switch browser windows while it’s waiting, the event doesn’t trigger the button to appear, even though it’s sent correctly:
    Screenshot

Please let us know if this issue can be fixed, and we're ready to fund the fix since this is currently affecting heavily our use case.

Originally posted by @vica-admin in #1531 (comment)

@vica-admin vica-admin changed the title Hi @baptisteArno, Webhook block not listening to events when Typebot out of focus Jan 9, 2025
@baptisteArno baptisteArno added the Bug 🐛 Something isn't working label Jan 10, 2025
@github-project-automation github-project-automation bot moved this to Backlog ☁️ in Typebot Jan 10, 2025
@baptisteArno baptisteArno moved this from Backlog ☁️ to In progress ✍️ in Typebot Jan 24, 2025
@baptisteArno
Copy link
Owner

I unfortunately can't reproduce. It works just fine on my end! Even when the window is not focused.

Can you record a video?

@baptisteArno baptisteArno removed the Bug 🐛 Something isn't working label Jan 24, 2025
@baptisteArno baptisteArno removed this from Typebot Jan 24, 2025
@vica-admin
Copy link
Author

Hello @baptisteArno, please find attached the video showing the issue.

When staying on the same tab, the flow listens to the webhook and gets the response correctly.
But when switching tabs in the middle, the flow seems to stop listening to the webhook, even when the response gets sent correctly the exact same way.

It doesn't only happen at the step shown in the video, but at every step after multiple tries.

This part of the flow in Typebot shows the webhook block:
Image

And this is the end when it resumes the job in Windmill and jumps back to the webhook block:
Image

chrome_WlaF5fhZP6.mp4

@baptisteArno
Copy link
Owner

baptisteArno commented Jan 28, 2025

Ok can you provide a basic reproduction?

A simple bot that reproduces the issue

@vica-admin
Copy link
Author

@baptisteArno I created a simple Typebot with its associated n8n workflow to reproduce the issue consistently.

In order for you to test it, you need to follow these steps:

  • Import "typebot-webhook-issue.json" in Typebot
  • Import "n8n-webhook-issue.json" in n8n
  • Copy the "Production URL" from the webhook trigger in n8n and paste it as the URL for the HTTP request in Typebot
  • Copy the "Production URL" from the webhook block in Typebot and replace the placeholders in both "Bubble - Text" and "Input - Buttons" URL fields
  • Copy the API token generated in Typebot and replace the placeholder in both "Bubble - Text" and "Input - Buttons" header values
  • Activate the workflow in n8n
  • Publish the Typebot and open its link
  • See how it's working when staying on the tab
  • Refresh the page and try switching tabs between the first and second webhook blocks to see how it doesn't work (see video)
chrome_alGXiiStAV.mp4

typebot-webhook-issue.json

n8n-webhook-issue.json

@baptisteArno
Copy link
Owner

Perfect, thank you. Testing now

@baptisteArno
Copy link
Owner

I'm curious, can you reproduce the bug with this even simpler reproduction?

typebot-export-webhook-issue-x1nfrb7.json

@vica-admin
Copy link
Author

Thanks for testing it!
I can't reproduce the issue with this example, so maybe the issue is related specifically to using multiple webhook blocks after one another like in my example where it's a loop.

@baptisteArno
Copy link
Owner

Can you find a way to reproduce that does not involve n8n?

@vica-admin
Copy link
Author

Yes, the issue I got initially was when using Windmill with its suspend/approval step, which is the equivalent of the "Wait" to resume in n8n:
https://www.windmill.dev/docs/flows/flow_approval

It works perfectly when on the same tab (as showcased in the previous videos), but not when switching tabs in the middle.

The goal is to use it a bit like Slackbot where you can wait for the next step in Typebot using the Webhook block to come from the automation platform since the flow has long-running tasks and needs for code like Python or SQL for specific tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants