Actions can be configured directly on the storyboard page or by clicking “Edit” from the toolbar.

Actions are configured using a “Common Config” and an “Options block”. When creating and editing actions a page displaying both configurations is presented:

Action configuration options
Action configuration options

Common Config

All seven action types have a set of configuration options that describe the basic operation of the action, this is known as the action’s Common Config, a description of options included in the common config is shown below.

Name: Provide a name for the action.

Schedule: Depending on the action type, specify when the action should run.

Keep events: Specify how long events should be retained in Tines. When this period lapses, events will be purged.

Depending on the action type, all options may not be available in the common config. See the below table for a description of the availability of “Schedule”, “Sources”, and “Receivers”.

Action Type Can be Scheduled Can Receive Events Can Emit Events
Email Action No Yes Yes
Event Transformation Action No Yes Yes
HTTP Request Action Yes Yes Yes
IMAP Action Yes No Yes
Trigger Action No Yes Yes
Webhook Action No No Yes
Send to Story Action Yes Yes Yes

Source and Receiver Actions

When an action runs, either on a schedule or on receipt of an event from a source action, it will generate a new event and emit it to receiving actions.

As shown below, by dragging a string between actions, we define where events should be emitted. In this case, when the source action (“Webhook Action”) runs, it will emit events to the receiver action (“Deduplicate Events”).

Setting source and receiver actions
Setting source and receiver actions

Options Block

The options block defines the exact action an action should perform at run-time and is unique to each action type. The options block is a JSON object which consists of key/value pairs. Information from incoming events can be referenced in an action’s options block by including “wrapped JSONPaths”. Shown below is an example of an options block from an Email Action. For detailed instructions covering the configuration of options blocks, see individual articles on Action Types.

{
  "recipients": "{{.recipient.emailAddress}}",
  "subject": "New Tines alert",
  "body": "Malicious behaviour has been detected."
}

Working with Events and JSONPaths

Every Tines event is a JSON object. The data within Tines events can be accessed in action configurations using JSONPaths.

{
  "customerName":"John Doe",
  "address":
  {
    "streetAddress":
    {
      "number":123,
      "street":"Sample Street"
    },
    "city":"Example Town"
  }
  "orders":
  [
    {
      "orderId":23284,
      "itemName":"Widget",
      "itemPrice":33.99
    },
    {
      "orderId":63122,
      "itemName":"Gadget",
      "itemPrice":22.50
    },
    {
      "orderId":77284,
      "itemName":"Sprocket",
      "itemPrice":12.00
    }
  ]
}

To insert information from an incoming event into an action’s options block, use the following syntax. Here, key_name is the name of the key to insert.

{{ .key_name }}

The following wrapped JSONPath will insert the value of the customerName key from the above, sample Tines event.

{{ .customerName }}

John Doe

To access information in a nested JSON key, use the following syntax:

{{ .key_name.subkey_name }}

The following wrapped JSONPath will insert the value of the city key from the above, sample Tines event.

{{ .address.city }}

Example Town

Accessing Data in Nested Keys

You can query further levels of subkeys using the following syntax.

{{ .address.streetAddress.street }}

Sample Street

Accessing Data in Arrays

Arrays are queried using an array index expression inside square brackets ([]). For example, the following wrapped JSONPath can be used to access the first element of the “orders” array:

{{ .orders[0] }}

{ 
  "orderId":23284, 
  "itemName":"Widget", 
  "itemPrice":33.99 
}

The following wrapped JSONPath will return the itemPrice from the 2nd element of the orders array.

{{ .orders[1].itemPrice }}

{ 
  "orderId":63122, 
  "itemName":"Gadget", 
  "itemPrice":22.50 
}

API Autocomplete

When editing or creating an action, ‘API Autocomplete’ allows you to more easily define JSONPaths in the options block. In an options block, when a period is entered between two sets of curly braces, Tines will provide a list of available keys from the most recent event emitted by the defined source action(s). When a key is selected and another period is pressed, Tines will present the keys from the most recent event at that level.

API Autocomplete in options block
API Autocomplete in options block