guide for using Ash.Flow and multi step user flow with retries.

Hi Jack. Thanks for the good work you have put so far.
I was looking at Ash.Flow and the step DSL feels what i Might need. Here is the Use case in detail: A student submits his solution (let's call it submission) on a portal. The administrator / staff then assigns that to a teacher. The teacher evaluates the submission and submits back to the portal. Staff approves of the evaluation submitted by teacher. Student can then see the evaluated submission. At any time, staff can cancel the submission assigned to the teacher. Staff can then re-assign it to any other teacher. If any teacher does not evaluate the submission for 3 days, staff is notified. Teacher can refuse to evaluate the assigned submission. This Flow can span several days. 1. Is Ash.Flow a good use case for this? In short, i need steps that are more like a gen state machine. I could sketch a rough diagram if that helps.
5 Replies
ZachDaniel
ZachDaniel3y ago
Ash.Flow is not currently a good use case for this. A flow is more like a “saga” that runs its steps as fast as it can. At some point I’d like to implement a storage engine for Ash.Flow that would allow it to behave the way you looking for (a step could be marked as waiting, and once all steps are done or waiting the flow would store its result and wait to be triggered again).
barnabasj
barnabasj3y ago
You can halt the flow after certain steps and get the complete data structure back that is needed to resume the flow right? If so could you just dump the datastructure somewhere and load it back in to resume the flow? That would mean some manual work, but we thought about this in the past, just wondering if it would be possible.
ZachDaniel
ZachDaniel3y ago
Yeah, you can do that 🙂 but it would take some elbow grease to get right
abeeshake456
abeeshake456OP3y ago
I see. Thanks for the input. Are there elixir libraries that can help with this ?
ZachDaniel
ZachDaniel3y ago
Something like Oban could help with job persistence potentially But otherwise im not sure

Did you find this page helpful?