# Retrieve Media

<!-- meta: type=retrieve-media; location=Media; category=Step (action); platforms=Joomla and WordPress (where applicable) -->

## Overview

Gets images or videos so later steps in your flow can use them. You can fetch one file, several files, or every file in a folder — from your Joomla Media library, by typing a path, from a web address, or from information passed in by an earlier step.

When the flow reaches this step, JOrchestrator executes **Retrieve Media** against your linked site or an external integration, using the field values you set on **General** and **Design**. Downstream steps can read the output payload fields defined for this node.

## Why use this node

Retrieve Media is a **action step** in the **Media** group. Action steps run in the middle or end of a flow. They perform work on your CMS, call external services, or transform data for the next step.

Typical reasons teams add **Retrieve Media** to a flow:

- Retrieve Media on your linked Joomla site when the flow reaches this step
- Retrieve media based on webhook, schedule, or CMS event data
- Integrate Media operations with messaging, AI, or database steps in one canvas

## Example workflows

Common patterns on the canvas:

1. **Trigger or Webhook** → upstream steps → **Retrieve Media** → **Send Email** or CMS update
2. **Scheduled trigger** → **Retrieve Media** → **Debug** (while testing) → production action

## How to set it up

On the Design tab, choose Single file, Multiple paths, or All media in folder. For a single file you can browse Media, paste a path or URL, or drag in a field from a previous step. For multiple files, pick from Media and/or list extra paths and URLs below.

## Good to know

By default you receive links to the files. Turn on file body output only if a later step needs the actual file contents, not just the link.

## Properties panel

The designer shows these tabs for this node:

| Tab | Purpose |
|-----|---------|
| **Info** | Plain-language description and output payload fields for downstream steps |
| **General** | Canvas label and read-only node ID |
| **AI** | Optional assistant to help draft settings from plain language |
| **Design** | Node-specific configuration fields |

### System (automatic — not edited by the user)

These fields are managed by the designer or runtime — you do not type into them directly:

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `_nodeId` | Node ID | `node-id` | No | — | — |
| `_payloadFields` | Available Fields | `payload-panel` | No | — | — |

### User-configured — General tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `label` | Label | `text` | No | — | Node label |

### User-configured — Design tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `retrieveMode` | Retrieve mode | `select` (`single` \| `paths` \| `folder`; default: `single`) | No | — | — |
| `mediaPath` | Media path, URL, or payload field | `payload-text` | No | `retrieveMode === 'single'` | blog/hero.jpg, https://..., or {{Node.field}} Relative path under /images, http(s) URL, data: URI, or a {{placeholder}} from upstream nodes. |
| `mediaPathsText` | Additional paths, URLs, or payload fields | `textarea` | No | `retrieveMode === 'paths'` | One per line, comma-separated, or JSON array — e.g. blog/a.jpg, https://..., {{Node.url}} |
| `folder` | Folder under /images | `payload-text` | No | `retrieveMode === 'folder'` | blog/2025 Leave blank to scan all allowed media under /images (respects max files). |
| `recursive` | Include subfolders | `checkbox` | No | `retrieveMode === 'folder'` | — |
| `maxFiles` | Max files | `select` (`10` \| `25` \| `50` \| `100` \| `250`; default: `50`) | No | `retrieveMode === 'folder'` | — |
| `bodyEncoding` | Body encoding | `select` (`auto` \| `base64` \| `text` \| `none`; default: `auto`) | No | — | How file bytes are returned in items[].body. none = metadata/URLs only. |

### CMS-backed (options from the linked site)

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `mediaPaths` | Media files | `media-select-multi` | No | `retrieveMode === 'paths'` | Select one or more files from Joomla Media Browse Joomla /images, or add paths and URLs in the field below. |

### CMS site configuration (not on this node's properties panel)

Credentials, API keys, mailers, SMTP, and integration defaults are configured in the CMS plugin under **Node Configuration**, not per step on this node. Link the flow to a domain before testing CMS-backed fields.

## Output payload fields

After this step runs, later nodes can reference these fields using placeholders such as
`{{retrieve_media.success}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `success` | boolean | Whether the operation completed successfully. |
| `count` | number | Number of items in the result set. |
| `items` | array | Array of per-file result objects (path, url, body, etc.). |
| `paths` | array | Array of file paths that were processed. |
| `urls` | array | Array of public URLs for retrieved files. |
| `path` | string | Path under /images or original URL/data URI for remote sources. |
| `url` | string | Public HTTP URL to a resource on the site. |
| `image` | string | Public URL to an image asset (alias of url/media). |
| `media` | string | Public URL to a media asset. |
| `filename` | string | File name without directory path. |
| `body` | string | File bytes as base64 or text, depending on Body encoding. |
| `bodyEncoding` | string | How body is encoded: auto, base64, text, or none. |
| `contentType` | string | MIME type of the body content. |
| `byteLength` | number | Size of retrieved content in bytes. |
| `message` | string | Human-readable status, error, or result summary. |

## Related nodes

Other steps in the same area of the palette:

- **Delete Media** (`delete-media`) — Media
- **Delete Media** (`wp-delete-media`) — Media
- **Retrieve Media** (`wp-retrieve-media`) — Media
- **Update Media** (`update-media`) — Media
- **Update Media** (`wp-update-media`) — Media
