https://dagster.io/ logo
#announcements
Title
# announcements
d

dwall

10/08/2019, 4:46 PM
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

alex

10/08/2019, 4:55 PM
Could you provide some more context? Does webhook listener mean spinning up a webserver and waiting for a post request?
d

dwall

10/08/2019, 4:56 PM
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

alex

10/08/2019, 4:58 PM
cant think of any examples in that realm
d

dwall

10/08/2019, 4:58 PM
yeah, me neither
a

alex

10/08/2019, 4:59 PM
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

dwall

10/08/2019, 4:59 PM
yeah thats what I was considering doing. Seems kinda yuck but may need to do it
a

alex

10/08/2019, 4:59 PM
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

dwall

10/08/2019, 5:00 PM
Yep
a

alex

10/08/2019, 5:00 PM
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

dwall

10/08/2019, 5:01 PM
seems reasonable. thanks @alex!
a

Andrew Madonna

10/08/2019, 5:39 PM
@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

dwall

10/08/2019, 5:42 PM
@Andrew Madonna that's a good suggestion 👍