Tutorial 05: Create an Automation Pipeline

Introduction

This tutorial is is relevant for

Low-Code Developers who wants to learn how to create pipelines to streamline and automate the development, testing, deployment, and maintenance of applications within a low-code platform.

This tutorial is about

In this tutorial, you will learn how to create and execute such an automation pipeline script. To learn more about automation pipelines in detail, see this section of the documentation: Automation Pipeline and Commands.

You can have two main types of automation pipelines:

  • Ad-hoc automation pipeline: Doesn't need to be stored. The script is sent to the server, executed and then “forgotten”. Ad-hoc pipelines are good, for example, to execute an ad-hoc query, send ad-hoc messages, or to be called by client implementations.

  • Persisted automation pipeline: A pipeline script which is stored at server side in the property store under a unique key. The pipeline can be executed later by calling its unique key. This kind of pipeline is good to persist your execution logic, to create automation apps and to organize them into multiple pipelines.

Step 1: Execute an ad-hoc pipeline

  1. Login to the portal https://NAMESPACE.pipeforce.net

  2. Navigate to AUTOMATION → Playground

  3. Here you can write any ad-hoc pipeline and execute it by pushing the RUN button.

  4. You can write for example this hello world pipeline in the editor:

    pipeline: - log: message: "Hello World!"
  5. Execute it by pushing the RUN button.

  6. You should then see the result in the output window below:

    14.png

Now lets extend this automation pipeline a bit by sending a simple email using these steps:

  1. Start typing inside the playground editor after the dash - and you should see command suggestions like this:

    16.png

  2. Lets select the command mail.send from the list. Finish the line with a colon :, and then go to the next line and indent with two tabs [->|]. To see the list of available parameters for the command, press [CTRL] + [SPACE], and you should again see the auto-completion list like this:

  3. Lets select the parameter to from the list, and set your email address and a subject here as shown below:

  4. In your pipeline, you have now two commands:

    1. The first one log simply logs a message, while

    2. the second one mail.send sends an email.

  5. Note that each command

    1. is listed below pipeline:,

    2. is indented with one tab from the left,

    3. starts with a dash - followed by the command name.

    4. is finished with a colon :.

    5. can have optional parameters: You can specify them below the command after an additional indent using a tab.

    6. can exchange data with other commands. If you want to learn more about this, have a look here: Automation Pipeline and Commands.

  6. Now, let's execute this pipeline by pressing the RUN button.

  7. After a while, you should receive the email in your inbox.

  8. Since this is an ad-hoc pipeline, when you leave this playground view, your pipeline is gone. Therefore, you should persist (store) it if you later need it. We will see in the next section how to do this.

Step 2: Persist (save) a pipeline in the property store

Persisting a pipeline means “storing” a pipeline script at server side in the property store (Property Store (Document Database) ) under a unique key. From there you can then load and execute it later by using this unique key. Follow these steps to create such a persisted pipeline:

  1. Select AUTOMATION → Properties.

  2. In the property tree select the node of the app you’ve created in the last tutorial.

  3. Click the plus icon at the top of the tree.

  4. Click Pipeline.

  5. Then name your pipeline and click Create.

  6. You should now see an empty pipeline template.

  7. Replace the content of this editor by pasting your clipboard content here (Ctrl + V).

  8. Click SAVE.

  9. Congrats: Now, you have your first persisted pipeline. This pipeline has the unique key global/app/MY_APP/pipeline/mypipeline.

Step 3: Execute a persisted pipeline

After you have persisted an automation pipeline in the property store, you can execute it by calling it using its unique property key.

There are many different possibilities in PIPEFORCE to do so. In this step, you will learn how to do it using the command pipeline.run:

  1. Go to AUTOMATION → Playground

  2. Execute this pipeline:

    pipeline: - pipeline.run: path: global/app/MY_APP/pipeline/mypipeline
  3. In the parameter field path, copy the key of the pipeline you have created before, for example like this: global/app/MY_APP/pipeline/mypipeline

  4. Execute the command by clicking RUN.

  5. As a result, you should see the “Hello World” output and after a while you should have received the email in your inbox.

  6. So have used an ad-hoc pipeline to execute a persisted (stored) pipeline using its path.

Congratulations!