elsa-guides icon indicating copy to clipboard operation
elsa-guides copied to clipboard

RFC: Polling workflow

Open martinhjulstrom opened this issue 3 years ago • 0 comments

I was investigating the a problem and couldn't find it in the guides so I came up with this solution and thought that it could be a topic under guides. But before writing the text I wanted to make sure that you think that it is an OK solution and that it would be a suitable topic for a guide?

The problem that I had was roughly this:

  • First I make a call to an external service
  • Then I have to poll that service every x hours and wait for a specific response. If I get the response I should proceed with the workflow.
  • The workflow should also abort the poll on some events.

The solution uses a fork, one branch waits for the aborts and one makes the polls. The activity that makes the polls will reschedule itself if it dosn't get the result that it wants. In this example I make a call to an free random number api and waits for the number 5.

The guide would touch on these subjects:

  • Programatically creating workflows
  • Forks and joins
  • Resume workflows
  • Custom activities that reschedule itself.

What do you think should would it be an OK topic for a guide?

martinhjulstrom avatar Dec 31 '21 13:12 martinhjulstrom