How do I add a workflow?

Workflow creation options

You have several options for adding workflows to NSP.

Note: Here are some things to know when setting up workflows.

Sample workflow

When you create a workflow, sample YAML is populated as shown below, providing a basic structure for a workflow. You can use the sample as a guide or delete it and enter or copy and paste your own YAML code.

version: '2.0'

 

changeWorkflowName:

  description: this is a sample workflow

  

  type: direct

  

  tags:

    - sample workflow

 

  input:

    - var1 : ''

 

  output:

    keyword: <% $.timeNow %>

 

  tasks:

    task1:

      action: std.js

      input:

        script: |

          function myFunction(){

          var a = new Date();

          var b = a.getTime();

          var c = 1000;

          var d = b - c;

          return String(d);

          }

          return myFunction();

      publish:

        timeNow: <% task().result %>

      on-success:

        - task2

 

    task2:

      action: std.javascript

      input:

        script: |

          function myFunction(){

          var a = new Date();

          var b = a.getTime();

          var c = 1000;

          var d = b - c;

          return String(d);

          }

          return myFunction();

      publish:

        timeNow: <% task().result %>