How to persist workflows into storage? #473
Replies: 7 comments
-
The reason was we put complex object as variable into |
Beta Was this translation helpful? Give feedback.
-
And next is question how to track such silent exceptions? |
Beta Was this translation helpful? Give feedback.
-
@denis-ivanov You shouldn't have to do anything specific for workflows to be persisted, so it might be a bug. I haven't been able to reproduce this with Sqlite, but I'll try with PostgreSQL as well. |
Beta Was this translation helpful? Give feedback.
-
@ZlobnyiSerg Can you explain why storing objects in With regard to your question, there's currently no means to that end in Elsa 1, but in Elsa 2 there's a thing called a Workflow Context, which can store a complex object at runtime but that isn't persisted as part of the workflow, while at the same time, it is automatically loaded from and optionally persisted to your own data store by means of a custom workflow context provider. Every activity has access to this object, offering the best of both worlds: access to a complex object (provided using your own provider implementation for a given workflow context type) that is automatically loaded (with a configurable "fidelity", allowing the object to loaded once before a run-through of activities until the workflow finishes or gets suspended, or before every activity, in case of applications where the object might change often and you want to ensure to always have the latest version in memory). |
Beta Was this translation helpful? Give feedback.
-
@sfmskywalker I meant that this is very serious bug if workflow does not persists state in database and fails silently. |
Beta Was this translation helpful? Give feedback.
-
Ah, yes that would be bad indeed. However, there should be an exception handler surrounding workflow execution, putting the workflow instance into the Faulted state. If this is not the case, might I ask you for repro steps? |
Beta Was this translation helpful? Give feedback.
-
By the way, instead of storing values into the |
Beta Was this translation helpful? Give feedback.
-
Hello!
In my production project I want to persist workflows into PostgreSQL. In Startup I have the following Elsa configuration
When I start workflow, in WorkflowExectionContext I can see blocking activities, but all tables in the PostgreSQL are empty.
According to README
I thought that workflows are stored automatically, but it doesn't happen.
And my question is: is it bug or I have to do something special?
Beta Was this translation helpful? Give feedback.
All reactions