Skip to main content

Creating a simple Automation: Hello World

This tutorial shows you how to create a simple Automation that prints Hello World in Bash and Python, using references from input parameters and references from previous Steps.

Prerequisites

  • A Blink account. Sign up here.

Overview

This section shows you how to:

  1. Create a new Pack.
  2. Create a new Automation.
  3. Create a Step to print Hello World
  4. Update a Step to print Hello World using input parameters.
  5. Create a Step to print Hello World using Python, input and reference parameters.

Creating a new Pack

A Pack is a collection of Automations. If you already have a Pack you can open it and skip ahead to creating a new Automation.
If you don't have an existing pack, follow these steps:

  1. On your Automation screen, click Create new Pack.
  2. Enter
    Pack name: My first Pack
    Description: This is a Pack.
  3. Click Create. The new Pack is displayed on your Automations screen.

helloworldpack

Creating a new Automation

  1. Click Create Automation.
  2. Enter the parameters:
    • Automation Name: Hello World
    • Automation description: This is Hello World
    • Tags: Demo, Hello World
  3. Select a type of trigger: Manual
  4. Click Create Automation. You will be redirected to the Edit page of the Automation.

Automation Step: printing hello world

  1. Click to open the Action panel. Alternatively, you can drag Actions to your flow, from the menu on the left side of your Edit screen.
  2. Search and select the Bash Action.
  3. Enter the following parameters in your Step.
    • Click on Action #1 to change the name of the action to Print Hello World
    • Code: echo "Hello World"
  4. Test the Step by clicking Test run. In the Output field you will see Hello World.COMPLETED appears on the right side of the Step, indicating the Step has succeeded.
  5. Click Save draft.

hello world step1

Automation Step: printing hello world using input parameters

The same Automation Step can be created using input parameters.

Setting input parameters

  1. On the Edit scree, click Input Parameters.

  2. Enter the parameters:

    ParameterDescription
    Parameter NameName
    Parameter TypeText
    Required ParameterCheck the box
    Display NameName
    PlaceholderName for greeting
    Default ValueJon

    InputParameters

  3. Click Apply. The parameters are displayed under Input Parameters.

Updating the Step

  1. Click to open the Action panel. Alternatively, you can drag Actions to your flow, from the menu on the left side of your Edit screen.
  2. Search and select the Bash Action.
  3. Enter the following parameters in your Step.
    • Click on Action #1 to change the name of the action to Print hello world.
    • Code: echo {{inputs.user_name}}
  4. Test the Step by clicking Test run.
  5. Enter the input parameter Name: Jon. In the Output field you will see hello Jon.
    COMPLETED appears on the right side of the Step, indicating the Step has succeeded.
  6. Click Save draft.

hello world reference

Automation Step: printing hello world using Python and input parameters

The same Automation Step can be created using python. In Python action, you can access the context object dictionary and get values from input parameters, variables and Step outputs.

  1. Click to open the Action panel. Alternatively, you can drag Actions to your flow, from the menu on the left side of your Edit screen.

  2. Search and select the Python Action.

  3. Enter the following parameters in your Step.

    • Click on Action #2 to change the name of the action to Print hello world using Python.
    • Code: print("hello" + context.inputs.name)
      print(context.steps.s1.output)
  4. Test the Step by clicking Test run.

  5. Enter the input parameter Name: Jon. In the Output field you will see:

    hello Jon 
    Hello Jon

    COMPLETED appears on the right side of the Step, indicating the Step has succeeded. The Step took the input parameter and the output from the previous Step to produce the output.

    hello world python

  6. Click Save draft.

Running the Automation

The Automation can be run in several ways:

  • Manually in an interactive session: While creating an Automation we start a session and run steps or sections one by one, so we can edit them and rerun them in the same session.
  • Manually in a non-interactive session: This is when you run the entire workflow. This can be triggered from the Automation page by clicking on Run All button or from the Automation page.