Workflows

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 node, validate connectivity in a virtual network, 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. EDA uses CRDs to define the schema for the workflow input and output. EDA applications manifest tagged the workflow Boolean and include the relevant workflow to associate the CRD with the container image

EDA supports interactions with workflows through the following means:

  • Through the EDA UI.
    • The Workflows button allows you to interact with workflows from anywhere in the UI.
    • Workflow Definitions List and Workflows Executions pages allow you to view and manage workflow definition lists and executed workflows.
    • From target resources, you can create and run workflows from the row actions menu.
  • Through the API.
  • Through the edactl command.
  • Through Kubernetes: creating a resource whose CRD is marked as a workflow.

FlowEngine

In EDA, workflows are supported through the FlowEngine - the controller behind the instantiation, status, and interaction with workflows.

On creating a new workflow, the FlowEngine:
  • Validates the resources input against schema.
  • Publishes a Kubernetes Job resource, which runs a container image provided in the corresponding WorkflowDefinition.
  • Assigns a Flow ID to the workflow.
  • Updates the status of the flow based on gRPC interactions.

Flow IDs are incremental. In the event of FlowEngine restart, previously executed or currently running flows are lost and a new Flow ID restarts at 1.

FlowEngine supports the following:

  • Loading of new workflow definitions via EDA apps.
  • Manual triggering of workflows.
  • Reporting the status of executed workflows.
  • General user interactions with workflows - the ability to block a flow and wait for user input.
  • Workflow hierarchy - one workflow may be a parent of another.
  • Automatic creation of workflow IDs.
  • Artifacts - a workflow may return artifacts, such as tech support files, to the FlowEngine.
  • Non-blocking behavior; up to 256 workflows can be executing at the same time.
    Note: To avoid excessive memory use by FlowEngine, EDA enforces the following:
    • Only 256 parent workflows are persisted.
    • New workflows push out old workflows.
    • There is a limit of 256 concurrently running workflows. New workflows are rejected if the system has reached this limit; actively running workflows are never dropped.
    • This history includes stages and logs.

      This history persists for the lifetime of FlowEngine. It does not persist and does not remain after a restart.

Workflow Definition List page

The Workflow Definition List page shows all available workflow definitions provided from EDA apps. To navigate to the Workflow Definition List page, go to the Main > Systems menu in the EDA UI and from the drop-down list, select Workflow Definition List.

Figure 1. Workflow Definition List page
The default worfklow definitions shipped with the EDA apps are shown below.
Table 1. Workflow definitions
Workflow definition Purpose
ISL Ping Used to ping inter-switch links (ISLs) to verify connectivity within a fabric. You can specify a list of fabrics, ISLs, or selectors for both to match ISLs. This workflow shows the results of the pings, including the status of each ISL.
App Installer Used to install or delete apps.
Check interfaces Used to check the state and status of the matched notes. Use interface selectors
Route Lookup Used to look up routes on a set of nodes. The output shows the matching route and the set of ingress interfaces used to reach it.
Attachment Lookup Used to look up attachments (where an address is attached in the network) on a set of nodes. The output shows the matching attachments, including the node, network instance, prefix, interface, and next hop group ID.
Ping Used to initiate a ping to an address on a node or a set of nodes
Edge Ping Used to initiate a ping to an edge interface resource; specify a gateway or edge mesh.
Tech Support Used to generate technical support packages for a node or set of nodes; typically used for debugging.
Image Used to upgrade or downgrade software images on specified targets. This workflow can be used directly on a target or list of targets, or with selectors to select targets through labels. It also supports tranches, which are groups of targets that can be upgraded together. By default, the system runs a set of checks before and after the image change; you can upgrade this behavior by setting the Checks field.

This workflow also supports canary nodes, which are used to test images before a broader roll out. Canary nodes are upgraded before any other targets. To identify the canary nodes, use node selectors that match labels on TopoNode resources, including those in the list of nodes to be imaged.

Push Environment

Used to set up the global environment on a node. For SR Linux, this results in an overwrite of the /etc/opt/srlinux/env file.

Push CLI Plugin Used to push a CLI plug-in to a node.

For SR Linux, the plug-in that you specify must include the .py extension, without leading slashes, for example, "myplugin.py".

Check BGP Checks the state and status of the BGP peers that match the selection criteria.
Workflow A generic workflow definition. This workflow is used by some workflows to create subflows without a predefined schema.

Workflow Executions page

In the EDA UI, from the Main > Systems > Workflow menu, the Workflow Executions page shows all the workflows that have been executed.

​​Any workflow waiting for user input is highlighted in yellow.

Figure 2. The Workflow Executions page
From Workflow Executions view, you can:
  • provide additional input for a workflow, if required
  • create and run a new workflow
  • cancel a running workflow
  • display the Summary page for a workflow

    Click the Table row actions menu for a workflow and select Details to display the Summary page for the workflow.

Displaying subflows

By default, only top-level workflows are displayed. To display subflows, click the Table settings & actions icon and select Show Subflows.
Figure 3. Subflows
Figure 4. Workflow executions with subflows

Workflow Summary page

