Link Search Menu Expand Document

Greeting Example

This simple example workflow uses a single action state to call the vorteil/greeting action, which ‘greets’ the user specified in the "name" field of the input provided to the workflow.

Workflow YAML

id: greeting
functions:
- id: greeter
  image: vorteil/greeting:v2
  type: reusable
description: "A simple action that greets you" 
states:
- id: greeter
  type: action
  action: 
    function: greeter
    input: jq(.)
  transform: 'jq({ "greeting": .return.greeting })'

Input

{
    "name": "Trent"
}

Output

The results of this action will contain a greeting addressed to the provided name.

{
    "return": {
        "greeting": "Welcome to Direktiv, Trent!"
    }
}

Copyright © 2021 Vorteil.io.