---
title: Implode mode
url: https://www.tines.com/docs/actions/types/event-transformation/implode/
updated: 2024-06-17T14:23:48+00:00
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Actions](https://www.tines.com/llm/docs/actions.md) › [Types](https://www.tines.com/llm/docs/actions/types.md) › [Event Transform](https://www.tines.com/llm/docs/actions/types/event-transformation.md)*

# Implode mode

*[View on tines.com](https://www.tines.com/docs/actions/types/event-transformation/implode/)*

Reassemble a previously exploded array into a single event.

For a demo of `explode` and `implode` in use in a story see [here](https://explained.tines.com/en/articles/7228858-using-explode-and-implode-in-tines).

## Features

- Collect individual events which have been emitted as part of an explode and store them in memory. When either all of, a specified number of, or after waiting a specified amount of time, the exploded events that have been collected 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.
- Specify the amount of time that implode should collect events for before emitting an event. 

## Configuration Options

- `mode`: 'implode'
- `item_path`: The path to 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.
- `seconds`: The number of seconds to wait after implode receives the first event before emitting an event. This can also be used in conjunction with `size_path`, resulting in an event being emitted as soon as either the `size_path` or `seconds` requirement is reached.

## Emitted Events

```json
{
  "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:

```json
{
  "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:

```json
{
  "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:

```json
{
  "mode": "implode",
  "item_path": "<<get_all_actions.body.results>>",
  "guid_path": "<<STORY_RUN_GUID()>>",
  "size_path": "<<get_all_actions.body.meta.pages>>"
}
```

Consolidate API paging requests into a single event after waiting five minutes:

```json

{
  "mode": "implode",
  "item_path": "<<get_all_actions.body.results>>",
  "guid_path": "<<STORY_RUN_GUID()>>",
  "seconds": 300
}
```
