# Workflow Composition Nodes

Nodes for executing workflows from within other workflows. These require the `flowdrop_workflow_executor` module.

---

## Workflow Executor

Executes a child workflow from within the current workflow. Supports both synchronous (wait for results) and asynchronous (fire and forget) execution modes.

**Category:** Workflow Execution

### Configuration

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| **workflow_id** | String | Yes | The ID of the child workflow to execute |
| **execution_mode** | String | No | `synchronous` (wait for results) or `asynchronous` (continue immediately) |

### Input Ports

| Port | Type | Description |
|------|------|-------------|
| **input_data** | Mixed | Data to pass to the child workflow as initial data |

### Output Ports

| Port | Type | Description |
|------|------|-------------|
| **result** | Mixed | The child workflow's output (synchronous mode only) |
| **pipeline_id** | String | The child pipeline ID (for later retrieval in async mode) |

### Usage Patterns

- **Synchronous** — The parent workflow pauses until the child completes. Use for short sub-workflows where you need the result immediately.
- **Asynchronous** — The parent workflow continues immediately. Use **Workflow Results Retriever** later to fetch the results.

### Tips

- Extract common logic (e.g., sending notifications, data enrichment) into reusable child workflows.
- Test child workflows independently in the [Playground](../../modules/flowdrop_playground.md) before calling them from a parent.

---

## Workflow Results Retriever

Retrieves the results of a previously executed child workflow. Use this with asynchronous child workflows to fetch their results later in the parent workflow.

**Category:** Workflow Execution

### Input Ports

| Port | Type | Required | Description |
|------|------|----------|-------------|
| **pipeline_id** | String | Yes | The pipeline ID of the child workflow (from Workflow Executor's output) |

### Output Ports

| Port | Type | Description |
|------|------|-------------|
| **result** | Mixed | The child workflow's output data |
| **status** | String | Pipeline status (completed, running, failed, etc.) |
