Implode mode

Reassemble a previously exploded array into a single event.

Features 

  • Collect individual events which have been emitted as part of an explode and store them in memory. When all (or a specified number) of the exploded events have been collected they will be emitted in a single event.

  • Specify the data from incoming individual events to collect into the single event emitted by the current action.

  • Specify a GUID to collect only related events together - usually the GUID emitted in events as part of an explode operation.

  • Specify the number of events that the implode should collect - usually the size of an exploded array.

Configuration Options 

  • mode: 'implode'

  • item_path: The individual items to collect into an array in the output event.

  • guid_path: The unique GUID used to identify exploded events.

  • size_path: The number of events implode should collect before emitting an event.

Emitted Events 

{
  "implode": [
    {
      "receive_webhook": {
        "numbers": [1, 2, 3]
      },
      "explode_array": {
        "guid": "8bc687b5-764f-492e-9210-21ac502ffa98",
        "index": 0,
        "size": 3,
        "number": 1
      }
    },
    {
      "receive_webhook": {
        "numbers": [1, 2, 3]
      },
      "explode_array": {
        "guid": "8bc687b5-764f-492e-9210-21ac502ffa98",
        "index": 1,
        "size": 3,
        "number": 2
      }
    },
    {
      "receive_webhook": {
        "numbers": [1, 2, 3]
      },
      "explode_array": {
        "guid": "8bc687b5-764f-492e-9210-21ac502ffa98",
        "index": 2,
        "size": 3,
        "number": 3
      }
    }
  ]
}

Example Configuration Options 

Reassemble an array of 'exploded' URLs from a previous action in the story.

{
  "mode": "implode",
  "item_path": "{{.transform_url.new_url}}",
  "guid_path": "{{.explode_urls.guid}}",
  "size_path": "{{.explode_urls.size}}"
}

Reassemble split events from branches of a story which were running asynchronous.

{
  "mode": "implode",
  "guid_path": "{% story_run_guid %}",
  "size_path": "3"
}

Consolidate API paging requests into a single event by setting the size to the number of pages available.

{
  "mode": "implode",
  "guid_path": "{% story_run_guid %}",
  "size_path": "{{ .get_all_actions.body.meta.pages }}"
}