Workflows is built on top of Ray, and offers a mostly consistent subset of its API while providing durability. This section highlights some of the differences:
`func.remote` vs `func.step`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With Ray tasks, ``func.remote`` will submit a remote task to run. In Ray workflows, ``func.step`` is used to create a ``Workflow`` object. Execution of the workflow is deferred until ``.run(workflow_id="id")`` or ``.run_async(workflow_id="id")`` is called on the ``Workflow``. Specifying the workflow id allows for resuming of the workflow by its id in case of cluster failure.
`Actor.remote` vs `Actor.get_or_create`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With Ray actors, ``Actor.remote`` will submit an actor creation task and create an actor process in the cluster. In Ray workflows, virtual actors are created by ``Actor.get_or_create``. The actor state is tracked as a dynamic workflow (durably logged) instead of in a running process. This means that the actor uses no resources when inactive, and can be used even after cluster restarts.
`actor.func.remote` vs `actor.func.run`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With Ray actors, ``actor.func.remote`` will submit a remote task to run which is similar as ``func.remote``. On the other hand ``actor.func.run`` on a virtual actor will read the actor state from storage, execute a step, and then write the new state back to storage. If the ``actor.func`` is decorated with ``workflow.virtual_actor.readonly``, its result will not be logged.
Other Workflow Engines
----------------------
Note: these comparisons are inspired by the `Serverless workflows comparisons repo <https://github.com/serverlessworkflow/specification/tree/main/comparisons>`__.
Argo API Comparison
~~~~~~~~~~~~~~~~~~~
The original source of these comparisons can be `found here <https://github.com/serverlessworkflow/specification/blob/main/comparisons/comparison-argo.md>`__.
The original source of these comparisons can be `found here <https://github.com/serverlessworkflow/specification/blob/main/comparisons/comparison-cadence.md>`__.
The original source of these comparisons can be `found here <https://github.com/serverlessworkflow/specification/blob/main/comparisons/comparison-google-cloud-workflows.md>`__.