Skip to main content

Workflow

Directed Acyclic Graph (DAG)

Rill Flow is a set of process orchestration services based on DAG's topological sorting characteristics, automatically scheduling and executing tasks based on their dependencies.

Directed Acyclic Graph (DAG): In graph theory, a directed graph that cannot return to itsstarting point through several edges is a directed acyclic graph. From a computer perspective, DAG is a data structure used to describe a set of directed tasks with dependencies, where the direction indicates the execution order.

The following diagram depicts a DAG-based workflow:

DAG

(Figure 1: Example of a DAG-based process)

  1. Task A: Independent, can be executed immediately.
  2. Task B and Task F: Depend on Task A and can be executed in parallel after A is completed.
  3. 任务C:依赖于任务B。
  4. Task D and Task E: Depend on Task C and can be executed in parallel after C is completed.
  5. 任务G:依赖于任务F。
  6. Task H: Depends on Tasks E and G and is executed after both are completed.

Describing the Workflow

Rill Flow uses the YAML language to describe DAG diagrams and orchestrate processes. YAML is chosen because it is a human-readable data serialization language, designed to conveniently represent various data structures. For Rill Flow users, this means they can quickly orchestrate business processes through YAML files, even in the absence of a front-end interface. YAML is compatible with features of programming languages like Perl, C, XML, HTML, and works with most current programming languages.The reason for choosing Yaml as a process description language is that Yaml is a human readable data serialization language designed to facilitate the representation of various data structures.For Rill Flows, we hope that users can quickly organize business processes through Yaml files even without front-end displays.At the same time, Yaml is compatible with the features of various programming languages such as Perl, C, XML, HTML, etc. and can be used in most of the current programming languages.

YAML files use the .yml or .yaml extension and follow specific grammar rules.

The following is a simple YAML description of the DAG (Figure 1):

type: flow
dagName: sample_dag
tasks:
- name: A
next: B,F
category: function
- name: B
next: C
category: function
- name: C
next: D,E
category: function
- name: D
category: return
- name: E
next: H
category: function
- name: F
next: G
category: function
- name: G
next: F
category: function
- name: H
category: return

Submitting Workflow Definition

API

Refer to /flow/bg/manage/descriptor

Management UI

Next Steps

After completing the workflow definition, the workflow can be executed, creating a new instance for each execution. Rill Flow allocates necessary resources for each instance.Rill Flow will allocate the necessary running resources for each instance.

In a distributed deployment environment, each step of the workflow instance may run on different nodes. Upon completion, the system recycles the resources.When workflow cases are implemented, the related resources will be recovered.

More information on workflow implementation can be found in Submitting Workflows.

You can also learn about: