Workflows and workflow definitions

A workflow is a sequence of steps required to perform some process.

The concept of a workflow is typically used in automation platforms to make an operational task reproducible; it is the logic or code required to execute the task. It is not too much of an extrapolation from the concept of a workflow to a CI/CD pipeline, which describes a sequence of actions to run, with workflow semantics between them.

In EDA, workflows can define the steps required to upgrade a TopoNode, validate connectivity in a VirtualNetwork, or perform a simple ping operation.

A workflow in EDA is implemented via an orchestrated Kubernetes Job. Workflows themselves are container images that take some input, perform some work, and provide some output.

Before running any workflows, the relevant Workflow Definitions must be loaded into the system.

Workflow definitions

A WorkflowDefinition in EDA binds together two things:
  • a container image whose entrypoint executes a workflow
  • a name in the system
A workflow definition also allows its creator to define the input of the workflow, and its output.

A workflow definition can include the following fields:

  • The usual metadata, including:
    • Name
    • Labels
    • Annotations
  • image: indicates a path to an image to use when executing this workflow.
  • imagePullSecrets: the secrets required to pull the image for this workflow
  • jsonSchemaSpec: a full JSON schema defining the input the workflow accepts.
  • jsonSchemaStatus: a full JSON schema defining the output this workflow populates.

In EDA, both workflow and CI/CD functionality are supported through the WorkflowEngine; the controller behind the instantiation, status, and interaction with the Workflow and WorkflowDefinition resources.

Sample workflow definitions

Environment CLI plugin workflow definition

apiVersion: core.eda.nokia.com/v1
kind: WorkflowDefinition
metadata:
  labels:
    eda.nokia.com/source: derived
  name: environment-cliplugin
  annotations: {}
spec:
  image: >-
    <registry>/sr/eda/scripts/workflow-environment-cliplugin:1.0.0
  imagePullSecrets:
    - <secrets>
  flowDefinitionSchema:
    jsonSchemaSpec: ''
    jsonSchemaStatus: ''
status: {}

Services Edge Ping workflow definition

apiVersion: core.eda.nokia.com/v1
kind: WorkflowDefinition
metadata:
  labels:
    eda.nokia.com/source: derived
  name: services-edgeping
  annotations: {}
spec:
  image: >-
    <registry>/sr/eda/scripts/workflow-services-edgeping:1.0.0
  imagePullSecrets:
    - <secrets>
  flowDefinitionSchema:
    jsonSchemaSpec: ''
    jsonSchemaStatus: ''
status: {}

The workflow definitions page

The Workflow Definitions page in the EDA GUI allows you to view, delete, and sometimes edit and duplicate those workflow definitions that are known to EDA.
Note: For workflow definitions that are installed (and owned) by apps, only the View configuration and Delete actions are available. Duplicating and editing these workflow definitions is not permitted.

On this page you can also create new workflow definitions. Workflow definitions are a normal EDA resource and are defined by a Custom Resource Definition component of a Manifest, whose creation or modification you commit or add to a larger transaction like any other EDA resource.

Figure 1. The workflow definitions page
Table 1. Elements of the Workflows page
# Name Function
1 Workflow definitions list A list of workflow definitions known to EDA.

Some of these workflow definitions may be created by users. Other, indicated by a lock icon, were added to EDA when specific applications were installed.

2 Actions menu Displayed when clicking on the More icon at the right edge of the row for an individual workflow definition.
Available actions are:
  • Configuration view: opens the workflow definition view, displaying details of its metadata, specification, schema, and status. The view is read-only.
  • Edit: like Configuration view, this opens the workflow definition view, but the configuration can be modified and any changes committed. This option is not available for workflow definitions owned by individual EDA applications.
  • Duplicate: allows you to save a copy of the selected workflow definition with a new name. This option is not available for workflow definitions owned by individual EDA applications.
  • Delete: Deletes the selected workflow definition, after confirmation.
Information panel When expanded, the information panel displays details about the selected workflow definition.
Create button Click to open the Definitions page to create and commit a new workflow definition.