Hi Team
I would like to have a workflow where i write a certain data to temporal and then i have to write this data to a table in my local db. How can i do it through temporal, through another activity or some other way?
My use case is that i have a table A and i have some data, i use defineSignal to set the data in temporal but i also need to write this data to the table A. How is it possible using temporal and if so are there any examples in typescript where this has been done?
My understanding right now is that i will have to write a raw postgres query to add it to the table. Please tell me if there is any other way to approach this?
Your db writes should be done through activity.
You could add these db write activities in your workflow code (signal handler it seems in your case if the data to write is delivered via signal payload) or could use interceptors to intercept delivered signals as well.
Thank you for the response tihomir,
So would i just need to inject my repository into the activity like what i would do with my service in a normal typescript call or would i need to write raw queries of the db write in the activity code?