Running "side effects" in flow / return early to (windmill) App
I'm having a use case that I think is not normal maybe, but not unheard of at least. But I'm not sure how to model it in windmill.
I have a (windmill) app that runs a flow, the flow inserts into a database, and then it notifies about this a couple of places (slack, email).
What I would like to achieve is to return a result o the user after I have inserted into the database, and then let the flow do slack and email afterwards.
so the user do not need to wait on this result. The only way I see doing this now, would be to call another flow from the HTTP endpoint... but that feels a bit hacky since I now can't see the relation between the flows.
is it a better way of modelling this I do not see?
6 Replies
which user do you mean? the one that uses the windmill ui?
Yes, the user that uses the windmill app. Would like that to get back a response before a flow is finished or some other way defer some actions to after a response is given to the user
I believe one workaround is to use the logs, using this API
https://app.windmill.dev/openapi.html#/operations/getJobUpdates
. Unfortunately, I was no able to create a small PoC here using a Flow (may be we have to use the job_id
from each individual step to get the logs?).@Sindre -- use early return. It's designed to do exactly that:
https://www.windmill.dev/docs/flows/early_return
Early return | Windmill
It is possible to define a node at which the flow will return at for sync endpoints. The rest of the flow will continue asynchronously.
thought this was today, then realised it's not 11th oct until tomorrow... THEN realised its not 2023 any more 😄
😂