Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Workflow #63

Open
sroussey opened this issue Mar 1, 2025 · 0 comments
Open

Update Workflow #63

sroussey opened this issue Mar 1, 2025 · 0 comments

Comments

@sroussey
Copy link
Owner

sroussey commented Mar 1, 2025

const workflow = new Workflow()
  .add(new FetchData())
  .map([new TransformData(), new BackupData()]) // Runs both in parallel
  .reduce(new SaveToDatabase()); // Merges both outputs

await workflow.run();

If I did this, could get away from always using ArrayTask, and only using it for reduce().

reduce strategies:

  • array: assumes inputs and outputs are the same, and will turn them into arrays
  • object_by_id: create an object where the id is the key
  • object_by_type: create an object where the key is the task type (create arrays if duplicate task types or error?)
  • entries_by_id: return an array [id, results],[id2, results]
  • entries_by_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant