fractaledmind / acidic_job

Elegant, resilient, durable workflows for Rails apps
https://fractaledmind.github.io/acidic_job/
MIT License
492 stars 10 forks source link

Allow `for_each` step argument to accept a method name #81

Open fractaledmind opened 1 year ago

fractaledmind commented 1 year ago

Currently for_each can only provide the key name for a key present in the persisting hash. This means that steps can only iterate over data present before the workflow begins. We need to be able to allow a workflow to iterate over data generated within the workflow itself. Consider, for example, a workflow job that traverses and processes the paginated responses from an API endpoint. We can have a step method to process each page, but we would need an earlier step method to make the pagination API requests to feed the iteration.