question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get multiple workflow instances by id (IPersistenceProvider)

See original GitHub issue

Hi @danielgerlag

In the new release of the workflow-core engine you have added the elastic search engine for filtering against different workflow properties. As a result the GetWorkflowInstances(…) service method on the IPersistenceProvider has been obselated while the GetWorkflowInstance(…) still remains active. In my optionion it makes sense to move all the filtering logic over to elastic serach but I’m missing a method to get multiple workflow instances by id:

Task<IEnumerable<WorkflowInstance>> GetWorkflowInstances(string[] ids)

For example, if we have a set of cached or filtered workflow results or IDs, we have to iterate over GetWorkflowInstance(…) one by one to get the WorkflowInstance DTO. Iterating over all ids is not performant.

Is it possible to provide a service method to retrieve multiple instances by a set of IDs?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
knoxicommented, Mar 7, 2019

After discussing with @marc-mueller about this feature, I created a PR for it.

Because the persistence providers SQL Server, PostgreSQL and SQLite build on the EntityFramework percistence provider, only four persistence providers had to be adapted at all.

Unfortunately we have not the possibility to test and verify the functionality of the changed persistence providers DynamoDB (AWS) and Redis.

1reaction
marc-muellercommented, Mar 4, 2019

Hi @danielgerlag

I second Jan’s request. There are many scenario where we need to access multiple workflow instances as a batch. Often the business logic part contains a reference to a workflow instance and therefore there should be a way to retrieve multiple instances. Looping through a list and get an workflow instance at a time is not efficient.

Duplicating the data based on the lifetime events is in this case not a solution. Why would anyone duplicate the data and create a need to maintain every change in the workflow library in the duplicated data store just for being able to retrieve more than one instance at a time?

Is there a technical reason behind your suggestion for not allowing to query multiple instances by id from the persistence provider? To make that point clear, there is no requirement for any query logic or to be able to perform a search against the persistence provider. There is just a need to get multiple instance by ids at once.

Thanks! Marc

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the best way to count the number of workflow ...
You can create multiple executions for the same workflow type. The original question was about the workflow id. In your case, you should...
Read more >
Start multiple workflow instances by going through list entries
Hello,. I have a workflow which creates, updates list items, and goes through approval process. Once every week I need to schedule another ......
Read more >
NetSuite Applications Suite - Workflow Instance Search
Use a workflow instance search to get a list of workflow instances that completed or are currently in progress for a specific workflow...
Read more >
Multiple instances of the same workflow started
You can have multiple instances of versions of the same workflow. If you go to Worflow Settings on the list's ribbon, you will...
Read more >
Workflow Instance to multiple users accessing
1)is the workflow will generate different instance id to different users?. 2)how the data to be stored in variables at workflow. workflow- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found