The Summary page provides details about a workflow execution.
Figure 5. Workflow Summary page
The Workflow Summary panel provides the status of the workflow, name, namespace, category, and type of workflow.
  • Status of the workflow, which can be one of the following:
    • Waiting to start

    • Running

    • Completed

    • Failed

    • Terminated

    • Waiting for input

  • Stages of the workflow.

    The Workflow Stages panel shows the progress of workflow and the status of the workflow as it passes through the stages.

  • The Workflows Results panel provides details of the workflow results, including the specification (input) and status (output) of the workflow that was executed.

Workflow logs

The Workflow Logs view display logs from the workflow container. From the Summary drop-down list, select Workflow Logs. The logs are used for troubleshooting and debugging purposes.

Figure 6. Sample workflow log

Workflow creation

Running a workflow from the Workflow Definition List page

You can run a workflow by creating another instance of that kind of workflow and running it.
  1. Select the workflow definition that you want to run by double-clicking it or selecting Run from the Table row actions icon.
  2. In the form that displays, fill in the values for the workflow.
    The contents of the form vary depending on the workflow definition selected. The EDA UI auto-generates a unique name for the workflow execution. You can override this name with a custom name.
  3. Click Run.

Running a workflow from the Workflow Executions page

From the Main > Systems > Workflows menu, select Workflows Executions from the drop-down list.
  1. Click Create.
  2. Select the workflow definition that you want to run.
  3. In the form that opens, enter the specifications for the workflow and click Run.
    The contents of the form vary depending on the workflow definition selected.

    The EDA UI auto-generates a unique name for the workflow execution. You can override this name with a custom name.

Triggering a workflow from the resource action menu

You can run a workflow from the row action menu of target resources.

Workflow definitions may define particular types of resources as 'subjects'. These workflows are listed in the action menu of the relevant resources.

For example, the Ping workflow accepts a node as subject and can be triggered from the node action menu:

Figure 7. Workflow options
  1. From the Main > Nodes > Resources view, click the Table row actions icon to display the workflow definition options.
  2. Select Ping.
  3. In the form that opens, the selected node is pre-populated in the relevant field. Fill the remaining specifications for the workflow, such as the destination address.
    The contents of the form vary depending on the workflow definition selected.
  4. Click Run.

Managing workflows with edactl

You can use the edactl command to provide input so a workflow can proceed or to query EDA about workflows.

Providing input to workflows

Some workflows may require user input to allow the workflow to proceed. You can use the following commands to handle workflows that require user input:

  • To find workflows awaiting input, use the following command and look for status 'WAITING_FOR_INPUT':
    edactl workflow get -A -a
  • To acknowledge a workflow and allow it to continue, use the following command:
    edactl workflow ack <id>
    For example, to acknowledge the workflow whose ID is 10:
    edactl workflow ack 10
  • To terminate a workflow, use the following command:
    edactl workflow nack <id>
    For example, to terminate the workflow whose ID is 20:
    edactl workflow nack 20

Querying EDA

Use the following edactl commands to query EDA about workflows:

  • To view all workflows, use the following command:
    edactl workflow get -A
    For example:
    edactl workflow get -A
    ID NAMESPACE NAME TYPE STATUS 
    1 eda-system bulkapps-eda.nokia.com app-installer COMPLETED 
    2 eda-system bulkapps-eda.nokia.com app-installer FAILED
  • To view details of a specific workflow, use the following command:
    edactl workflow get <id>
    For example:
    edactl workflow get 1 
    ID: 1 
    Namespace: eda-system 
    Name: bulkapps-eda.nokia.com 
    Status: COMPLETED 
    Workflow Steps: 
    ↓ init 
    ↓ Fetching 
    ↓ Verifying 
    ↓ Committing 
    ↓ Applying 
    ↓ Installed
  • To view logs for a workflow, use the following command:
    edactl workflow logs <id>

    For example: edactl workflow logs 20

  • To list files associated with a specific workflow, use the following command:
    edactl workflow artifacts <id>
    For example:
    edactl workflow artifacts 2
    Artifacts available for the workflow:
          tech-support-20250207_050610-mv1nd01-spine-1.zip
    root in on eda-toolbox-6f6c686487-xdks4 /eda
  • To download all files associated with the workflow in present working directory, use the following command:
    edactl workflow artifacts <id> download
    For example:
    edactl workflow artifacts 2 download
    Downloading artifacts to: /eda
  • To download all the files associated with the workflow in the /tmp/ directory, use the following command:
    edactl workflow artifacts <id> download --to /tmp/
    For example:
    edactl workflow artifacts 2 download --to /tmp/
    Downloading artifacts to: /tmp
    tech-support-20250207_050610-mv1nd01-spine-1.zip 100% [===============] (5.9/5.9 MB, 98 MB/s)  
    
  • To download a single file associated with the workflow in the /tmp/ directory, use the following commands:
    edactl workflow artifacts <id> download --to /tmp/ --from <file name>
    or
    edactl workflow artifacts 2 download –from <file name>
    For example:
    edactl workflow artifacts 2 download --from tech-support-20250207_050610-mv1nd01-spine-1.zip --to /tmp/ Downloading artifacts to: /tmp tech-support-20250207_050610-mv1nd01-spine-1.zip 100% [===============] (5.9/5.9 MB, 104 MB/s) root in on eda-toolbox-6f6c686487-xdks4 /eda