Code Monkey home page Code Monkey logo

go-workflows's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-workflows's Issues

Provide a source of randomness

Provide an API to access a PRNG that allows usage of "randomness". Perhaps record the seed of the PRNG and reuse this across, so that workflows remain deterministic despite using randomness.

Support activity retries & timeouts

  • Support basic retries with max attempts
  • Support exponential backoff with customization for activities
  • Extract backoff behavior and reuse for sub-workflows

Only store references to events/payloads for backends

SQL backends

Instead of duplicating events in the history and pending_events table, events should be stored in a single events table. history and pending_events should contain only references to the events.

Redis backend

  • Separate payloads into a separate hash?

Keep workflows in memory to allow continue without replay

Implement by adding a cache to the workflow worker that keeps workflow executors in memory for some time. Extend the executor to execute new tasks on top of an in-memory workflow state.

Add support to backends to try to deliver subsequent workflow tasks to the same worker instance.

Support canceling sub-workflows

Similar to timer cancellation, cancel sub-workflows when the context used to create them is canceled.

  • Implement and test
  • Update "Guide" in Readme

Support canceling workflows

We need to give workflow a chance to clean up

  • Pending activities will run to completion; new activities will be skipped
  • Cancel sub-workflows
  • Allow to create a detached context to run any cleanup

Experiment with go1.18 generics

See if generics can make the Future and Channel handling easier. Especially avoiding the interface{} types in the Get calls for serialization/deserialization.

Redis backend

  • Workflow instances queue

  • Lock workflow instances

  • Activity queue

  • Delayed (timer) events

  • [ ] Sticky session behavior postponed for now

Flaky tests

There are some flaky tests around sub-workflow cancellation propagation. We need to investigate and resolve those.

Support OpenTelemetry tracing

  • Allow passing a span to CreateWorkflowInstance
  • Persist the span with the instance
  • Restore and inject into context for the workflow execution
  • Wrap workflow execution
    • ๐Ÿค” Ignore replays?
  • Restore and make available for activity execution
  • Wrap activity execution
  • Signals
  • Cancellation

Timer cancellation does not remove scheduled future events

Currently timer cancellation follows a model similar to DTFx: for timers only Scheduled and Fired events are recorded. Timer cancellation is solely handled in the workflow state. That means when a timer is cancelled, it must have been because inputs for the workflow (inputs, signals etc.) lead to the timer cancellation. A cancelled timer is recorded in the state and when at a later point it still fires (because the backend wasn't notified about the cancellation), the Fired event is recorded in the history, but since the timer is already cancelled, nothing is done in the Executor.

This works, but ideally we would give the backend a chance to clean up the timer. This is also going to be more in-line with "Sub-Workflow Cancellation", which DTFx doesn't support at all.

Set expiration on all keys

  • Set expiration far in the future for all keys for pending workflow instances
  • Set expiration somewhat in the future for all keys for completed workflow instances

Keys:

  • history:<instance_id>
  • pending-events:<instance_id>
  • state:<instance_id>

Supports: #28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.