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

Add Webhook block #1531

Closed
baptisteArno opened this issue May 23, 2024 · 19 comments · Fixed by #1815
Closed

Add Webhook block #1531

baptisteArno opened this issue May 23, 2024 · 19 comments · Fixed by #1815
Assignees
Labels
Feature ✨ New product feature Fund

Comments

@baptisteArno
Copy link
Owner

baptisteArno commented May 23, 2024

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
Fund with Polar
@baptisteArno baptisteArno added the Feature ✨ New product feature label May 23, 2024
@wladiveras
Copy link

wladiveras commented May 23, 2024

wait condition wont work when you use a input collect.

way to reply:
use a collect variable input and put a wait after that, wait will be skipped.

@ahsmha
Copy link

ahsmha commented Sep 8, 2024

@baptisteArno is anyone working on this. if not can i take this up?

@vk-solutions-admin
Copy link

@baptisteArno This would be so useful! Would it be possible to fund this issue to speed up its development?

@laianeramos
Copy link

@vk-solutions-admin
Copy link

@laianeramos @baptisteArno Awesome, thank you for the flexibility!
I just funded the issue and will be available if you need any feedback about the feature.

@baptisteArno
Copy link
Owner Author

Thank you, can you tell us more exactly what is your use case so that I am sure we are talking about the same feature :)

@vk-solutions-admin
Copy link

vk-solutions-admin commented Sep 25, 2024

@baptisteArno Sure, here are some feature requirements to give you an idea of what I was thinking about :)

Wait for Webhook

Goal

Enhance the bot's interactivity and responsiveness to external events, especially for human-in-the-loop flows.

Description

Implement a "Wait for webhook" feature that allows the bot to pause the conversation flow until a specified webhook is called. The output from the webhook should be usable in subsequent steps.

Requirements

  1. [Must Have] Dynamic Webhook URL:

    • Users can input a variable "Webhook URL" to be dynamically assigned.
  2. [Must Have] Flow Pause:

    • The bot should pause the conversation until it receives a response from the specified webhook.
  3. [Must Have] Response Handling:

    • The output from the webhook should be parsed and made available for use in subsequent blocks.
  4. [Nice to Have] Error Handling:

    • Optionally include error handling for webhook failures or timeouts, allowing users to define fallback actions.
  5. [Nice to Have] Timeout Configuration:

    • Allow users to set a timeout duration for the webhook call, after which a predefined action can be executed.
  6. [Nice to Have] User Notifications:

    • Optionally notify users that the bot is waiting for an external process (e.g., "Please hold on while we process your request").
  7. [Nice to Have] Testing Mode:

    • Provide a testing mode for users to simulate webhook responses to validate flow behavior without actual calls.
  8. [Nice to Have] Documentation:

    • Supply comprehensive documentation on the implementation and configuration of the "Wait for webhook" feature, including example use cases.

@baptisteArno baptisteArno self-assigned this Sep 25, 2024
@baptisteArno
Copy link
Owner Author

I made good progress on that today, hopefully I will release a first version tomorrow 👌

@vk-solutions-admin
Copy link

Awesome news, thanks a lot!
Looking forward to testing it 🙌

baptisteArno added a commit that referenced this issue Oct 2, 2024
@baptisteArno baptisteArno changed the title Add webhook option to Wait block Add Webhook block Oct 3, 2024
@baptisteArno
Copy link
Owner Author

Figured a Wait block option would not be clear enough for new users so I decided to separate this logic in a new Logic block called "Webhook"

baptisteArno added a commit that referenced this issue Oct 7, 2024
@abdullahbaa5
Copy link
Contributor

Gonna deploy locally right away to try this out 👀

@baptisteArno
Copy link
Owner Author

@abdullahbaa5 For self-hosting, local testing here is the configuration of PartyKit to make it work: https://docs.typebot.io/self-hosting/configuration#partykit

@abdullahbaa5
Copy link
Contributor

Seems to work as expected, Great job!

Questions/suggestions:

  • Will there be a timeout implemented in the future? while having an ability to jump to a specific block in case of timeout, or some kind of failure handling
  • Webhooks are dynamic, hence to be able to save the data json as string in a variable which one can later programmatically create a flow for different webhook responses.

Currently typebot is a step-by-step flow app, which is understandable.
However, typebot is now one step away from standing out from topping all the other bot builders, and that is the possibility of running two processes at once, for example:
image

@vk-solutions-admin
Copy link

Hello @baptisteArno, thanks for the awesome work on the Webhook block!
I tested it on Typebot Cloud and it works perfectly.

However, I'm unable to figure out how to deploy it using Docker-Compose as I already used "bun deploy" locally to get a unique Partykit host from packages/partykit and added it to the .env of my self-hosted deployment, but I still can't see the Webhook block in the list of blocks.

Could you please provide guidance for it?

@baptisteArno
Copy link
Owner Author

Did you set this env variable https://docs.typebot.io/self-hosting/configuration#partykit?

@vk-solutions-admin
Copy link

Yes, I added it to the .env and referenced it in the Docker-Compose. The Docker image used for the builder is baptistearno/typebot-builder:latest

@baptisteArno
Copy link
Owner Author

That's odd, are you sure you restarted the container after updating the .env file?

@vk-solutions-admin
Copy link

Yes I restarted the container and asked my DevOps provider to try it also on their side, but they had the same result.
Maybe it's not yet published in the latest Docker Image on DockerHub for the self-hosted version.

@baptisteArno
Copy link
Owner Author

Oh right, I am sorry, it is not yet released. We are doing a monthly release for self-hosting so it will be available on 1st of November

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ New product feature Fund
Projects
Status: Deployed 🎉
Development

Successfully merging a pull request may close this issue.

6 participants