Repository navigation
In webhooks, how do we handle different endpoints based on different event types? #6238
Replies: 2 comments
|
I am still new to Elsa but my understanding is that you write your own Task Handler which Elsa Server will call for that task event type. So you will need to have a different endpoint for the second Event Type and so on. |
|
The configured endpoint routing is based on the event type that Elsa publishes. For the built-in Run Task notification, that type is fixed: the handler emits For another event type, use a separate/custom notification handler that publishes the desired event type and configure the corresponding endpoint for it. The external application can then handle that endpoint independently, as in the external-app integration guide. The current implementation still constructs Closing this as answered. |
Uh oh!
There was an error while loading. Please reload this page.
Hello @sfmskywalker , I have multiple EventTypes, each corresponding to multiple Endpoint addresses. I know how to configure them in JSON.
{ "Webhooks": { "Endpoints": [ { "EventTypes": ["RunTask"], "Url": "https://localhost:5002/api/webhooks/run-task" }, { "EventTypes": ["AnotherTask"], "Url": "https://localhost:5002/api/webhooks/another-task" } // Add more webhook endpoints as needed ] } }However, I've found that in the RunTaskHandler, only the EventType of "RunTask" can be executed, as shown in the figure.
I'm wondering if you have any suggestions for my scenario? Do I need to write a custom RunTaskHandler? Can we add an additional EventType parameter to RunTask? The default value could be RunTask. Looking forward to your reply.
Best Regards
All reactions