Webhooks and timers implementation

I wanted to achieve the feature that webhooks do, that is my web app does not need to poll the database every 30 seconds to "know" whenever there is a new shopping cart payment made.

I checked the forum (https://www.outsystems.com/forums/discussion/26091/how-to-setup-webhooks-in-outsystems/) as well as forge component (https://www.outsystems.com/forge/component-overview/5249/webhooks-producer), for help but I am still lost as to how to implement webhook.


So I thought if i can achieve "webhook" functionality by doing it this way?

1) When users submit payments, a timer is activated through a GET API each time.

2) After 5 seconds, the timer runs and it will call another GET API to inform the admin that a new payment has been made.

Are my thoughts workable to achieve a webhook without having my admin page to keep polling non-stop?

Are all these calls part of your app, or is some piece of it external? 

When you refer to polling the database, is that the database used by your app within the OutSystems platform, or an external database. 

A bit more info on your overall architecture would help clarify your intent, and make it easier to answer your question.

Yes, all these are part of my app (or at least I intend to create them).

The database is used by my app within Outsystems platform.

What else shall I provide so as to facilitate the understanding?

If everything is contained within your app, I'd consider using a BPT process (processes tab in Service Studio), rather than a webhook.

One of the ways you can kick off a process is on the creation of a new record for a given entity. So no polling required, just a process that starts when the record is added, and can perform notifications by email, text, etc.

There's a master class on BPT that would probably be helpful in understanding where this fits in your application:

https://www.outsystems.com/learn/courses/17/master-class-on-modeling-business-processes-bpt/

And just because you make this a business process now, doesn't mean you can't expose it outside your app later if you choose. You can kick off a business process from an exposed REST endpoint also.

Hi,

Recently we implemented something similar to your scenario by using Firebase.

With this component, you can send a trigger with an Outsystems action that will "land" in a web block of your choice. 

It's available in the forge and it's pretty simple to set it up. Link here.