Groups

Overview 

group is a collection of actions in a story. Groups enable a better organization of complex stories by extracting well-defined branches of a story into a group.

Creating a group 

Create a group by selecting multiple actions and clicking "Group". You can also use the keyboard shortcut Cmd/Ctrl + G.

Restrictions 

  1. A group cannot have an associated form

  2. Webhook or IMAP actions cannot be grouped

  3. Actions in a group cannot be scheduled

Configuration Options. 

  • payload: Provide data that should be sent to the group. Include information from upstream events by specifying a wrapped JSONPath.

  • loop: (Optional) Specify the name of a field in an incoming event that contains a list.

Inputs and Outputs 

Each group will have both a group input and group output.

Group Input 

The group input defines custom fields that can be sent to the group, such as inputs. This will allow you to easily pass data to your group from its parent story.

A group input can have more than one custom option, which must be one of the supported data types.

  1. Object: Displays an object builder

  2. Plain Text: Displays a plaintext input field

  3. Checkbox: Renders the options as a single option checkbox

  4. Number: Renders a number input field

  5. Formula: Renders formula input field

Group Output 

The group output configures the data being returned from the group.

Looping 

You can also configure the action for array processing using the LOOP action option. Looping helps you to easily process an array and transform, filter or reduce incoming events.

The loop will be processed serially in order to preserve the ordering of the array for event output.

  • Specify the path to a field in an incoming Event that contains a list and Tines will invoke the action for each element of the list.

  • When specifying the output event payload, a LOOP object will be provided for each loop iteration. The LOOP object will contain:

    • value – The current value in the loop.

    • index – The current index in the loop.

  • A single output event will be emitted to the Group containing an aggregate of the loop results for the array.

  • The payload of the output event will always be a list. It can potentially contain NULL elements.

  • The loop option is only available on a top level Group. It cannot be configured for a nested Group.

Loop size limits
  • A loop can only be ran on a list that contains fewer than 20,000 elements.

  • If you wish to loop over a list that contains more than 20,000 elements, it is recommended that:

    • The CHUNK_ARRAY function is used to break the list into a list of smaller lists.

    • An Explode Mode Event Transformation action is used to emit an event for each of the smaller lists.

    • The lists contained in each emitted event can be looped over without exceeding the loop size limit.

Loop error handling
  • If one index in the array produces a failure, the loop processing is stopped and an error is logged / indicated to the user.

  • Error path handling is required if it is necessary to proceed with loop processing so should be built into the story.

Example Configuration Options 

Looping 

Given the incoming Group below, process each element in the list and output an aggregated event result containing the payload message for each element in the list.

{
  "numbers": [1, 2, 3]
}
{
  "loop": "=numbers",
  "payload": "Message: This is index # <<LOOP.index>>, value=<<LOOP.value>>"
}
[
    "message": "Message: This is index #0, value=1",
    "message": "Message: This is index #1, value=2",
    "message": "Message: This is index #2, value=3"
]
Was this helpful?