I have a scenario where I would need a solid that ...
# announcements
d
I have a scenario where I would need a solid that acts as a webhook listener. Do y'all have any examples of existing solids that function in a similar way? Or is there a more appropriate path y'all would recommend?
a
Could you provide some more context? Does webhook listener mean spinning up a webserver and waiting for a post request?
d
yes
the context is that I need to interact with a REST API that can have jobs triggered via POST requests, but the status of said jobs can not be queried via GET requests. However, the jobs will send outgoing webhooks upon completion
a
cant think of any examples in that realm
d
yeah, me neither
a
that said theres really no constraints to what happens in a solid function - so you could theoretically spin up a webserver block until you get the request then proceed
d
yeah thats what I was considering doing. Seems kinda yuck but may need to do it
a
chance are getting a webserver up and accessible from the public internet is not very reasonable from in the context of executing a pipeline
d
Yep
a
I think I would recommend setting up something external for receiving the webhook - and have it do something simple like write to some persistent store (DB, fs, etc) then the solid can just poll against that
d
seems reasonable. thanks @alex!
a
@dwall You could use Lambda and a SQS queue or db. If each webhook event does not have an ID, I would assign a UUID when it is received so downstream can maintain idempotency.
d
@Andrew Madonna that's a good suggestion 👍