# Join

### Overview

The **Join Component** merges messages from the `join` port with each message on the `in` port, ensuring that data from both sources is combined before proceeding in the workflow.

### Usage

This component is useful for synchronizing data streams, allowing separate inputs to be merged into a single structured message.

#### Input Ports

| Port   | Description                                                                          |
| ------ | ------------------------------------------------------------------------------------ |
| `join` | Receives a message that will be attached to every message arriving on the `in` port. |
| `in`   | Receives primary input messages that will be merged with the `join` message.         |

#### Output Ports

| Port  | Description                                                 |
| ----- | ----------------------------------------------------------- |
| `out` | Sends merged messages combining data from both input ports. |

#### Processing Logic

1. **Receives Join Message**: Stores the message received on the `join` port.
2. **Queues Incoming Messages**: Messages from the `in` port are queued until a `join` message is available.
3. **Merges Data**: Once both inputs are received, messages are combined and sent to the `out` port.
4. **Respects Execution Order**: Ensures `join` data is only applied to messages from the current test execution.

### Notes

* **Ensures Data Synchronization**: Prevents messages from being processed until a `join` message is received.
* **Supports Test Automation**: Works alongside `BeforeAll` and `AfterAll` to maintain test flow consistency.
* **Efficient Message Processing**: Queues and batches messages for optimal execution.

This component is essential for workflows requiring data synchronization across multiple input streams before further processing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmixer.com/connector-configuration/utils/test/join.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
