Search code examples
elsa-workflows

Insert Elsa WorkFlow's Information in Database table while Creating WorkFlow through Builder Api


When I create WorkFlow using Elsa Dashboard, the WorkFlow's information(Name, Description, Data, IsPublished, Persistance behaviour, version, finished at.....) is automatically inserted in These 3 Tables

  1. WorkflowDefinitions
  2. WorkflowInstances
  3. WorkflowExecutionLogRecords

But When I Create WorkFlow using Builder API, Workflow's information is not inserted. Nothing is inserted in any table

I want to insert & Store WorkFlow's info in Those 3 tables.

So is there any way to insert WorkFlow's Info in tables Or do I have to Manually Write code to Insert data in those 3 tables in Builder API?


Solution

  • As the name of these tables infer the WorkflowInstances are the instantiated workflows and the WorkflowExecutionLogRecords is the log for a flow execution. what you define by Builder API is the workflow blueprint or as it's called workflow definition so it's the only table that could be affected when saving a blueprint.

    But you usually don't need to persist your workflow defined by Builder API in the DB, cause if you have it in your code it's somehow persisted and is part of your code.

    I guess getting to know workflow providers can put you in the right direction, you can find out about them in this article.