# Update Media

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

## Overview

Replaces an existing file under /images with new bytes from an http(s) URL or data: URI.

When the flow reaches this step, JOrchestrator executes **Update 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

Update 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 **Update Media** to a flow:

- Update Media on your linked Joomla site when the flow reaches this step
- Update 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 → **Update Media** → **Send Email** or CMS update
2. **Scheduled trigger** → **Update Media** → **Debug** (while testing) → production action

## How to set it up

Path is relative to /images (e.g. blog/hero.png).

## Good to know

Use after AI image nodes to overwrite a fixed hero path without changing article HTML.

## 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 |
|--------------|-------|------|----------|--------------|-------|
| `mediaPath` | Media path | `payload-text` | **Yes** | — | blog/hero.png Existing file to replace, relative to /images. |
| `imageSource` | New media URL or data URI | `textarea` | **Yes** | — | https://... or data:image/png;base64,... or data:video/mp4;base64,... |

### 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
`{{update_media.success}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `success` | boolean | Whether the operation completed successfully. |
| `path` | string | Filesystem-relative path (often under /images). |
| `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. |
| `bytesWritten` | number | Number of bytes written to storage. |
| `message` | string | Human-readable status, error, or result summary. |

## Validation rules

- **Media path** (`mediaPath`) must be filled before the flow can be saved.
- **New media URL or data URI** (`imageSource`) must be filled before the flow can be saved.

## Related nodes

Other steps in the same area of the palette:

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