Tutorial: Create and execute a pipeline
Estimated time: 20 min.
In this tutorial you will learn:
Prerequisites for this tutorial:
PIPEFORCE Enterprise 7.0 or higher
You have a valid PIPEFORCE Developer account
You have executed tutorial Tutorial: Create a new app
Introduction
A pipeline in PIPEFORCE is an easy to learn low code script which can do many different things for you:
Data conversion, validation and mapping
Connecting with external services
Business logic
Send and receive messages
Robotic Process Automation (RPA)
Regularly execute jobs
Trigger workflows
And many more…
It’s named “low code script”, because you are not required to do real coding inside such a pipeline script. You will mainly configure commands with parameters and combine them in a list. All commands in the list will then be executed one after another.
Because of its simplicity and power at the same time, the pipeline is one of the most important part in PIPEFORCE. In this tutorial, you will learn how to create and execute such a pipeline script. To learn more about pipelines and commands in detail, see this section of the documentation: Pipelines & Commands
1 - Executing an ad-hoc pipeline
You can have these two main types of pipelines:
Ad-hoc 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 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.
In this first part of the tutorial we gonna execute an ad-hoc pipeline. To do so, follow these steps:
Login to the portal https://NAMESPACE.pipeforce.net
Navigate to LOW CODE → Workbench
Now you should see the ad-hoc pipeline editor automatically opened for you. It looks similar to this:
Here you can scribble any ad-hoc pipeline and execute it by pushing the RUN button.
There is already a hello world demo pipeline prepared for you here.
Do not change this pipeline and execute it by pushing the RUN button. After this, you should see an output like this at the bottom:
Congrats, you have executed your first pipeline!
Next, lets create a more sophisticated pipeline by sending a simple email. To do so, start typing inside the editor after the dash
-
and you should see command suggestions like this:Lets select the command
mail.send
from the list, finish the line with a colon:
, go to 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:Lets select the parameter
to
from the list and set your email address here and asubject
as shown below:In your pipeline you have now two commands: The first one simply logs a message, the second one sends an email. Note that each command
is listed below
pipeline:
,is indented with one tab,
starts with a dash
-
followed by the command name.is finished with a colon
:
finally.can have optional parameters. In this case, you can specify them below the command after an additional indent using a tab.
can exchange data with other commands. If you want to learn more about this, have a look here: https://logabit.atlassian.net/wiki/spaces/DEVEX/pages/785088596.
Now lets execute this pipeline by pressing the RUN button.
After a while you should receive the email in your inbox.
Since this is an ad-hoc pipeline, in case you leave this view, your pipeline is gone. Therefore, you should persist (store) it if you later need it. At first copy this pipeline into your clipboard, then go on to the next part in this tutorial to learn how to persist it.
2 - Persisting a pipeline
Persisting a pipeline means “storing” a pipeline script at server side in the property store (https://logabit.atlassian.net/wiki/spaces/DEVEX/pages/988807265 ) under a unique key. From there you can then load and execute it later by this unique key. Follow these steps to create such a persisted pipeline:
Select LOW CODE → Workbench.
In the property tree select the node of the app you’ve created in the last tutorial.
Click the plus icon at the top of the tree.
The new property view opens:
As a property key use the value
global/app/MY_APP/pipeline/mypipeline
. ReplaceMY_APP
with the name of the app you created before, for examplemyapp24
. Do use only lower case letters and don’t use special characters or spaces!As mime type select
application/yaml; type=pipeline
. Do not selectapplication/json; type=pipeline
!
Click SAVE.
You should now see again the hello world pipeline in the editor.
Replace the content of this editor by pasting your clipboard content here (Ctrl + V).
Click again SAVE.
Congrats: Now you have your first persisted pipeline. This pipeline has the unique key
global/app/MY_APP/pipeline/mypipeline
.
3 - Executing a persisted pipeline
After you have persisted a pipeline 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.start
:
Select LOW CODE → Commands.
Search for the command
pipeline.start
and click it.Into the parameter field
key
copy the key of the pipeline you have created before, for example like this:Execute the command by clicking SUBMIT.
As a result you should see the “Hello World” output and after a while you should have received the email in your inbox.
Congrats, you have executed a persisted pipeline by its property key!
Tip: The online documentation of all available commands for your pipelines can be found at https://NAMESPACE.pipeforce.org/#/commands (replace NAMESPACE by your real namespace name) or you use the CLI:pi help command
Next tutorial: Tutorial: Release an app